#include <octeval.h>
Public Member Functions | |
| ~OctEval () override | |
| Destructor. | |
| std::string | getName () const override |
| Get the type of this evaluator. | |
| void | addImport (const std::string &code, const xercesc::DOMElement *e) override |
| bool | valueIsOfType (const Value &value, ValueType type) const override |
| get the type of value | |
|
std::map < boost::filesystem::path, std::pair < boost::filesystem::path, bool > > & | requiredFiles () const override |
| return a list of all required files of octave (excluding dependent files of libraries) | |
| void | convertIndex (Value &v, bool evalTo1Based) override |
Public Member Functions inherited from MBXMLUtils::Eval | |
| ~Eval () override | |
| Destructor. | |
| Eval (const Eval &other)=delete | |
| Eval (Eval &&other)=delete | |
| Eval & | operator= (const Eval &other)=delete |
| Eval & | operator= (Eval &&other)=delete |
| void | addParam (const std::string ¶mName, const Value &value) |
| Add a value to the current parameters. | |
| void | addParamSet (const xercesc::DOMElement *e) |
| Value | eval (const xercesc::DOMElement *e) |
| Value | eval (const xercesc::DOMAttr *a) |
| template<typename T > | |
| T | cast (const Value &value, xercesc::DOMDocument *doc) const |
| template<typename T > | |
| T | cast (const Value &value) const |
| see cast(const Value &value, shared_ptr<DOMDocument> &doc) | |
| Value | stringToValue (const std::string &str, const xercesc::DOMElement *e=nullptr, bool fullEval=true) const |
| template<class T > | |
| Value | create (const T &v) const |
| create a value of the given type | |
| template<> | |
| string | cast (const Value &value) const |
| template<> | |
| CodeString | cast (const Value &value) const |
| template<> | |
| double | cast (const Value &value) const |
| template<> | |
| int | cast (const Value &value) const |
| template<> | |
| vector< double > | cast (const Value &value) const |
| template<> | |
| SX | cast (const Value &value) const |
| template<> | |
| vector< vector< double > > | cast (const Value &value) const |
| template<> | |
| DOMElement * | cast (const Value &value, xercesc::DOMDocument *doc) const |
| template<> | |
| Eval::Value | create (const double &v) const |
| template<> | |
| Eval::Value | create (const vector< double > &v) const |
| template<> | |
| Eval::Value | create (const vector< vector< double > > &v) const |
| template<> | |
| Eval::Value | create (const string &v) const |
| template<> | |
| CodeString | cast (const Value &value) const |
| template<> | |
| double | cast (const Value &value) const |
| template<> | |
| int | cast (const Value &value) const |
| template<> | |
| Eval::Function | cast (const Value &value) const |
| template<> | |
| Eval::Value | create (const double &v) const |
Public Member Functions inherited from fmatvec::Atom | |
| Atom & | operator= (const Atom &) |
| void | setMessageStreamActive (MsgType type, bool activeFlag) |
| void | getMessageStream (MsgType type, std::shared_ptr< bool > &a, std::shared_ptr< std::ostream > &s) const |
| void | adoptMessageStreams (const Atom *src=nullptr) |
| std::ostream & | msg (MsgType type) const |
| bool | msgAct (MsgType type) const |
Static Public Member Functions | |
| static std::string | getNameStatic () |
| Get the name of this evaluator. | |
Static Public Member Functions inherited from MBXMLUtils::Eval | |
| static std::shared_ptr< Eval > | createEvaluator (const std::string &evalName, std::vector< boost::filesystem::path > *dependencies_=nullptr) |
| Create a evaluator. | |
| template<class E > | |
| static void | registerEvaluator () |
| static void | setValue (xercesc::DOMElement *e, const Value &v) |
| Set value on DOMElement (is used by Eval::cast) | |
Static Public Member Functions inherited from fmatvec::Atom | |
| static void | setCurrentMessageStream (MsgType type, const std::shared_ptr< bool > &a=std::make_shared< bool >(true), const std::shared_ptr< std::ostream > &s=std::make_shared< std::ostream >(std::cout.rdbuf())) |
| static std::ostream & | msgStatic (MsgType type) |
| static bool | msgActStatic (MsgType type) |
Protected Member Functions | |
| OctEval (std::vector< boost::filesystem::path > *dependencies_=nullptr) | |
| Constructor. | |
| Value | fullStringToValue (const std::string &str, const xercesc::DOMElement *e=nullptr) const override |
| evaluate str fully and return result as an octave variable | |
| void * | getSwigThis (const Value &value) const override |
| get the SWIG pointer of this value. | |
| std::string | getSwigType (const Value &value) const override |
| get the SWIG class name of this value. | |
| Value | createSwigByTypeName (const std::string &name) const override |
| create a SWIG object of name typeName. | |
| Value | callFunction (const std::string &name, const std::vector< Value > &args) const override |
| double | cast_double (const Value &value) const override |
| std::vector< double > | cast_vector_double (const Value &value) const override |
|
std::vector< std::vector < double > > | cast_vector_vector_double (const Value &value) const override |
| std::string | cast_string (const Value &value) const override |
| Value | create_double (const double &v) const override |
| Value | create_vector_double (const std::vector< double > &v) const override |
| Value | create_vector_vector_double (const std::vector< std::vector< double > > &v) const override |
| Value | create_string (const std::string &v) const override |
Protected Member Functions inherited from MBXMLUtils::Eval | |
| 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 > | |
| Value | 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 |
Protected Member Functions inherited from fmatvec::Atom | |
| Atom (const Atom &src) | |
Static Protected Member Functions | |
| static octave_value_list | fevalThrow (octave_function *func, const octave_value_list &arg, int n=0, const std::string &msg=std::string()) |
Static Protected Member Functions inherited from MBXMLUtils::Eval | |
| template<class E > | |
| static std::shared_ptr< Eval > | newEvaluator (std::vector< boost::filesystem::path > *dependencies_) |
Friends | |
| class | Eval |
Additional Inherited Members | |
Public Types inherited from MBXMLUtils::Eval | |
| enum | ValueType { ScalarType, VectorType, MatrixType, StringType, FunctionType } |
|
typedef std::pair< std::vector < casadi::SX >, std::vector < casadi::SX > > | Function |
| Typedef for a shared value. | |
|
typedef boost::variant < std::shared_ptr< void > , Function > | Value |
Public Types inherited from fmatvec::Atom | |
| enum | MsgType |
Protected Attributes inherited from MBXMLUtils::Eval | |
|
std::vector < boost::filesystem::path > * | dependencies |
|
std::unordered_map < std::string, Value > | currentParam |
|
std::stack< std::unordered_map < std::string, Value > > | paramStack |
| std::shared_ptr< void > | currentImport |
|
std::stack< std::shared_ptr < void > > | importStack |
| Value | casadiValue |
Octave expression evaluator and converter.
|
overridevirtual |
Add octave search path to the current evaluator context. code must evaluate to a string representing a directory/path. A relative path is expanded to an absolute path using the path of e as current directory. The absolute path is then added using "addpath" to the octave search path.
Implements MBXMLUtils::Eval.
|
overrideprotectedvirtual |
Return the value of a call to name using the arguments args. The following functions must be implemented by the evaluator:
Implements MBXMLUtils::Eval.
|
inlineoverridevirtual |
convert a index (scalar or vector). if evalTo1Based == true: convert from the script language 0/1 base to 1 base. if evalTo1Based == false: convert from 1 base to the script language 0/1 base.
Implements MBXMLUtils::Eval.