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_=nullptr);
28 
29  public:
31  ~OctEval() override;
32 
34  static std::string getNameStatic() { return "octave"; }
35  std::string getName() const override { return getNameStatic(); }
36 
41  void addImport(const std::string &code, const xercesc::DOMElement *e) override;
42 
44  bool valueIsOfType(const Value &value, ValueType type) const override;
45 
47  std::map<boost::filesystem::path, std::pair<boost::filesystem::path, bool> >& requiredFiles() const override;
48 
49  void convertIndex(Value &v, bool evalTo1Based) override {}
50 
51  protected:
52 
54  Value fullStringToValue(const std::string &str, const xercesc::DOMElement *e=nullptr) const override;
55 
57  void* getSwigThis(const Value &value) const override;
58 
60  std::string getSwigType(const Value &value) const override;
61 
62  Value createSwigByTypeName(const std::string &name) const override;
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  Value callFunction(const std::string &name, const std::vector<Value>& args) const override;
68 
69  double cast_double (const Value &value) const override;
70  std::vector<double> cast_vector_double (const Value &value) const override;
71  std::vector<std::vector<double> > cast_vector_vector_double(const Value &value) const override;
72  std::string cast_string (const Value &value) const override;
73 
74  Value create_double (const double& v) const override;
75  Value create_vector_double (const std::vector<double>& v) const override;
76  Value create_vector_vector_double(const std::vector<std::vector<double> >& v) const override;
77  Value create_string (const std::string& v) const override;
78 };
79 
80 } // end namespace MBXMLUtils
81 
82 #endif
Value callFunction(const std::string &name, const std::vector< Value > &args) const override
Definition: octeval.cc:551
Definition: eval.h:78
void * getSwigThis(const Value &value) const override
get the SWIG pointer of this value.
Definition: octeval.cc:479
Definition: octeval.h:22
Value fullStringToValue(const std::string &str, const xercesc::DOMElement *e=nullptr) const override
evaluate str fully and return result as an octave variable
Definition: octeval.cc:344
void convertIndex(Value &v, bool evalTo1Based) override
Definition: octeval.h:49
~OctEval() override
Destructor.
std::string getName() const override
Get the type of this evaluator.
Definition: octeval.h:35
std::string getSwigType(const Value &value) const override
get the SWIG class name of this value.
Definition: octeval.cc:489
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) ...
Definition: octeval.cc:498
OctEval(std::vector< boost::filesystem::path > *dependencies_=nullptr)
Constructor.
Definition: octeval.cc:299
bool valueIsOfType(const Value &value, ValueType type) const override
get the type of value
Definition: octeval.cc:430
std::ostream & msg(MsgType type) const
void addImport(const std::string &code, const xercesc::DOMElement *e) override
Definition: octeval.cc:306
Value createSwigByTypeName(const std::string &name) const override
create a SWIG object of name typeName.
Definition: octeval.cc:292
static std::string getNameStatic()
Get the name of this evaluator.
Definition: octeval.h:34
ValueType
Definition: eval.h:84

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Home