Public Member Functions | Protected Attributes | Friends | List of all members

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

#include <export_statement_block.hpp>

Inheritance diagram for ExportStatementBlock:
Inheritance graph
[legend]

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 ()
 
- Public Member Functions inherited from ExportStatement
virtual ExportStatementacquire (ExportIndex &)
 
virtual ExportStatementallocate (MemoryAllocatorPtr)
 
 ExportStatement ()
 
 ExportStatement (const ExportStatement &arg)
 
ExportStatementoperator= (const ExportStatement &arg)
 
virtual ExportStatementrelease (const ExportIndex &)
 
virtual ~ExportStatement ()
 

Protected Attributes

StatementPtrArray statements
 

Friends

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

Additional Inherited Members

- Public Types inherited from ExportStatement
typedef std::shared_ptr< MemoryAllocatorMemoryAllocatorPtr
 
typedef std::shared_ptr< ExportStatementStatementPtr
 
typedef std::vector< StatementPtrStatementPtrArray
 
- Static Public Attributes inherited from ExportStatement
static std::string fcnPrefix = "acado"
 
static std::string varPrefix = "ACADO"
 

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

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.

ExportStatementBlock::~ExportStatementBlock ( )
virtual

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.

@param[in] _comment         Comment 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.

@param[in] _nBlanks         Number of blanks.
@param[in] _comment         Comment to be added.
Returns
SUCCESSFUL_RETURN

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.
Returns
SUCCESSFUL_RETURN

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.
Returns
SUCCESSFUL_RETURN

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.
Returns
SUCCESSFUL_RETURN

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.
Returns
SUCCESSFUL_RETURN

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

@param[in] _fName                   Name of function to be called.
Returns
SUCCESSFUL_RETURN

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.
Returns
SUCCESSFUL_RETURN

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.
Returns
SUCCESSFUL_RETURN

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

@param[in] _statementString         std::string statement to be added.
Returns
SUCCESSFUL_RETURN

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.

ExportStatement * ExportStatementBlock::clone ( ) const
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.

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.

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

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.

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

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.

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

StatementPtrArray ExportStatementBlock::statements
protected

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 Mon Jun 10 2019 12:35:24