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 |
|
inline |
Default construct to point to nullptr.
Definition at line 84 of file ChannelPacketTypes.hpp.
|
inline |
Construct to point to data with only size information and no type information.
data | the pointer to the data |
size | the size of the data |
Definition at line 95 of file ChannelPacketTypes.hpp.
|
inlineexplicit |
Construct to point to data of the given type.
T | the type to point to |
data | the pointer |
Definition at line 111 of file ChannelPacketTypes.hpp.
|
inline |
Get a pointer to the data with the given type.
if | the type T is incompatible with the value. |
T | the type of data |
Definition at line 140 of file ChannelPacketTypes.hpp.
|
inline |
Get the pointer to the data.
Definition at line 169 of file ChannelPacketTypes.hpp.
Referenced by dw::framework::ManagedPortInput< T >::takeOwnership().
|
inline |
Get the size of the data pointed to.
Definition at line 123 of file ChannelPacketTypes.hpp.
|
inline |
Get the type index of the data type.
Definition at line 178 of file ChannelPacketTypes.hpp.
References dw::framework::ITypeInformation::typeIndex().