Allows to export code for a block of statements. More...
#include <export_statement_block.hpp>
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.
< Default Constructor.
Definition at line 52 of file export_statement_block.cpp.
ExportStatementBlock::ExportStatementBlock | ( | const ExportStatementBlock & | arg | ) |
Copy constructor (deep copy).
[in] | arg | Right-hand side object. |
Definition at line 57 of file export_statement_block.cpp.
ExportStatementBlock::~ExportStatementBlock | ( | ) | [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.
[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.
[in] | _nBlanks | Number of blanks. |
[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.
[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.
[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.
[in] | _f | function forward declaration to be added. |
Definition at line 192 of file export_statement_block.cpp.
Adds a forward declaration of an ODE function to the statement block.
[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.
[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.
[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.
[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.
[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.
[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.
[in] | _statementString | std::string statement to be added. |
Definition at line 100 of file export_statement_block.cpp.
Removes all statements to yield an empty statement block.
Reimplemented in ExportFunction, and ExportForLoop.
Definition at line 289 of file export_statement_block.cpp.
ExportStatement * ExportStatementBlock::clone | ( | ) | const [virtual] |
Clone constructor (deep copy).
Implements ExportStatement.
Reimplemented in ExportForLoop, ExportFunction, and ExportAcadoFunction.
Definition at line 84 of file export_statement_block.cpp.
returnValue ExportStatementBlock::exportCode | ( | std::ostream & | stream, |
const std::string & | _realString = "real_t" , |
||
const std::string & | _intString = "int" , |
||
int | _precision = 16 |
||
) | const [virtual] |
Exports source code of the statement block into given file. Its appearance can can be adjusted by various options.
[in] | stream | Name of file to be used to export statement block. |
[in] | _realString | std::string to be used to declare real variables. |
[in] | _intString | std::string to be used to declare integer variables. |
[in] | _precision | Number of digits to be used for exporting real values. |
Implements ExportStatement.
Reimplemented in ExportFunction, ExportAcadoFunction, and ExportForLoop.
Definition at line 273 of file export_statement_block.cpp.
returnValue ExportStatementBlock::exportDataDeclaration | ( | std::ostream & | stream, |
const std::string & | _realString = "real_t" , |
||
const std::string & | _intString = "int" , |
||
int | _precision = 16 |
||
) | const [virtual] |
Exports data declaration of the statement block into given file. Its appearance can can be adjusted by various options.
[in] | stream | Name of file to be used to export statement block. |
[in] | _realString | std::string to be used to declare real variables. |
[in] | _intString | std::string to be used to declare integer variables. |
[in] | _precision | Number of digits to be used for exporting real values. |
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).
[in] | arg | Right-hand side object. |
Definition at line 69 of file export_statement_block.cpp.
ExportStatementBlock& operator<< | ( | ExportStatementBlock & | _block, |
const ExportStatement & | _statement | ||
) | [friend] |
Add a statement.
Definition at line 294 of file export_statement_block.cpp.
ExportStatementBlock& operator<< | ( | ExportStatementBlock & | _block, |
const std::string & | _statement | ||
) | [friend] |
Add a string.
Definition at line 303 of file export_statement_block.cpp.
StatementPtrArray ExportStatementBlock::statements [protected] |
Array containing all statements of the statement block.
Definition at line 299 of file export_statement_block.hpp.