Public Member Functions | Protected Member Functions | Protected Attributes

Allows to export code of an arbitrary function. More...

#include <export_function.hpp>

Inheritance diagram for ExportFunction:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ExportFunctionacquire (ExportIndex &obj)
returnValue addArgument (const ExportArgument &_argument1, 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)
ExportFunctionaddIndex (const ExportIndex &_index)
ExportFunctionaddVariable (const ExportVariable &_var)
virtual ExportStatementclone () const
virtual ExportFunctiondoc (const std::string &_doc)
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
virtual returnValue exportForwardDeclaration (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
 ExportFunction (const std::string &_name="defaultFunctionName", 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)
std::string getName () const
unsigned getNumArguments () const
returnValue init (const std::string &_name="defaultFunctionName", 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)
virtual bool isDefined () const
virtual bool isPrivate () const
virtual ExportFunctionrelease (const ExportIndex &obj)
ExportFunctionsetName (const std::string &_name)
virtual ExportFunctionsetPrivate (bool _set=true)
ExportFunctionsetReturnValue (const ExportVariable &_functionReturnValue, bool _returnAsPointer=false)
ExportFunctionsetup (const std::string &_name="defaultFunctionName", 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)
virtual ~ExportFunction ()

Protected Member Functions

returnValue clear ()

Protected Attributes

std::string description
bool flagPrivate
ExportArgumentList functionArguments
std::vector< ExportVariablelocalVariables
MemoryAllocatorPtr memAllocator
std::string name
bool returnAsPointer
ExportVariable retVal

Detailed Description

Allows to export code of an arbitrary function.

The class ExportFunction allows to export code of an arbitrary function.

Definition at line 62 of file export_function.hpp.


Constructor & Destructor Documentation

BEGIN_NAMESPACE_ACADO ExportFunction::ExportFunction ( const std::string &  _name = "defaultFunctionName",
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 
)

Default constructor which optionally takes the name of the function as well as possible calling arguments.

Parameters:
[in]_nameName of the function.
[in]_argument1Calling argument no. 1.
[in]_argument2Calling argument no. 2.
[in]_argument3Calling argument no. 3.
[in]_argument4Calling argument no. 4.
[in]_argument5Calling argument no. 5.
[in]_argument6Calling argument no. 6.
[in]_argument7Calling argument no. 7.
[in]_argument8Calling argument no. 8.
[in]_argument9Calling argument no. 9.

Definition at line 46 of file export_function.cpp.

Destructor.

Definition at line 68 of file export_function.cpp.


Member Function Documentation

Acquire a local variable.

Reimplemented from ExportStatement.

Definition at line 354 of file export_function.cpp.

returnValue ExportFunction::addArgument ( const ExportArgument _argument1,
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 up to nine calling arguments to the function.

Parameters:
[in]_nameName of the function.
[in]_argument1Calling argument no. 1.
[in]_argument2Calling argument no. 2.
[in]_argument3Calling argument no. 3.
[in]_argument4Calling argument no. 4.
[in]_argument5Calling argument no. 5.
[in]_argument6Calling argument no. 6.
[in]_argument7Calling argument no. 7.
[in]_argument8Calling argument no. 8.
[in]_argument9Calling argument no. 9.
Returns:
SUCCESSFUL_RETURN

Definition at line 123 of file export_function.cpp.

Add a new index (local) index to the function

Definition at line 347 of file export_function.cpp.

Add a new index (local) variable to the function.

Definition at line 368 of file export_function.cpp.

Frees internal dynamic memory to yield an empty function.

Returns:
SUCCESSFUL_RETURN

Reimplemented from ExportStatementBlock.

Definition at line 340 of file export_function.cpp.

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

Clone constructor (deep copy).

Returns:
Pointer to cloned object.

Reimplemented from ExportStatementBlock.

Reimplemented in ExportAcadoFunction.

Definition at line 71 of file export_function.cpp.

ExportFunction & ExportFunction::doc ( const std::string &  _doc) [virtual]

Set a documentation string.

Definition at line 375 of file export_function.cpp.

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

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

Reimplemented in ExportAcadoFunction.

Definition at line 246 of file export_function.cpp.

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

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

Reimplemented in ExportAcadoFunction.

Definition at line 171 of file export_function.cpp.

returnValue ExportFunction::exportForwardDeclaration ( std::ostream &  stream,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int",
int  _precision = 16 
) const [virtual]

Exports forward declaration of the function 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 in ExportAcadoFunction.

Definition at line 181 of file export_function.cpp.

std::string ExportFunction::getName ( ) const

Returns the name of the function.

Definition at line 164 of file export_function.cpp.

unsigned ExportFunction::getNumArguments ( ) const

Return number of calling arguments of the function.

Definition at line 330 of file export_function.cpp.

returnValue ExportFunction::init ( const std::string &  _name = "defaultFunctionName",
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 
)

Initializes function with given name and possible calling arguments.

Parameters:
[in]_nameName of the function.
[in]_argument1Calling argument no. 1.
[in]_argument2Calling argument no. 2.
[in]_argument3Calling argument no. 3.
[in]_argument4Calling argument no. 4.
[in]_argument5Calling argument no. 5.
[in]_argument6Calling argument no. 6.
[in]_argument7Calling argument no. 7.
[in]_argument8Calling argument no. 8.
[in]_argument9Calling argument no. 9.
Returns:
SUCCESSFUL_RETURN

Definition at line 76 of file export_function.cpp.

bool ExportFunction::isDefined ( ) const [virtual]

Returns whether function has been defined.

Returns:
true iff function has been defined,
false otherwise

Reimplemented in ExportAcadoFunction.

Definition at line 321 of file export_function.cpp.

bool ExportFunction::isPrivate ( ) const [virtual]

Is function private?

Definition at line 389 of file export_function.cpp.

ExportFunction & ExportFunction::release ( const ExportIndex obj) [virtual]

Release a local variable.

Reimplemented from ExportStatement.

Definition at line 361 of file export_function.cpp.

ExportFunction & ExportFunction::setName ( const std::string &  _name)

Sets the name of the function.

Definition at line 152 of file export_function.cpp.

ExportFunction & ExportFunction::setPrivate ( bool  _set = true) [virtual]

Set the function as private. If this is true, then do not export it's declaration.

Definition at line 382 of file export_function.cpp.

ExportFunction & ExportFunction::setReturnValue ( const ExportVariable _functionReturnValue,
bool  _returnAsPointer = false 
)

Assigns a return value to the function (by default, its return value is void).

Parameters:
[in]_functionReturnValueNew return value of the function.
[in]_returnAsPointerFlag indicating whether value shall be returned as pointer.
Returns:
SUCCESSFUL_RETURN

Definition at line 141 of file export_function.cpp.

ExportFunction & ExportFunction::setup ( const std::string &  _name = "defaultFunctionName",
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 
)

Initializes function with given name and possible calling arguments.

Parameters:
[in]_nameName of the function.
[in]_argument1Calling argument no. 1.
[in]_argument2Calling argument no. 2.
[in]_argument3Calling argument no. 3.
[in]_argument4Calling argument no. 4.
[in]_argument5Calling argument no. 5.
[in]_argument6Calling argument no. 6.
[in]_argument7Calling argument no. 7.
[in]_argument8Calling argument no. 8.
[in]_argument9Calling argument no. 9.
Returns:
Reference to initialized object

Definition at line 101 of file export_function.cpp.


Member Data Documentation

std::string ExportFunction::description [protected]

A description string.

Definition at line 289 of file export_function.hpp.

bool ExportFunction::flagPrivate [protected]

Private flag. In principle if this guy is true, do not export function declaration.

Definition at line 302 of file export_function.hpp.

List of calling arguments.

Definition at line 292 of file export_function.hpp.

std::vector< ExportVariable > ExportFunction::localVariables [protected]

Array of local variables.

Definition at line 300 of file export_function.hpp.

Memory allocator

Definition at line 298 of file export_function.hpp.

std::string ExportFunction::name [protected]

Name of the function.

Definition at line 287 of file export_function.hpp.

Flag indicating whether value shall be returned as pointer.

Definition at line 296 of file export_function.hpp.

Return value of the function.

Definition at line 294 of file export_function.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