pelib
2.0.0
|
#include <AlgebraDataParser.hpp>
Public Member Functions | |
virtual std::string | getDetailedPattern ()=0 |
virtual std::string | getGlobalPattern ()=0 |
virtual AlgebraData * | parse (std::istream &in)=0 |
Static Public Member Functions | |
template<class Target > | |
static Target | convert (std::string element, bool strict=0) |
Static Protected Member Functions | |
static bool | is_decimal (const std::type_info &var) |
static bool | is_integer (const std::type_info &var) |
Base class of any class able to parse a text into a data structure that can be contained in an instance of Algebra. This class must be derived to be used
Definition at line 42 of file AlgebraDataParser.hpp.
static Target pelib::AlgebraDataParser::convert | ( | std::string | element, |
bool | strict = 0 |
||
) | [inline, static] |
Converts a string into an instance of T and throws a ParseException upon conversion error. If T is a numeric base type (int, float and derivatives) and strict is true, then an attempt to convert a string that matches an integer value into a float or double results in throwing a NoDecimalException
Definition at line 49 of file AlgebraDataParser.hpp.
virtual std::string pelib::AlgebraDataParser::getDetailedPattern | ( | ) | [pure virtual] |
Returns a boost regular expression that extracts all data in the text to parse, that is stored in the corresponding data structure produced, such as its name or its values.
Implemented in pelib::AmplInputSet< Value, Key >, pelib::AmplInputVector< Key, Value >, pelib::AmplInputScalar< Value >, pelib::AmplOutputMatrix< Col, Row, Value >, pelib::AmplInputMatrix< Col, Row, Value >, pelib::AmplOutputSet< Value, Key >, pelib::AmplOutputVector< Key, Value >, and pelib::AmplOutputScalar< Value >.
virtual std::string pelib::AlgebraDataParser::getGlobalPattern | ( | ) | [pure virtual] |
Returns a boost regular expression that matches the string representation of an algebraic data structure
Implemented in pelib::AmplInputSet< Value, Key >, pelib::AmplInputVector< Key, Value >, pelib::AmplInputScalar< Value >, pelib::AmplOutputMatrix< Col, Row, Value >, pelib::AmplInputMatrix< Col, Row, Value >, pelib::AmplOutputSet< Value, Key >, pelib::AmplOutputVector< Key, Value >, and pelib::AmplOutputScalar< Value >.
static bool pelib::AlgebraDataParser::is_decimal | ( | const std::type_info & | var | ) | [inline, static, protected] |
Definition at line 303 of file AlgebraDataParser.hpp.
static bool pelib::AlgebraDataParser::is_integer | ( | const std::type_info & | var | ) | [inline, static, protected] |
Definition at line 310 of file AlgebraDataParser.hpp.
virtual AlgebraData* pelib::AlgebraDataParser::parse | ( | std::istream & | in | ) | [pure virtual] |
Parses a text stream into a new instance derived from AlgebraData
Implemented in pelib::AmplOutputMatrix< Col, Row, Value >, pelib::AmplInputMatrix< Col, Row, Value >, pelib::AmplOutputVector< Key, Value >, pelib::AmplOutputSet< Value, Key >, pelib::AmplOutputScalar< Value >, pelib::AmplInputVector< Key, Value >, pelib::AmplInputSet< Value, Key >, and pelib::AmplInputScalar< Value >.