Public Member Functions | Protected Attributes | Friends

Allows to export code for a block of statements. More...

#include <export_statement_block.hpp>

Inheritance diagram for ExportStatementBlock:
Inheritance graph
[legend]

List of all members.

Public Member Functions

returnValue addComment (const std::string &_comment)
returnValue addComment (uint _nBlanks, const std::string &_comment)
returnValue addDeclaration (const ExportVariable &_data, ExportStruct _dataStruct=ACADO_ANY)
returnValue addDeclaration (const ExportIndex &_data, ExportStruct _dataStruct=ACADO_ANY)
returnValue addDeclaration (const ExportFunction &_f)
returnValue addDeclaration (const ExportAcadoFunction &_f)
returnValue addFunction (const ExportFunction &_function)
returnValue 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)
returnValue 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)
returnValue addLinebreak (uint num=1)
returnValue addStatement (const ExportStatement &_statement)
returnValue addStatement (const std::string &_statementString)
returnValue clear ()
virtual ExportStatementclone () const
virtual returnValue exportCode (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
virtual returnValue exportDataDeclaration (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
 ExportStatementBlock ()
 ExportStatementBlock (const ExportStatementBlock &arg)
uint getNumStatements () const
ExportStatementBlockoperator= (const ExportStatementBlock &rhs)
virtual ~ExportStatementBlock ()

Protected Attributes

StatementPtrArray statements

Friends

ExportStatementBlockoperator<< (ExportStatementBlock &_block, const ExportStatement &_statement)
ExportStatementBlockoperator<< (ExportStatementBlock &_block, const std::string &_statement)

Detailed Description

Allows to export code for a block of statements.

The class ExportStatementBlock allows to export code for a block of statements.

Authors:
Hans Joachim Ferreau, Boris Houska, Milan Vukov

Definition at line 63 of file export_statement_block.hpp.


Constructor & Destructor Documentation

< Default Constructor.

Definition at line 52 of file export_statement_block.cpp.

Copy constructor (deep copy).

Parameters:
[in]argRight-hand side object.

Definition at line 57 of file export_statement_block.cpp.

Destructor.

Definition at line 63 of file export_statement_block.cpp.


Member Function Documentation

returnValue ExportStatementBlock::addComment ( const std::string &  _comment)

Adds a comment to the statement block.

Parameters:
[in]_commentComment to be added.
Returns:
SUCCESSFUL_RETURN

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.

Parameters:
[in]_nBlanksNumber of blanks.
[in]_commentComment to be added.
Returns:
SUCCESSFUL_RETURN

Definition at line 236 of file export_statement_block.cpp.

Adds a variable declaration to the statement block.

Parameters:
[in]_dataVariable declaration to be added.
Returns:
SUCCESSFUL_RETURN

Definition at line 158 of file export_statement_block.cpp.

Adds an index declaration to the statement block.

Parameters:
[in]_dataIndex declaration to be added.
Returns:
SUCCESSFUL_RETURN

Definition at line 177 of file export_statement_block.cpp.

Adds a function forward declaration to the statement block.

Parameters:
[in]_ffunction forward declaration to be added.
Returns:
SUCCESSFUL_RETURN

Definition at line 192 of file export_statement_block.cpp.

Adds a forward declaration of an ODE function to the statement block.

Parameters:
[in]_fODE function whose forward declaration is to be added.
Returns:
SUCCESSFUL_RETURN

Definition at line 200 of file export_statement_block.cpp.

Adds a function to the statement block.

Parameters:
[in]_functionFunction to be added.
Returns:
SUCCESSFUL_RETURN

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.

Parameters:
[in]_fNameName of function to be called.
Returns:
SUCCESSFUL_RETURN

Definition at line 115 of file export_statement_block.cpp.

Adds a function call to the statement block.

Parameters:
[in]_fFunction to be called.
Returns:
SUCCESSFUL_RETURN

Definition at line 136 of file export_statement_block.cpp.

Adds a line break to the statement block.

Parameters:
[in]numNumber of line breaks to be added.
Returns:
SUCCESSFUL_RETURN

Definition at line 209 of file export_statement_block.cpp.

Adds a statement to the statement block.

Parameters:
[in]_statementStatement to be added.
Returns:
SUCCESSFUL_RETURN

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.

Parameters:
[in]_statementStringstd::string statement to be added.
Returns:
SUCCESSFUL_RETURN

Definition at line 100 of file export_statement_block.cpp.

Removes all statements to yield an empty statement block.

Returns:
SUCCESSFUL_RETURN

Reimplemented in ExportFunction, and ExportForLoop.

Definition at line 289 of file export_statement_block.cpp.

Clone constructor (deep copy).

Returns:
Pointer to cloned object.

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.

Parameters:
[in]streamName of file to be used to export statement block.
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

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.

Parameters:
[in]streamName of file to be used to export statement block.
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Reimplemented from ExportStatement.

Reimplemented in ExportFunction, ExportForLoop, and ExportAcadoFunction.

Definition at line 257 of file export_statement_block.cpp.

Returns number of statement within statement block.

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).

Parameters:
[in]argRight-hand side object.

Definition at line 69 of file export_statement_block.cpp.


Friends And Related Function Documentation

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.


Member Data Documentation

Array containing all statements of the statement block.

Definition at line 299 of file export_statement_block.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 12:01:38