1 #ifndef _MBXMLUTILS_OCTEVAL_H_
2 #define _MBXMLUTILS_OCTEVAL_H_
5 #include <boost/scoped_ptr.hpp>
6 #include <boost/shared_ptr.hpp>
7 #include <boost/make_shared.hpp>
10 class octave_value_list;
11 class octave_function;
13 namespace XERCES_CPP_NAMESPACE {
class DOMElement; }
15 namespace MBXMLUtils {
17 boost::shared_ptr<octave_value> C(
const boost::shared_ptr<void> &value);
19 boost::shared_ptr<void> C(
const octave_value &value);
29 OctEval(std::vector<boost::filesystem::path> *dependencies_=NULL);
43 void addImport(
const std::string &code,
const xercesc::DOMElement *e,
bool deprecated=
false);
49 std::map<boost::filesystem::path, std::pair<boost::filesystem::path, bool> >&
requiredFiles()
const;
60 virtual boost::shared_ptr<void>
fullStringToValue(
const std::string &str,
const xercesc::DOMElement *e=NULL)
const;
63 void*
getSwigThis(
const boost::shared_ptr<void> &value)
const;
66 std::string
getSwigType(
const boost::shared_ptr<void> &value)
const;
71 static std::string initialPath;
72 static std::string pathSep;
76 static octave_value_list fevalThrow(octave_function *func,
const octave_value_list &arg,
int n=0,
77 const std::string &
msg=std::string());
79 virtual boost::shared_ptr<void>
callFunction(
const std::string &name,
const std::vector<boost::shared_ptr<void> >& args)
const;
81 virtual double cast_double (
const boost::shared_ptr<void> &value)
const;
82 virtual std::vector<double> cast_vector_double (
const boost::shared_ptr<void> &value)
const;
83 virtual std::vector<std::vector<double> > cast_vector_vector_double(
const boost::shared_ptr<void> &value)
const;
84 virtual std::string cast_string (
const boost::shared_ptr<void> &value)
const;
86 virtual boost::shared_ptr<void> create_double (
const double& v)
const;
87 virtual boost::shared_ptr<void> create_vector_double (
const std::vector<double>& v)
const;
88 virtual boost::shared_ptr<void> create_vector_vector_double(
const std::vector<std::vector<double> >& v)
const;
89 virtual boost::shared_ptr<void> create_string (
const std::string& v)
const;
void addImport(const std::string &code, const xercesc::DOMElement *e, bool deprecated=false)
Definition: octeval.cc:302
void deinitOctave()
This function deinitialized octave. It is used in the dtor and before exceptions in the ctor are thro...
Definition: octeval.cc:288
bool valueIsOfType(const boost::shared_ptr< void > &value, ValueType type) const
get the type of value
Definition: octeval.cc:426
OctEval(std::vector< boost::filesystem::path > *dependencies_=NULL)
Constructor.
Definition: octeval.cc:203
virtual bool useOneBasedIndexes()
Return true if the evaluator used one based indexes or false if zero based indexes are used...
Definition: octeval.h:51
void * getSwigThis(const boost::shared_ptr< void > &value) const
get the SWIG pointer of this value.
Definition: octeval.cc:477
boost::shared_ptr< void > createSwigByTypeName(const std::string &typeName) const
create a SWIG object of name typeName.
Definition: octeval.cc:192
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:496
~OctEval()
Destructor.
Definition: octeval.cc:284
virtual boost::shared_ptr< void > callFunction(const std::string &name, const std::vector< boost::shared_ptr< void > > &args) const
Definition: octeval.cc:551
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
Definition: octeval.cc:343
std::string getSwigType(const boost::shared_ptr< void > &value) const
get the SWIG class name of this value.
Definition: octeval.cc:487
std::string getName() const
Get the type of this evaluator.
Definition: octeval.h:37
static std::string getNameStatic()
Get the name of this evaluator.
Definition: octeval.h:36
ValueType
Definition: eval.h:83