pelib  2.0.0
pelib::AmplInputSet< Value, Key > Class Template Reference

#include <AmplInputSet.hpp>

Inheritance diagram for pelib::AmplInputSet< Value, Key >:
[legend]

List of all members.

Public Member Functions

 AmplInputSet (bool strict=true)
virtual AmplInputSetclone () const
virtual AlgebraDataparse (std::istream &in)
virtual void dump (std::ostream &o, const AlgebraData *data) const
virtual std::string getDetailedPattern ()
virtual std::string getGlobalPattern ()

Protected Attributes

bool strict

Detailed Description

template<class Value, class Key = size_t>
class pelib::AmplInputSet< Value, Key >

Parser and output class for Set in AMPL input data text format

Definition at line 36 of file AmplInputSet.hpp.


Constructor & Destructor Documentation

template<class Value , class Key = size_t>
pelib::AmplInputSet< Value, Key >::AmplInputSet ( bool  strict = true) [inline]

Constructor

Parameters:
strictIf true and Value is a floating-point numeric type, fails if one element is an integer. An integer written as a float (e.g. 52.0) doesn't make the parser to fail

Definition at line 45 of file AmplInputSet.hpp.


Member Function Documentation

template<class Value , class Key = size_t>
virtual AmplInputSet* pelib::AmplInputSet< Value, Key >::clone ( ) const [inline, virtual]

Returns a pointer to a copy of this class instance

Implements pelib::AmplInputDataOutput.

Definition at line 53 of file AmplInputSet.hpp.

template<class Value , class Key = size_t>
virtual void pelib::AmplInputSet< Value, Key >::dump ( std::ostream &  o,
const AlgebraData data 
) const [inline, virtual]

Output all values of instance of pelib::set into output stream in AMPL input data format

Parameters:
oOutput stream to write to in AMPL input data format
dataInstance of pelib::Set whose values are to be written to output stream

Implements pelib::AlgebraDataOutput.

Definition at line 141 of file AmplInputSet.hpp.

template<class Value , class Key = size_t>
virtual std::string pelib::AmplInputSet< Value, Key >::getDetailedPattern ( ) [inline, virtual]

Returns a boost::regex regular expression that matches a Set in AMPL input data format and able to extract its elements

Implements pelib::AlgebraDataParser.

Definition at line 170 of file AmplInputSet.hpp.

template<class Value , class Key = size_t>
virtual std::string pelib::AmplInputSet< Value, Key >::getGlobalPattern ( ) [inline, virtual]

Returns a boost::regex regular expression that matches a Set in AMPL input data format

Implements pelib::AlgebraDataParser.

Definition at line 178 of file AmplInputSet.hpp.

template<class Value , class Key = size_t>
virtual AlgebraData* pelib::AmplInputSet< Value, Key >::parse ( std::istream &  in) [inline, virtual]

Parse input stream in AMPL input data format into a pointer to an instance of pelib::Set

Parameters:
inInput stream in AMPL input data format to be parsed
Returns:
An instance of pelib::Set holding all values parsed from in

Implements pelib::AlgebraDataParser.

Definition at line 63 of file AmplInputSet.hpp.


Member Data Documentation

template<class Value , class Key = size_t>
bool pelib::AmplInputSet< Value, Key >::strict [protected]

Defines if parsin operation should fail upon the parsing of an integer when the Set holds floating-point numeric values

Definition at line 185 of file AmplInputSet.hpp.


The documentation for this class was generated from the following file: