Compute Graph Framework SDK Reference  5.16
dw::framework::GenericData Class Reference

Detailed Description

Weakly typed data buffer that couples together a generic pointer with the size and type information of the memory it points to.

Definition at line 78 of file ChannelPacketTypes.hpp.

Public Member Functions

 GenericData ()
 
template<typename T , std::enable_if_t<!std::is_same< T, GenericData >::value > * = nullptr>
 GenericData (T *data)
 
 GenericData (void *data, size_t size)
 
template<typename T >
T * getData () const
 
void * getPointer () const
 
size_t size () const
 
std::type_index typeIndex () const
 

Constructor & Destructor Documentation

◆ GenericData() [1/3]

dw::framework::GenericData::GenericData ( )
inline

Default construct to point to nullptr.

Definition at line 84 of file ChannelPacketTypes.hpp.

◆ GenericData() [2/3]

dw::framework::GenericData::GenericData ( void *  data,
size_t  size 
)
inline

Construct to point to data with only size information and no type information.

Parameters
datathe pointer to the data
sizethe size of the data

Definition at line 95 of file ChannelPacketTypes.hpp.

◆ GenericData() [3/3]

template<typename T , std::enable_if_t<!std::is_same< T, GenericData >::value > * = nullptr>
dw::framework::GenericData::GenericData ( T *  data)
inlineexplicit

Construct to point to data of the given type.

Template Parameters
Tthe type to point to
Parameters
datathe pointer

Definition at line 111 of file ChannelPacketTypes.hpp.

Member Function Documentation

◆ getData()

template<typename T >
T * dw::framework::GenericData::getData ( ) const
inline

Get a pointer to the data with the given type.

Note
if no type information is available, this method will succeed if the size of T and the size of the data match.
Exceptions
ifthe type T is incompatible with the value.
Template Parameters
Tthe type of data
Returns
T* the pointer to the data

Definition at line 140 of file ChannelPacketTypes.hpp.

◆ getPointer()

void * dw::framework::GenericData::getPointer ( ) const
inline

Get the pointer to the data.

Returns
void*

Definition at line 169 of file ChannelPacketTypes.hpp.

Referenced by dw::framework::ManagedPortInput< T >::takeOwnership().

◆ size()

size_t dw::framework::GenericData::size ( ) const
inline

Get the size of the data pointed to.

Returns
size_t

Definition at line 123 of file ChannelPacketTypes.hpp.

◆ typeIndex()

std::type_index dw::framework::GenericData::typeIndex ( ) const
inline

Get the type index of the data type.

Returns
std::type_index

Definition at line 178 of file ChannelPacketTypes.hpp.

References dw::framework::ITypeInformation::typeIndex().


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