Allows to export code for a block of statements. More...
#include <export_statement_block.hpp>
Protected Attributes | |
StatementPtrArray | statements |
Friends | |
ExportStatementBlock & | operator<< (ExportStatementBlock &_block, const ExportStatement &_statement) |
ExportStatementBlock & | operator<< (ExportStatementBlock &_block, const std::string &_statement) |
Additional Inherited Members | |
Public Types inherited from ExportStatement | |
typedef std::shared_ptr< MemoryAllocator > | MemoryAllocatorPtr |
typedef std::shared_ptr< ExportStatement > | StatementPtr |
typedef std::vector< StatementPtr > | StatementPtrArray |
Static Public Attributes inherited from ExportStatement | |
static std::string | fcnPrefix = "acado" |
static std::string | varPrefix = "ACADO" |
Allows to export code for a block of statements.
The class ExportStatementBlock allows to export code for a block of statements.
Definition at line 63 of file export_statement_block.hpp.
BEGIN_NAMESPACE_ACADO ExportStatementBlock::ExportStatementBlock | ( | ) |
< Default Constructor.
Definition at line 52 of file export_statement_block.cpp.
ExportStatementBlock::ExportStatementBlock | ( | const ExportStatementBlock & | arg | ) |
Copy constructor (deep copy).
@param[in] arg Right-hand side object.
Definition at line 57 of file export_statement_block.cpp.
|
virtual |
Destructor.
Definition at line 63 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addComment | ( | const std::string & | _comment | ) |
Adds a comment to the statement block.
@param[in] _comment Comment to be added.
Definition at line 228 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addComment | ( | uint | _nBlanks, |
const std::string & | _comment | ||
) |
Adds a comment preceded by a given number of blanks to the statement block.
@param[in] _nBlanks Number of blanks. @param[in] _comment Comment to be added.
Definition at line 236 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addDeclaration | ( | const ExportVariable & | _data, |
ExportStruct | _dataStruct = ACADO_ANY |
||
) |
Adds a variable declaration to the statement block.
@param[in] _data Variable declaration to be added.
Definition at line 158 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addDeclaration | ( | const ExportIndex & | _data, |
ExportStruct | _dataStruct = ACADO_ANY |
||
) |
Adds an index declaration to the statement block.
@param[in] _data Index declaration to be added.
Definition at line 177 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addDeclaration | ( | const ExportFunction & | _f | ) |
Adds a function forward declaration to the statement block.
@param[in] _f function forward declaration to be added.
Definition at line 192 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addDeclaration | ( | const ExportAcadoFunction & | _f | ) |
Adds a forward declaration of an ODE function to the statement block.
@param[in] _f ODE function whose forward declaration is to be added.
Definition at line 200 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addFunction | ( | const ExportFunction & | _function | ) |
Adds a function to the statement block.
@param[in] _function Function to be added.
Definition at line 108 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addFunctionCall | ( | const std::string & | _fName, |
const ExportArgument & | _argument1 = emptyConstExportArgument , |
||
const ExportArgument & | _argument2 = emptyConstExportArgument , |
||
const ExportArgument & | _argument3 = emptyConstExportArgument , |
||
const ExportArgument & | _argument4 = emptyConstExportArgument , |
||
const ExportArgument & | _argument5 = emptyConstExportArgument , |
||
const ExportArgument & | _argument6 = emptyConstExportArgument , |
||
const ExportArgument & | _argument7 = emptyConstExportArgument , |
||
const ExportArgument & | _argument8 = emptyConstExportArgument , |
||
const ExportArgument & | _argument9 = emptyConstExportArgument |
||
) |
Adds a function call to the statement block.
@param[in] _fName Name of function to be called.
Definition at line 115 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addFunctionCall | ( | const ExportFunction & | _f, |
const ExportArgument & | _argument1 = emptyConstExportArgument , |
||
const ExportArgument & | _argument2 = emptyConstExportArgument , |
||
const ExportArgument & | _argument3 = emptyConstExportArgument , |
||
const ExportArgument & | _argument4 = emptyConstExportArgument , |
||
const ExportArgument & | _argument5 = emptyConstExportArgument , |
||
const ExportArgument & | _argument6 = emptyConstExportArgument , |
||
const ExportArgument & | _argument7 = emptyConstExportArgument , |
||
const ExportArgument & | _argument8 = emptyConstExportArgument , |
||
const ExportArgument & | _argument9 = emptyConstExportArgument |
||
) |
Adds a function call to the statement block.
@param[in] _f Function to be called.
Definition at line 136 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addLinebreak | ( | uint | num = 1 | ) |
Adds a line break to the statement block.
@param[in] num Number of line breaks to be added.
Definition at line 209 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addStatement | ( | const ExportStatement & | _statement | ) |
Adds a statement to the statement block.
@param[in] _statement Statement to be added.
Definition at line 91 of file export_statement_block.cpp.
returnValue ExportStatementBlock::addStatement | ( | const std::string & | _statementString | ) |
Adds a string statement to the statement block.
@param[in] _statementString std::string statement to be added.
Definition at line 100 of file export_statement_block.cpp.
returnValue ExportStatementBlock::clear | ( | ) |
Removes all statements to yield an empty statement block.
\return SUCCESSFUL_RETURN
Definition at line 289 of file export_statement_block.cpp.
|
virtual |
Clone constructor (deep copy).
\return Pointer to cloned object.
Implements ExportStatement.
Reimplemented in ExportForLoop, ExportFunction, and ExportAcadoFunction.
Definition at line 84 of file export_statement_block.cpp.
|
virtual |
Exports source code of the statement block into given file. Its appearance can can be adjusted by various options.
@param[in] stream Name of file to be used to export statement block. @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
Implements ExportStatement.
Reimplemented in ExportFunction, ExportAcadoFunction, and ExportForLoop.
Definition at line 273 of file export_statement_block.cpp.
|
virtual |
Exports data declaration of the statement block into given file. Its appearance can can be adjusted by various options.
@param[in] stream Name of file to be used to export statement block. @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 ExportStatement.
Reimplemented in ExportFunction, ExportForLoop, and ExportAcadoFunction.
Definition at line 257 of file export_statement_block.cpp.
uint ExportStatementBlock::getNumStatements | ( | ) | const |
Returns number of statement within statement block.
Definition at line 250 of file export_statement_block.cpp.
ExportStatementBlock & ExportStatementBlock::operator= | ( | const ExportStatementBlock & | rhs | ) |
Assignment operator (deep copy).
@param[in] arg Right-hand side object.
Definition at line 69 of file export_statement_block.cpp.
|
friend |
Add a statement.
Definition at line 294 of file export_statement_block.cpp.
|
friend |
Add a string.
Definition at line 303 of file export_statement_block.cpp.
|
protected |
Array containing all statements of the statement block.
Definition at line 299 of file export_statement_block.hpp.