1 #ifndef _MBXMLUTILS_OCTEVAL_H_ 2 #define _MBXMLUTILS_OCTEVAL_H_ 8 class octave_value_list;
12 class SymbolicExpression;
15 namespace XERCES_CPP_NAMESPACE {
class DOMElement; }
17 namespace MBXMLUtils {
19 std::shared_ptr<octave_value> C(
const Eval::Value &value);
31 OctEval(std::vector<boost::filesystem::path> *dependencies_=
nullptr);
45 void addImport(
const std::string &code,
const xercesc::DOMElement *e)
override;
47 void addImportHelper(
const boost::filesystem::path &dir);
53 std::map<boost::filesystem::path, std::pair<boost::filesystem::path, bool> >&
requiredFiles()
const override;
61 std::map<std::string, octave_value> vn;
62 std::map<std::string, octave_value> gvn;
63 std::map<std::string, octave_value> ufn;
64 std::map<std::string, octave_value> tlvn;
70 Value fullStringToValue(
const std::string &str,
const xercesc::DOMElement *e,
bool skipRet=
false)
const override;
72 static octave_value_list fevalThrow(octave_function *func,
const octave_value_list &arg,
int n=0,
73 const std::string &msg=std::string());
75 static void* getSwigPtr(
const octave_value &v);
76 static Value createSwigByTypeName(
const std::string &name);
77 static std::string getSwigType(
const octave_value &value);
79 Value callFunction(
const std::string &name,
const std::vector<Value>& args)
const override;
81 double cast_double (
const Value &value)
const override;
82 std::vector<double> cast_vector_double (
const Value &value)
const override;
83 std::vector<std::vector<double> > cast_vector_vector_double(
const Value &value)
const override;
84 std::string cast_string (
const Value &value)
const override;
86 Value create_double (
const double& v)
const override;
87 Value create_vector_double (
const std::vector<double>& v)
const override;
88 Value create_vector_vector_double (
const std::vector<std::vector<double> >& v)
const override;
89 Value create_string (
const std::string& v)
const override;
95 std::string serializeFunction(
const Value &x)
const override;
Value callFunction(const std::string &name, const std::vector< Value > &args) const override
Definition: octeval.cc:792
Value createFunctionDep(const std::vector< Value > &v) const override
create a vector function dependent
Definition: octeval.cc:298
Value fullStringToValue(const std::string &str, const xercesc::DOMElement *e, bool skipRet=false) const override
evaluate str fully and return result as an octave variable
Definition: octeval.cc:508
void convertIndex(Value &v, bool evalTo1Based) override
Definition: octeval.h:55
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:744
~OctEval() override
Destructor.
std::string getName() const override
Get the type of this evaluator.
Definition: octeval.h:39
Value createFunction(const std::vector< Value > &indeps, const Value &dep) const override
create a Function with n independents and a dependent function (scalar, vector or matrix)
Definition: octeval.cc:332
OctEval(std::vector< boost::filesystem::path > *dependencies_=nullptr)
Constructor.
Definition: octeval.cc:402
bool valueIsOfType(const Value &value, ValueType type) const override
get the type of value
Definition: octeval.cc:675
void addImport(const std::string &code, const xercesc::DOMElement *e) override
Definition: octeval.cc:485
Value createFunctionIndep(int dim) const override
create a function independent variable. If dim == 0 a scalar is created else a vector.
Definition: octeval.cc:413
std::shared_ptr< void > Value
Typedef for a shared value.
Definition: eval.h:91
static std::string getNameStatic()
Get the name of this evaluator.
Definition: octeval.h:38
ValueType
Definition: eval.h:82