CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::ExternalFunctionUserData Struct Reference

Ease of access structure for user-provided data on the tape for external functions. See ExternalFunctionTapeInterface. More...

#include <externalFunctionUserData.hpp>

Public Member Functions

template<typename Type >
size_t addData (Type const &value)
 
template<typename Type >
size_t addData (Type const *value, int const size)
 
void clear ()
 Delete all data entries.
 
 ExternalFunctionUserData ()
 Constructor.
 
 ExternalFunctionUserData (ExternalFunctionUserData const &other)
 Constructor.
 
ExternalFunctionUserDataoperator= (ExternalFunctionUserData const &other)
 Copy operator.
 
 ~ExternalFunctionUserData ()
 Destructor.
 
In order accessors
template<typename Type >
void getData (Type &value)
 Get a copy of the next data item.
 
template<typename Type >
Type const & getData ()
 Get a constant reference to the next data item.
 
template<typename Type >
Type & getDataRef ()
 Get a reference to the next data item.
 
template<typename Type >
void getData (Type *value, int const size)
 Get the next data item and copy it as an array. The target array must have the correct size.
 
template<typename Type >
Type const * getDataArray ()
 Get the address of the next data item. Intended for reference access to array items.
 
void resetPos ()
 Manually reset the position.
 
Out of order accessors
template<typename Type >
void getDataByIndex (Type &value, size_t pos)
 
template<typename Type >
Type const & getDataByIndex (size_t pos)
 
template<typename Type >
Type & getDataRefByIndex (size_t pos)
 
template<typename Type >
void getDataByIndex (Type *value, int const size, size_t pos)
 
template<typename Type >
Type const * getDataArrayByIndex ()
 Get the address of a data item based on the index. Intended for reference access to array items.
 

Detailed Description

Ease of access structure for user-provided data on the tape for external functions. See ExternalFunctionTapeInterface.

Stores copies of the data provided to the add methods, either a single value or an entire array.

The data can be retrieved in two different manners. Subsequent calls to get* methods provide the data elements in the order in which they were added (In order access.). The get*ByIndex methods can be used to query the pos-th added item explicitly (Out of order access.).

After the last data element is accessed by a get* method, the next get* call will return the first one.

The direct access function will not change the internal positioning.

Member Function Documentation

◆ addData() [1/2]

template<typename Type >
size_t codi::ExternalFunctionUserData::addData ( Type const &  value)
inline

Add a value to the store. The value is copied.

Returns
Index of the value for direct access.

◆ addData() [2/2]

template<typename Type >
size_t codi::ExternalFunctionUserData::addData ( Type const *  value,
int const  size 
)
inline

Add an array to the store. The array is copied.

Returns
Index of the array for direct access.

◆ getDataByIndex() [1/3]

template<typename Type >
Type const & codi::ExternalFunctionUserData::getDataByIndex ( size_t  pos)
inline

Get a constant reference to a data item based on the index.

The internal position is not modified.

◆ getDataByIndex() [2/3]

template<typename Type >
void codi::ExternalFunctionUserData::getDataByIndex ( Type &  value,
size_t  pos 
)
inline

Get a copy of a data item based on the index.

The internal position is not modified.

◆ getDataByIndex() [3/3]

template<typename Type >
void codi::ExternalFunctionUserData::getDataByIndex ( Type *  value,
int const  size,
size_t  pos 
)
inline

Get a data item based on the index and copy it as an array. The target array must have the correct size.

The internal position is not modified.

◆ getDataRefByIndex()

template<typename Type >
Type & codi::ExternalFunctionUserData::getDataRefByIndex ( size_t  pos)
inline

Get a reference to a item based on the index.

The internal position is not modified.


The documentation for this struct was generated from the following file: