Allows to export code of a for-loop. More...
#include <export_for_loop.hpp>
Protected Member Functions | |
returnValue | clear () |
Protected Attributes | |
bool | doLoopUnrolling |
ExportIndex | finalValue |
ExportIndex | increment |
ExportIndex | loopVariable |
ExportIndex | startValue |
Protected Attributes inherited from ExportStatementBlock | |
StatementPtrArray | statements |
Private Member Functions | |
returnValue | sanityCheck (void) const |
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 of a for-loop.
The class ExportForLoop allows to export code of a for-loop.
Definition at line 56 of file export_for_loop.hpp.
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.
[in] | _loopVariable | Name of the loop variable. |
[in] | _startValue | Start value of the loop counter. |
[in] | _finalValue | Final value of the loop counter. |
[in] | _increment | Increment of the loop counter. |
[in] | _doLoopUnrolling | Flag indicating whether loop shall be unrolled. |
Definition at line 46 of file export_for_loop.cpp.
ExportForLoop::ExportForLoop | ( | const ExportForLoop & | arg | ) |
Copy constructor (deep copy).
@param[in] arg Right-hand side object.
Definition at line 62 of file export_for_loop.cpp.
|
virtual |
Destructor.
Definition at line 72 of file export_for_loop.cpp.
|
virtual |
Set a memory allocator.
Reimplemented from ExportStatement.
Definition at line 197 of file export_for_loop.cpp.
|
protected |
Frees internal dynamic memory to yield an empty for-loop.
\return SUCCESSFUL_RETURN
Definition at line 215 of file export_for_loop.cpp.
|
virtual |
Clone constructor (deep copy).
\return Pointer to cloned object.
Reimplemented from ExportStatementBlock.
Definition at line 90 of file export_for_loop.cpp.
|
virtual |
Exports source code of the statement into given file. Its appearance can can be adjusted by various options.
@param[in] file Name of file to be used to export statement. @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 ExportStatementBlock.
Definition at line 127 of file export_for_loop.cpp.
|
virtual |
Exports data declaration of the statement into given file. Its appearance can can be adjusted by various options.
@param[in] stream Name of file to be used to export statement. @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 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.
@param[in] _loopVariable Name of the loop variable. @param[in] _startValue Start value of the loop counter. @param[in] _finalValue Final value of the loop counter. @param[in] _increment Increment of the loop counter. @param[in] _doLoopUnrolling Flag indicating whether loop shall be unrolled.
Definition at line 96 of file export_for_loop.cpp.
ExportForLoop & ExportForLoop::keepLoop | ( | ) |
Specifies not to unroll for-loop.
\return 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).
@param[in] arg Right-hand side object.
Definition at line 78 of file export_for_loop.cpp.
|
private |
Definition at line 223 of file export_for_loop.cpp.
ExportForLoop & ExportForLoop::unrollLoop | ( | ) |
Specifies to unroll for-loop.
\return Reference to for-loop object
Definition at line 184 of file export_for_loop.cpp.
|
protected |
Flag indicating whether loop shall be unrolled when exporting the code.
Definition at line 192 of file export_for_loop.hpp.
|
protected |
Final value of the loop counter.
Definition at line 189 of file export_for_loop.hpp.
|
protected |
Increment of the loop counter.
Definition at line 190 of file export_for_loop.hpp.
|
protected |
Loop variable.
Definition at line 187 of file export_for_loop.hpp.
|
protected |
Start value of the loop counter.
Definition at line 188 of file export_for_loop.hpp.