Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions

Allows to export code of a for-loop. More...

#include <export_for_loop.hpp>

Inheritance diagram for ExportForLoop:
Inheritance graph
[legend]

List of all members.

Public Member Functions

ExportForLoopallocate (MemoryAllocatorPtr allocator)
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
 ExportForLoop (const ExportIndex &_loopVariable=emptyConstExportIndex, const ExportIndex &_startValue=emptyConstExportIndex, const ExportIndex &_finalValue=emptyConstExportIndex, const ExportIndex &_increment=constExportIndexValueOne, bool _doLoopUnrolling=false)
 ExportForLoop (const ExportForLoop &arg)
returnValue init (const ExportIndex &_loopVariable, const ExportIndex &_startValue, const ExportIndex &_finalValue, const ExportIndex &_increment, bool _doLoopUnrolling)
ExportForLoopkeepLoop ()
ExportForLoopoperator= (const ExportForLoop &arg)
ExportForLoopunrollLoop ()
virtual ~ExportForLoop ()

Protected Member Functions

returnValue clear ()

Protected Attributes

bool doLoopUnrolling
ExportIndex finalValue
ExportIndex increment
ExportIndex loopVariable
ExportIndex startValue

Private Member Functions

returnValue sanityCheck (void) const

Detailed Description

Allows to export code of a for-loop.

The class ExportForLoop allows to export code of a for-loop.

Author:
Hans Joachim Ferreau, Boris Houska, Milan Vukov

Definition at line 56 of file export_for_loop.hpp.


Constructor & Destructor Documentation

ExportForLoop::ExportForLoop ( const ExportIndex _loopVariable = emptyConstExportIndex,
const ExportIndex _startValue = emptyConstExportIndex,
const ExportIndex _finalValue = emptyConstExportIndex,
const ExportIndex _increment = constExportIndexValueOne,
bool  _doLoopUnrolling = false 
)

Default constructor which optionally takes the name of the loop variable as well as other loop settings.

Parameters:
[in]_loopVariableName of the loop variable.
[in]_startValueStart value of the loop counter.
[in]_finalValueFinal value of the loop counter.
[in]_incrementIncrement of the loop counter.
[in]_doLoopUnrollingFlag indicating whether loop shall be unrolled.

Definition at line 46 of file export_for_loop.cpp.

Copy constructor (deep copy).

Parameters:
[in]argRight-hand side object.

Definition at line 62 of file export_for_loop.cpp.

Destructor.

Definition at line 72 of file export_for_loop.cpp.


Member Function Documentation

Set a memory allocator.

Reimplemented from ExportStatement.

Definition at line 197 of file export_for_loop.cpp.

Frees internal dynamic memory to yield an empty for-loop.

Returns:
SUCCESSFUL_RETURN

Reimplemented from ExportStatementBlock.

Definition at line 215 of file export_for_loop.cpp.

ExportStatement * ExportForLoop::clone ( ) const [virtual]

Clone constructor (deep copy).

Returns:
Pointer to cloned object.

Reimplemented from ExportStatementBlock.

Definition at line 90 of file export_for_loop.cpp.

returnValue ExportForLoop::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 into given file. Its appearance can can be adjusted by various options.

Parameters:
[in]fileName of file to be used to export statement.
[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 ExportStatementBlock.

Definition at line 127 of file export_for_loop.cpp.

returnValue ExportForLoop::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 into given file. Its appearance can can be adjusted by various options.

Parameters:
[in]streamName of file to be used to export statement.
[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 ExportStatementBlock.

Definition at line 117 of file export_for_loop.cpp.

returnValue ExportForLoop::init ( const ExportIndex _loopVariable,
const ExportIndex _startValue,
const ExportIndex _finalValue,
const ExportIndex _increment,
bool  _doLoopUnrolling 
)

Initializes for-loop with given loop settings.

Parameters:
[in]_loopVariableName of the loop variable.
[in]_startValueStart value of the loop counter.
[in]_finalValueFinal value of the loop counter.
[in]_incrementIncrement of the loop counter.
[in]_doLoopUnrollingFlag indicating whether loop shall be unrolled.

Definition at line 96 of file export_for_loop.cpp.

Specifies not to unroll for-loop.

Returns:
Loop-unrolled copy of for-loop object

Definition at line 191 of file export_for_loop.cpp.

ExportForLoop & ExportForLoop::operator= ( const ExportForLoop arg)

Assignment operator (deep copy).

Parameters:
[in]argRight-hand side object.

Definition at line 78 of file export_for_loop.cpp.

returnValue ExportForLoop::sanityCheck ( void  ) const [private]

Definition at line 223 of file export_for_loop.cpp.

Specifies to unroll for-loop.

Returns:
Reference to for-loop object

Definition at line 184 of file export_for_loop.cpp.


Member Data Documentation

Flag indicating whether loop shall be unrolled when exporting the code.

Definition at line 192 of file export_for_loop.hpp.

Final value of the loop counter.

Definition at line 189 of file export_for_loop.hpp.

Increment of the loop counter.

Definition at line 190 of file export_for_loop.hpp.

Loop variable.

Definition at line 187 of file export_for_loop.hpp.

Start value of the loop counter.

Definition at line 188 of file export_for_loop.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:40:24