libRoadRunner C API  1.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rrc_cpp_support.h
Go to the documentation of this file.
1 
42 #ifndef rrc_cpp_supportH
43 #define rrc_cpp_supportH
44 
45 #include <vector>
46 #include "rr-libstruct/lsMatrix.h"
47 #include "rrRoadRunnerData.h"
48 #include "rrStringList.h"
49 #include "rrNewArrayList.h"
50 #include "rrc_types.h"
51 #include "rrc_exporter.h"
52 
53 namespace rr
54 {
55 class RoadRunner;
56 }
57 
58 //When using the rrc_core_api from C++, the following routines are useful
59 namespace rrc
60 {
61 using std::string;
62 using std::vector;
63 
70 C_DECL_SPEC void setError(const string& err);
71 
78 C_DECL_SPEC rr::RoadRunner* castToRoadRunner(RRHandle rrHandle);
79 
86 C_DECL_SPEC rr::RoadRunnerData* castToRRData(RRDataHandle rrDataHandle);
87 
88 
89 
97 C_DECL_SPEC bool copyVector(const RRVector* source, vector<double>& dest);
98 
105 C_DECL_SPEC RRVectorPtr createVector(const vector<double>& vec);
106 
113 C_DECL_SPEC RRComplexVectorPtr createVector(const vector<ls::Complex>& vec);
114 
121 C_DECL_SPEC vector<double> createVector(const RRVector* vec);
122 
129 C_DECL_SPEC RRDoubleMatrixPtr createMatrix(const ls::DoubleMatrix* mat);
130 
137 C_DECL_SPEC ls::DoubleMatrix* createMatrix(const RRDoubleMatrixPtr mat);
138 
139 
146 C_DECL_SPEC RRComplexMatrixPtr createMatrix(const ls::ComplexMatrix* mat);
147 
148 //Lists and arrays
155 C_DECL_SPEC RRStringArrayPtr createList(const rr::StringList& list);
156 
163 C_DECL_SPEC RRListPtr createArrayList(const NewArrayList& list);
164 
165 //Result data
172 C_DECL_SPEC RRCDataPtr createRRCData(const rr::RoadRunnerData& data);
173 
174 }
175 #endif
176 
177 
Structure for a simple vector of strings.
Definition: rrc_types.h:67
roadRunner C API 2012
RRCDataPtr createRRCData(RRDataHandle rrData)
Create a RoadRunner C data structure (RRCDataPtr) from RoadRunner data.
Definition: rrc_utilities.cpp:62
Structure for a simple vector of doubles.
Definition: rrc_types.h:59
Structure for a simple double Matrix type.
Definition: rrc_types.h:75
void * RRHandle
Void pointer to a RoadRunner instance.
Definition: rrc_types.h:50
RRVectorPtr createVector(int size)
Create a new vector with a given size.
Definition: rrc_utilities.cpp:367
Structure for a simple complex Matrix type.
Definition: rrc_types.h:102
Structure for the result type from the simulate calls.
Definition: rrc_types.h:112
A list type, stores int, double, strings and lists.
Definition: rrc_types.h:149
Structure for a simple complex Vector type.
Definition: rrc_types.h:93
void * RRDataHandle
Void pointer to a RoadRunner data instance.
Definition: rrc_types.h:53
roadRunner C API 2012