All Classes Namespaces Functions Variables Typedefs Enumerations
octeval.h
1 #ifndef _MBXMLUTILS_OCTEVAL_H_
2 #define _MBXMLUTILS_OCTEVAL_H_
3 
4 #include "eval.h"
5 #include <memory>
6 
7 class octave_value;
8 class octave_value_list;
9 class octave_function;
10 
11 namespace XERCES_CPP_NAMESPACE { class DOMElement; }
12 
13 namespace MBXMLUtils {
14 
15 std::shared_ptr<octave_value> C(const Eval::Value &value);
16 
17 Eval::Value C(const octave_value &value);
18 
19 class OctEval;
20 
22 class OctEval : public Eval {
23  friend class Eval;
24 
25  protected:
27  OctEval(std::vector<boost::filesystem::path> *dependencies_=NULL);
28 
29  public:
31  ~OctEval();
32 
34  static std::string getNameStatic() { return "octave"; }
35  std::string getName() const { return getNameStatic(); }
36 
41  void addImport(const std::string &code, const xercesc::DOMElement *e);
42 
44  bool valueIsOfType(const Value &value, ValueType type) const;
45 
47  std::map<boost::filesystem::path, std::pair<boost::filesystem::path, bool> >& requiredFiles() const;
48 
49  virtual void convertIndex(Value &v, bool evalTo1Based) {}
50 
51  protected:
52 
54  virtual Value fullStringToValue(const std::string &str, const xercesc::DOMElement *e=NULL) const;
55 
57  void* getSwigThis(const Value &value) const;
58 
60  std::string getSwigType(const Value &value) const;
61 
62  Value createSwigByTypeName(const std::string &typeName) const;
63 
64  static octave_value_list fevalThrow(octave_function *func, const octave_value_list &arg, int n=0,
65  const std::string &msg=std::string());
66 
67  virtual Value callFunction(const std::string &name, const std::vector<Value>& args) const;
68 
69  virtual double cast_double (const Value &value) const;
70  virtual std::vector<double> cast_vector_double (const Value &value) const;
71  virtual std::vector<std::vector<double> > cast_vector_vector_double(const Value &value) const;
72  virtual std::string cast_string (const Value &value) const;
73 
74  virtual Value create_double (const double& v) const;
75  virtual Value create_vector_double (const std::vector<double>& v) const;
76  virtual Value create_vector_vector_double(const std::vector<std::vector<double> >& v) const;
77  virtual Value create_string (const std::string& v) const;
78 };
79 
80 } // end namespace MBXMLUtils
81 
82 #endif
Definition: eval.h:76
Definition: octeval.h:22
bool valueIsOfType(const Value &value, ValueType type) const
get the type of value
Definition: octeval.cc:431
virtual void convertIndex(Value &v, bool evalTo1Based)
Definition: octeval.h:49
virtual Value callFunction(const std::string &name, const std::vector< Value > &args) const
Definition: octeval.cc:552
virtual Value fullStringToValue(const std::string &str, const xercesc::DOMElement *e=NULL) const
evaluate str fully and return result as an octave variable
Definition: octeval.cc:348
OctEval(std::vector< boost::filesystem::path > *dependencies_=NULL)
Constructor.
Definition: octeval.cc:302
std::string getSwigType(const Value &value) const
get the SWIG class name of this value.
Definition: octeval.cc:490
void addImport(const std::string &code, const xercesc::DOMElement *e)
Definition: octeval.cc:310
std::ostream & msg(MsgType type)
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) ...
Definition: octeval.cc:499
~OctEval()
Destructor.
Definition: octeval.cc:307
Value createSwigByTypeName(const std::string &typeName) const
create a SWIG object of name typeName.
Definition: octeval.cc:295
void * getSwigThis(const Value &value) const
get the SWIG pointer of this value.
Definition: octeval.cc:480
std::string getName() const
Get the type of this evaluator.
Definition: octeval.h:35
static std::string getNameStatic()
Get the name of this evaluator.
Definition: octeval.h:34
ValueType
Definition: eval.h:82

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML