Abstract base class to define variables to be used for exporting code. More...
#include <export_data.hpp>
Public Member Functions | |
ExportData () | |
virtual returnValue | exportDataDeclaration (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const |
ExportStruct | getDataStruct () const |
std::string | getDataStructString () const |
virtual std::string | getDoc () const |
std::string | getFullName () const |
std::string | getName () const |
std::string | getPrefix () const |
ExportType | getType () const |
std::string | getTypeString (const std::string &_realString="real_t", const std::string &_intString="int") const |
virtual bool | isGiven () |
ExportDataInternal * | operator-> () |
const ExportDataInternal * | operator-> () const |
returnValue | setDataStruct (ExportStruct _dataStruct) |
virtual returnValue | setDoc (const std::string &_doc) |
returnValue | setName (const std::string &_name) |
returnValue | setPrefix (const std::string &_prefix) |
returnValue | setType (ExportType _type) |
virtual | ~ExportData () |
Public Member Functions inherited from CasADi::SharedObject | |
void | assertInit () const |
Assert that it is initialized. More... | |
void | assignNode (SharedObjectNode *node) |
Assign the node to a node class pointer (or null) More... | |
void | assignNodeNoCount (SharedObjectNode *node) |
Assign the node to a node class pointer without reference counting: inproper use will cause memory leaks! More... | |
virtual bool | checkNode () const |
Assert that the node is pointing to the right type of object. More... | |
SharedObject | clone () const |
Deep copy. More... | |
const SharedObjectNode * | get () const |
Get a const pointer to the node. More... | |
SharedObjectNode * | get () |
Get a pointer to the node. More... | |
int | getCount () const |
Get the reference count. More... | |
void | init () |
Initialize the object: more documentation in the node class (SharedObjectNode and derived classes) More... | |
bool | isInit () const |
Is initialized? More... | |
bool | isNull () const |
Is a null pointer? More... | |
SharedObjectNode * | operator-> () |
Access a member function or object. More... | |
const SharedObjectNode * | operator-> () const |
Const access a member function or object. More... | |
SharedObject & | operator= (const SharedObject &ref) |
Assignment operator. More... | |
virtual void | print (std::ostream &stream=std::cout) const |
Print a destription of the object. More... | |
virtual void | repr (std::ostream &stream) const |
Print a representation of the object. More... | |
SharedObject () | |
Default constructor. More... | |
SharedObject (const SharedObject &ref) | |
Copy constructor (shallow copy) More... | |
void | swap (SharedObject &other) |
Swap content with another instance. More... | |
~SharedObject () | |
Destructor. More... | |
void | makeUnique (bool clone_members=true) |
If there are other references to the object, then make a deep copy of it and point to this new object. More... | |
void | makeUnique (std::map< SharedObjectNode *, SharedObject > &already_copied, bool clone_members=true) |
Public Member Functions inherited from CasADi::PrintableObject | |
std::string | getDescription () const |
Return a string with a destription (for SWIG) More... | |
std::string | getRepresentation () const |
Return a string with a representation (for SWIG) More... | |
Abstract base class to define variables to be used for exporting code.
The class ExportData serves as an abstract base class to define variables to be used for exporting code.
Definition at line 55 of file export_data.hpp.
BEGIN_NAMESPACE_ACADO ExportData::ExportData | ( | ) |
Default constructor.
Definition at line 45 of file export_data.cpp.
|
virtual |
Destructor.
Definition at line 48 of file export_data.cpp.
|
virtual |
Exports declaration of the index variable. Its appearance can can be adjusted by various options.
@param[in] stream Name of file to be used to export function. @param[in] _realString std::string to be used to declare real variables. @param[in] _intString std::string to be used to declare integer variables. @param[in] _precision Number of digits to be used for exporting real values. \return SUCCESSFUL_RETURN
Reimplemented in ExportArgument, and ExportIndex.
Definition at line 126 of file export_data.cpp.
ExportStruct ExportData::getDataStruct | ( | ) | const |
Returns the global data struct to which the data object belongs to.
\return Global data struct to which the data object belongs to
Definition at line 109 of file export_data.cpp.
std::string ExportData::getDataStructString | ( | ) | const |
Returns a string containing the global data struct to which the data object belongs to.
\return std::string containing the global data struct to which the data object belongs to.
Definition at line 115 of file export_data.cpp.
|
virtual |
Definition at line 146 of file export_data.cpp.
std::string ExportData::getFullName | ( | ) | const |
Returns the full name of the data object including the possible prefix of the global data struct.
Definition at line 121 of file export_data.cpp.
std::string ExportData::getName | ( | ) | const |
Returns the name of the data object.
\return Name of the data object
Definition at line 86 of file export_data.cpp.
std::string ExportData::getPrefix | ( | ) | const |
Returns a string which contains a prefix name.
Definition at line 96 of file export_data.cpp.
ExportType ExportData::getType | ( | ) | const |
Returns the data type of the data object.
\return Data type of the data object
Definition at line 91 of file export_data.cpp.
std::string ExportData::getTypeString | ( | const std::string & | _realString = "real_t" , |
const std::string & | _intString = "int" |
||
) | const |
Returns a string containing the data type of the data object.
@param[in] _realString std::string to be used to declare real variables. @param[in] _intString std::string to be used to declare integer variables. \return std::string containing the data type of the data object.
Definition at line 101 of file export_data.cpp.
|
virtual |
Returns whether the index is set to a given value.
\return true iff index is set to a given value, \n false otherwise
Definition at line 135 of file export_data.cpp.
ExportDataInternal * ExportData::operator-> | ( | ) |
An operator for access to functions and members of the node
Definition at line 51 of file export_data.cpp.
const ExportDataInternal * ExportData::operator-> | ( | ) | const |
An operator for const access to functions and members of the node
Definition at line 56 of file export_data.cpp.
returnValue ExportData::setDataStruct | ( | ExportStruct | _dataStruct | ) |
Sets the global data struct to which the data object belongs to.
@param[in] _dataStruct New global data struct to which the data object belongs to. \return SUCCESSFUL_RETURN
Definition at line 80 of file export_data.cpp.
|
virtual |
Definition at line 140 of file export_data.cpp.
returnValue ExportData::setName | ( | const std::string & | _name | ) |
Sets the name of the data object.
@param[in] _name New name of the data object. \return SUCCESSFUL_RETURN
Definition at line 61 of file export_data.cpp.
returnValue ExportData::setPrefix | ( | const std::string & | _prefix | ) |
Sets the prefix which is placed before the structure name.
[in] | _prefix | Prefix name. |
Definition at line 74 of file export_data.cpp.
returnValue ExportData::setType | ( | ExportType | _type | ) |
Sets the data type of the data object.
@param[in] _type New data type of the data object. \return SUCCESSFUL_RETURN
Definition at line 68 of file export_data.cpp.