pelib
2.0.0
|
#include <AmplInput.hpp>
Public Member Functions | |
AmplInput (std::pair< std::vector< AmplInputDataParser * >, std::vector< AmplInputDataOutput * > > handlers) | |
virtual | ~AmplInput () |
Algebra | parse (std::istream &data) const |
virtual void | dump (std::ostream &o, const Algebra &record) const |
virtual void | dump (std::ostream &o, const AlgebraData *data) const |
virtual void | dump (std::ostream &o, const AlgebraData &data) const |
virtual AmplInput & | operator= (const AmplInput &rhs) |
Static Public Member Functions | |
static std::vector < AmplInputDataParser * > | floatParsers () |
static std::vector < AmplInputDataOutput * > | floatOutputs () |
static std::pair< std::vector < AmplInputDataParser * > , std::vector < AmplInputDataOutput * > > | floatHandlers () |
static std::vector < AmplInputDataParser * > | intFloatParsers () |
static std::vector < AmplInputDataOutput * > | intFloatOutputs () |
static std::pair< std::vector < AmplInputDataParser * > , std::vector < AmplInputDataOutput * > > | intFloatHandlers () |
static std::vector < AmplInputDataParser * > | stringParsers () |
static std::vector < AmplInputDataOutput * > | stringOutputs () |
static std::pair< std::vector < AmplInputDataParser * > , std::vector < AmplInputDataOutput * > > | stringHandlers () |
Protected Member Functions | |
void | deleteParsers () |
void | deleteOutputs () |
Protected Attributes | |
std::vector < AmplInputDataParser * > | parsers |
std::vector < AmplInputDataOutput * > | outputs |
Parses and output AMPL input data format (.dat) from and to AlgebraData instances, using AmplInputDataParsers and AmplInputDataOutputs
Definition at line 40 of file AmplInput.hpp.
pelib::AmplInput::AmplInput | ( | std::pair< std::vector< AmplInputDataParser * >, std::vector< AmplInputDataOutput * > > | handlers | ) |
Creates a new instance of AmplInput parser and output. Parser and Output attempt to use all parsers and output classes until one produces output without throwing any instance of Parse- or Cast- exceptions.
Definition at line 69 of file AmplInput.cpp.
pelib::AmplInput::~AmplInput | ( | ) | [virtual] |
Destroys the parser and output classes and destroys this instance.
Definition at line 75 of file AmplInput.cpp.
void pelib::AmplInput::deleteOutputs | ( | ) | [protected] |
Flushes the output collection
Definition at line 92 of file AmplInput.cpp.
void pelib::AmplInput::deleteParsers | ( | ) | [protected] |
Flushes the parser collection
Definition at line 82 of file AmplInput.cpp.
void pelib::AmplInput::dump | ( | std::ostream & | o, |
const Algebra & | record | ||
) | const [virtual] |
Outputs all elements in the given Algebra instance into output stream in output stream o in AmplInput format, using output classes given when the class was instanciated. Also output all string-based AlgebraData instances
Implements pelib::AlgebraOutput.
Definition at line 203 of file AmplInput.cpp.
void pelib::AmplInput::dump | ( | std::ostream & | o, |
const AlgebraData * | data | ||
) | const [virtual] |
Outputs an instance of AlgebraData instance into output stream in output stream o in AmplInput format, using output classes given when the class was instanciated. If no output could produce an output, uses a string-based output class
Implements pelib::AlgebraOutput.
Definition at line 213 of file AmplInput.cpp.
void pelib::AmplInput::dump | ( | std::ostream & | o, |
const AlgebraData & | data | ||
) | const [virtual] |
Outputs an instance of AlgebraData instance into output stream in output stream o in AmplInput format, using output classes given when the class was instanciated. If no output could produce an output, uses a string-based output class
Definition at line 255 of file AmplInput.cpp.
std::pair< std::vector< AmplInputDataParser * >, std::vector< AmplInputDataOutput * > > pelib::AmplInput::floatHandlers | ( | ) | [static] |
Default AmplInput parsers and outputs to produce and output float derivatives instances of AmplInputScalar, AmplInputVector, AmplInputMatrix and AmplInputSet classes.
Definition at line 284 of file AmplInput.cpp.
std::vector< AmplInputDataOutput * > pelib::AmplInput::floatOutputs | ( | ) | [static] |
Default AmplInput outputs to output float derivatives instances of AmplInputScalar, AmplInputVector, AmplInputMatrix and AmplInputSet classes.
Definition at line 272 of file AmplInput.cpp.
std::vector< AmplInputDataParser * > pelib::AmplInput::floatParsers | ( | ) | [static] |
Default AmplInput parsers to produce float derivatives instances of AmplInputScalar, AmplInputVector, AmplInputMatrix and AmplInputSet classes.
Definition at line 260 of file AmplInput.cpp.
std::pair< std::vector< AmplInputDataParser * >, std::vector< AmplInputDataOutput * > > pelib::AmplInput::intFloatHandlers | ( | ) | [static] |
Default AmplInput parsers and outputs to produce and output integer and float derivatives instances of AmplInputScalar, AmplInputVector, AmplInputMatrix and AmplInputSet classes.
Definition at line 349 of file AmplInput.cpp.
std::vector< AmplInputDataOutput * > pelib::AmplInput::intFloatOutputs | ( | ) | [static] |
Default AmplInput outputs to output integer or float derivatives instances of AmplInputScalar, AmplInputVector, AmplInputMatrix and AmplInputSet classes.
Definition at line 333 of file AmplInput.cpp.
std::vector< AmplInputDataParser * > pelib::AmplInput::intFloatParsers | ( | ) | [static] |
Default AmplInput parsers to produce integer or float derivatives instances of AmplInputScalar, AmplInputVector, AmplInputMatrix and AmplInputSet classes.
Definition at line 318 of file AmplInput.cpp.
Copy constructor. Flushes all AmplInputData Parser and Output classes and copies the ones from the instance of AmplInput given as reference
Definition at line 101 of file AmplInput.cpp.
Algebra pelib::AmplInput::parse | ( | std::istream & | data | ) | const [virtual] |
Parses AMPL input text from input stream and returns an instance of Algebra containing all data structure that could be parsed successfully, using parsers in the parser collection given when the class was instanciated. Parsing is performed in strict mode (See AlgebraDataParser). Any element that could not be parsed is parsed as Scalar, Vector, Matrix or Set of strings.
Implements pelib::AlgebraParser.
Definition at line 120 of file AmplInput.cpp.
std::pair< std::vector< AmplInputDataParser * >, std::vector< AmplInputDataOutput * > > pelib::AmplInput::stringHandlers | ( | ) | [static] |
Default AmplInput parsers and outputs to produce and output float derivatives instances of AmplInputScalar, AmplInputVector, AmplInputMatrix and AmplInputSet classes. Used at last resort in parsing and output operations.
Definition at line 313 of file AmplInput.cpp.
std::vector< AmplInputDataOutput * > pelib::AmplInput::stringOutputs | ( | ) | [static] |
Default AmplInput outputs to output string derivatives instances of AmplInputScalar, AmplInputVector, AmplInputMatrix and AmplInputSet classes. Used as last-resort outputs
Definition at line 301 of file AmplInput.cpp.
std::vector< AmplInputDataParser * > pelib::AmplInput::stringParsers | ( | ) | [static] |
Default AmplInput parsers to produce string derivatives instances of AmplInputScalar, AmplInputVector, AmplInputMatrix and AmplInputSet classes. Used as last-resort parsers.
Definition at line 289 of file AmplInput.cpp.
std::vector<AmplInputDataOutput*> pelib::AmplInput::outputs [protected] |
Contains output classes
Definition at line 99 of file AmplInput.hpp.
std::vector<AmplInputDataParser*> pelib::AmplInput::parsers [protected] |
Contains parser classes
Definition at line 97 of file AmplInput.hpp.