#include <xmlflateval.h>
Public Member Functions | |
virtual std::string | getName () const |
Get the type of this evaluator. | |
virtual void | addImport (const std::string &code, const xercesc::DOMElement *e, bool deprecated=false) |
virtual bool | valueIsOfType (const boost::shared_ptr< void > &value, ValueType type) const |
virtual std::map < boost::filesystem::path, std::pair < boost::filesystem::path, bool > > & | requiredFiles () const |
return a list of all required files of the evaluator (excluding dependent files of libraries) | |
virtual bool | useOneBasedIndexes () |
Return true if the evaluator used one based indexes or false if zero based indexes are used. | |
![]() | |
~Eval () | |
Destructor. | |
void | addParam (const std::string ¶mName, const boost::shared_ptr< void > &value) |
Add a value to the current parameters. | |
void | addParamSet (const xercesc::DOMElement *e) |
boost::shared_ptr< void > | eval (const xercesc::DOMElement *e) |
boost::shared_ptr< void > | eval (const xercesc::DOMAttr *a, const xercesc::DOMElement *pe=NULL) |
template<typename T > | |
T | cast (const boost::shared_ptr< void > &value, xercesc::DOMDocument *doc) const |
template<typename T > | |
T | cast (const boost::shared_ptr< void > &value) const |
see cast(const boost::shared_ptr<void> &value, shared_ptr<DOMDocument> &doc) | |
boost::shared_ptr< void > | stringToValue (const std::string &str, const xercesc::DOMElement *e=NULL, bool fullEval=true) const |
template<class T > | |
boost::shared_ptr< void > | create (const T &v) const |
create a value of the given type | |
template<> | |
string | cast (const shared_ptr< void > &value) const |
template<> | |
CodeString | cast (const shared_ptr< void > &value) const |
template<> | |
double | cast (const shared_ptr< void > &value) const |
template<> | |
int | cast (const shared_ptr< void > &value) const |
template<> | |
vector< double > | cast (const shared_ptr< void > &value) const |
template<> | |
vector< vector< double > > | cast (const shared_ptr< void > &value) const |
template<> | |
DOMElement * | cast (const shared_ptr< void > &value, xercesc::DOMDocument *doc) const |
template<> | |
shared_ptr< void > | create (const double &v) const |
template<> | |
shared_ptr< void > | create (const vector< double > &v) const |
template<> | |
shared_ptr< void > | create (const vector< vector< double > > &v) const |
template<> | |
shared_ptr< void > | create (const string &v) const |
template<> | |
CodeString | cast (const boost::shared_ptr< void > &value) const |
template<> | |
double | cast (const boost::shared_ptr< void > &value) const |
template<> | |
int | cast (const boost::shared_ptr< void > &value) const |
template<> | |
boost::shared_ptr< void > | create (const double &v) const |
![]() | |
Atom & | operator= (const Atom &) |
void | setMessageStreamActive (MsgType type, bool active) |
void | getMessageStream (MsgType type, boost::shared_ptr< bool > &a, boost::shared_ptr< std::ostream > &s) |
void | adoptMessageStreams (const Atom *src=NULL) |
std::ostream & | msg (MsgType type) |
bool | msgAct (MsgType type) |
Static Public Member Functions | |
static std::string | getNameStatic () |
![]() | |
static boost::shared_ptr< Eval > | createEvaluator (const std::string &evalName, std::vector< boost::filesystem::path > *dependencies_=NULL) |
Create a evaluator. | |
template<class E > | |
static void | registerEvaluator () |
![]() | |
static void | setCurrentMessageStream (MsgType type, const boost::shared_ptr< bool > &a=boost::make_shared< bool >(true), const boost::shared_ptr< std::ostream > &s=boost::make_shared< std::ostream >(std::cout.rdbuf())) |
static std::ostream & | msgStatic (MsgType type) |
static bool | msgActStatic (MsgType type) |
Protected Member Functions | |
XMLFlatEval (std::vector< boost::filesystem::path > *dependencies_=NULL) | |
virtual boost::shared_ptr< void > | createSwigByTypeName (const std::string &typeName) const |
create a SWIG object of name typeName. | |
virtual boost::shared_ptr< void > | callFunction (const std::string &name, const std::vector< boost::shared_ptr< void > > &args) const |
virtual boost::shared_ptr< void > | fullStringToValue (const std::string &str, const xercesc::DOMElement *e=NULL) const |
evaluate the string str using the current parameters and return the result. | |
virtual void * | getSwigThis (const boost::shared_ptr< void > &value) const |
get the SWIG pointer of this value. | |
virtual std::string | getSwigType (const boost::shared_ptr< void > &value) const |
get the SWIG type (class name) of this value. | |
![]() | |
Eval (std::vector< boost::filesystem::path > *dependencies_) | |
Constructor. | |
void | pushContext () |
Push the current context to a internal stack. | |
void | popContext () |
Overwrite the current context with the top level context from the internal stack. | |
template<typename T > | |
boost::shared_ptr< void > | createSwig () const |
std::string | partialStringToString (const std::string &str, const xercesc::DOMElement *e) const |
evaluate str partially and return result as an std::string | |
void | addStaticDependencies (const xercesc::DOMElement *e) const |
![]() | |
Atom (const Atom &src) | |
Friends | |
class | Eval |
Additional Inherited Members | |
![]() | |
enum | ValueType { ScalarType, VectorType, MatrixType, StringType, SXFunctionType } |
![]() | |
enum | MsgType |
![]() | |
template<class E > | |
static boost::shared_ptr< Eval > | newEvaluator (std::vector< boost::filesystem::path > *dependencies_) |
![]() | |
std::vector < boost::filesystem::path > * | dependencies |
std::unordered_map < std::string, boost::shared_ptr< void > > | currentParam |
std::stack< std::unordered_map < std::string, boost::shared_ptr< void > > > | paramStack |
boost::shared_ptr< void > | currentImport |
std::stack< boost::shared_ptr < void > > | importStack |
![]() | |
static boost::shared_ptr< void > | casadiValue |
A (dummy) evaluator taking the xmlflat syntax as input and output. This evaluator cannot evaluate any expresion nor any parametrisation or casadi actions can be done. Its just a dummy evaluator for testing. But it can be used for evaluate xmlflat file or a normal file without and parametrisation and without any expression.
|
virtual |
Import evaluator statements. This routine highly depends on the evaluator. See the spezialized evaluators documentation for details.
Implements MBXMLUtils::Eval.
|
protectedvirtual |
Return the value of a call to name using the arguments args. The following functions must be implemented by the evaluator:
Implements MBXMLUtils::Eval.
|
virtual |
check whether value is of type type. Note that true is only returned if the value is really of type type. If value can be casted to type type but is not of this type then false is returned. Note that their are evaluators (e.g. octave) which cannot distinguish between e.g. a scalar, a vector of size 1 or a matrix of size 1x1. Hence, these evaluators will return true for ScalarType in all these three cases and analog for VectorType.
Implements MBXMLUtils::Eval.