All Classes Namespaces Functions Typedefs Enumerations
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Friends | List of all members
MBXMLUtils::OctEval Class Reference

#include <octeval.h>

Inheritance diagram for MBXMLUtils::OctEval:
MBXMLUtils::Eval fmatvec::Atom

Public Member Functions

 ~OctEval ()
 Destructor.
 
std::string getName () const
 Get the type of this evaluator.
 
void addImport (const std::string &code, const xercesc::DOMElement *e, bool deprecated=false)
 
bool valueIsOfType (const boost::shared_ptr< void > &value, ValueType type) const
 get the type of value
 
std::map
< boost::filesystem::path,
std::pair
< boost::filesystem::path,
bool > > & 
requiredFiles () const
 return a list of all required files of octave (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.
 
- Public Member Functions inherited from MBXMLUtils::Eval
 ~Eval ()
 Destructor.
 
void addParam (const std::string &paramName, 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 >
cast (const boost::shared_ptr< void > &value, xercesc::DOMDocument *doc) const
 
template<typename 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
 
- Public Member Functions inherited from fmatvec::Atom
Atomoperator= (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 ()
 Get the name of this evaluator.
 
- Static Public Member Functions inherited from MBXMLUtils::Eval
static boost::shared_ptr< EvalcreateEvaluator (const std::string &evalName, std::vector< boost::filesystem::path > *dependencies_=NULL)
 Create a evaluator.
 
template<class E >
static void registerEvaluator ()
 
- Static Public Member Functions inherited from fmatvec::Atom
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

 OctEval (std::vector< boost::filesystem::path > *dependencies_=NULL)
 Constructor.
 
void deinitOctave ()
 This function deinitialized octave. It is used in the dtor and before exceptions in the ctor are thrown.
 
virtual boost::shared_ptr< void > fullStringToValue (const std::string &str, const xercesc::DOMElement *e=NULL) const
 evaluate str fully and return result as an octave variable
 
void * getSwigThis (const boost::shared_ptr< void > &value) const
 get the SWIG pointer of this value.
 
std::string getSwigType (const boost::shared_ptr< void > &value) const
 get the SWIG class name of this value.
 
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 double cast_double (const boost::shared_ptr< void > &value) const
 
virtual std::vector< double > cast_vector_double (const boost::shared_ptr< void > &value) const
 
virtual std::vector
< std::vector< double > > 
cast_vector_vector_double (const boost::shared_ptr< void > &value) const
 
virtual std::string cast_string (const boost::shared_ptr< void > &value) const
 
virtual boost::shared_ptr< void > create_double (const double &v) const
 
virtual boost::shared_ptr< void > create_vector_double (const std::vector< double > &v) const
 
virtual boost::shared_ptr< void > create_vector_vector_double (const std::vector< std::vector< double > > &v) const
 
virtual boost::shared_ptr< void > create_string (const std::string &v) const
 
- 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 >
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
 
- 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 boost::shared_ptr< EvalnewEvaluator (std::vector< boost::filesystem::path > *dependencies_)
 

Static Protected Attributes

static std::string initialPath
 
static std::string pathSep
 
static int initCount =0
 
- Static Protected Attributes inherited from MBXMLUtils::Eval
static boost::shared_ptr< void > casadiValue
 

Friends

class Eval
 

Additional Inherited Members

- Public Types inherited from MBXMLUtils::Eval
enum  ValueType {
  ScalarType, VectorType, MatrixType, StringType,
  SXFunctionType
}
 
- 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,
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
 

Detailed Description

Octave expression evaluator and converter.

Member Function Documentation

void MBXMLUtils::OctEval::addImport ( const std::string &  code,
const xercesc::DOMElement *  e,
bool  deprecated = false 
)
virtual

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.

shared_ptr< void > MBXMLUtils::OctEval::callFunction ( const std::string &  name,
const std::vector< boost::shared_ptr< void > > &  args 
) const
protectedvirtual

Return the value of a call to name using the arguments args. The following functions must be implemented by the evaluator:

  • rotateAboutX(alpha): returns a 3x3 rotation matrix about the x-axis by angle alpha which is given in rad.
  • rotateAboutY(beta): returns a 3x3 rotation matrix about the y-axis by angle beta which is given in rad.
  • rotateAboutZ(gamma): returns a 3x3 rotation matrix about the z-axis by angle gamma which is given in rad.
  • cardan(alpha, beta, gamma): returns a 3x3 rotation matrix of a cardan rotation about the angles alpha, beta and gamma which are given in rad.
  • euler(PHI, theta, phi): returns a 3x3 rotation matrix of a euler rotation about the angles PHI, theta and phi which are given in rad.
  • load(filename): returns a NxM matrix of the data stored in the file filename. filename may be a absolute or relative path. A relative path is interprete relative to the location of the XML file with the load statement. (The abstract Eval class guarantees that the current path is at the XML file if load is called)

Implements MBXMLUtils::Eval.


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

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML