Public Member Functions | Friends | List of all members

Defines a scalar-valued index variable to be used for exporting code. More...

#include <export_index.hpp>

Inheritance diagram for ExportIndex:
Inheritance graph
[legend]

Public Member Functions

virtual returnValue exportDataDeclaration (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
 
 ExportIndex ()
 
 ExportIndex (const int _value)
 
 ExportIndex (const std::string &_name, const std::string &_prefix=std::string())
 
const std::string get () const
 
int getGivenValue () const
 
bool isBinary () const
 
bool isGiven () const
 
bool isVariable () const
 
 operator ExportArgument ()
 
ExportIndexNodeoperator-> ()
 
const ExportIndexNodeoperator-> () const
 
- Public Member Functions inherited from ExportData
 ExportData ()
 
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 ()
 
ExportDataInternaloperator-> ()
 
const ExportDataInternaloperator-> () 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 SharedObjectNodeget () const
 Get a const pointer to the node. More...
 
SharedObjectNodeget ()
 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...
 
SharedObjectNodeoperator-> ()
 Access a member function or object. More...
 
const SharedObjectNodeoperator-> () const
 Const access a member function or object. More...
 
SharedObjectoperator= (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...
 

Friends

ExportIndex operator% (const ExportIndex &_arg1, const ExportIndex &_arg2)
 
ExportIndex operator* (const ExportIndex &_arg1, const ExportIndex &_arg2)
 
ExportIndex operator+ (const ExportIndex &_arg1, const ExportIndex &_arg2)
 
ExportIndex operator- (const ExportIndex &_arg1, const ExportIndex &_arg2)
 
ExportIndex operator/ (const ExportIndex &_arg1, const ExportIndex &_arg2)
 
std::string operator== (const ExportIndex &_arg1, const ExportIndex &_arg2)
 

Detailed Description

Defines a scalar-valued index variable to be used for exporting code.

The class ExportIndex defines a scalar-valued index variable to be used for exporting code. Instances of this class can be used similar to usual integers but offer additional functionality, e.g. they allow to export arithmetic expressions involving indices of the form:

Author
Hans Joachim Ferreau, Boris Houska, Milan Vukov

Definition at line 54 of file export_index.hpp.

Constructor & Destructor Documentation

BEGIN_NAMESPACE_ACADO ExportIndex::ExportIndex ( )

Definition at line 44 of file export_index.cpp.

ExportIndex::ExportIndex ( const int  _value)

Definition at line 48 of file export_index.cpp.

ExportIndex::ExportIndex ( const std::string &  _name,
const std::string &  _prefix = std::string() 
)
explicit

Definition at line 53 of file export_index.cpp.

Member Function Documentation

returnValue ExportIndex::exportDataDeclaration ( std::ostream &  stream,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int",
int  _precision = 16 
) const
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 from ExportData.

Definition at line 72 of file export_index.cpp.

const std::string ExportIndex::get ( ) const

Returns a string containing the value of the index.

\return std::string containing the value of the index.

Definition at line 246 of file export_index.cpp.

int ExportIndex::getGivenValue ( ) const

Returns the given value of the index (if defined).

\return Given value of the index or "undefinedValue".

Definition at line 252 of file export_index.cpp.

bool ExportIndex::isBinary ( ) const

Definition at line 263 of file export_index.cpp.

bool ExportIndex::isGiven ( ) const

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 258 of file export_index.cpp.

bool ExportIndex::isVariable ( ) const

Definition at line 268 of file export_index.cpp.

ExportIndex::operator ExportArgument ( )

Definition at line 274 of file export_index.cpp.

ExportIndexNode * ExportIndex::operator-> ( )

Definition at line 60 of file export_index.cpp.

const ExportIndexNode * ExportIndex::operator-> ( ) const

Definition at line 66 of file export_index.cpp.

Friends And Related Function Documentation

ExportIndex operator% ( const ExportIndex _arg1,
const ExportIndex _arg2 
)
friend

Definition at line 217 of file export_index.cpp.

ExportIndex operator* ( const ExportIndex _arg1,
const ExportIndex _arg2 
)
friend

Definition at line 166 of file export_index.cpp.

ExportIndex operator+ ( const ExportIndex _arg1,
const ExportIndex _arg2 
)
friend

Definition at line 82 of file export_index.cpp.

ExportIndex operator- ( const ExportIndex _arg1,
const ExportIndex _arg2 
)
friend

Definition at line 125 of file export_index.cpp.

ExportIndex operator/ ( const ExportIndex _arg1,
const ExportIndex _arg2 
)
friend

Definition at line 199 of file export_index.cpp.

std::string operator== ( const ExportIndex _arg1,
const ExportIndex _arg2 
)
friend

Definition at line 235 of file export_index.cpp.


The documentation for this class was generated from the following files:


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:23