Pottu
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
pottu::dataitem_t Union Reference

Raw dataitem in tdr binary data. More...

#include <dataitem.hpp>

Collaboration diagram for pottu::dataitem_t:
Collaboration graph
[legend]

Public Member Functions

itemtype_e getType () const
 Returns the type of the item. More...
 
dataitem_t asSwapped () const
 Returns a new dataitem having 16 bit words swapped.
More...
 
void clear ()
 Sets the all bits to zero.
 
void toCStringFull (char *s, uint32_t len) const
 Get the content as a c string. More...
 

Static Public Member Functions

static dataitem_t create (uint64_t v)
 Creates and returns a new dataitem from a raw data.
 

Public Attributes

dataitem_type_t type
 Field to access the type. One can use also method getType().
 
dataitem_data_t data
 Field to access the content of datatype DATATYPE_DATA.
 
dataitem_info_t info
 Field to access the content of datatype DATATYPE_INFO.
 
dataitem_tracehead_t tracehead
 Field to access the content of datatype DATATYPE_TRACEHEAD.
 
dataitem_tracedata_t tracedata
 Field to access the content of datatype DATATYPE_tracedata.
 
uint64_t rawdata
 Field to access the raw memory at once.
 

Detailed Description

Raw dataitem in tdr binary data.

This union can be used to access different types of the dataitem. Use field type first to check the type of the dataitem before using any of the specialized structs.

Member Function Documentation

◆ asSwapped()

dataitem_t pottu::dataitem_t::asSwapped ( ) const
inline

Returns a new dataitem having 16 bit words swapped.

One can swap words in the dataitem di with di = di.asSwapped();

◆ getType()

itemtype_e pottu::dataitem_t::getType ( ) const
inline

Returns the type of the item.

Returns
Type of the item. One of itemtype_e enum.

◆ toCStringFull()

void pottu::dataitem_t::toCStringFull ( char *  s,
uint32_t  len 
) const
inline

Get the content as a c string.

This first checks the type of the dataitem and then calls appropriate implementation. This is useful for debugging.


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