X-TraceC++Library
Public Member Functions | Protected Attributes
xtr::Id< max_len > Class Template Reference

Represents an id as an array of bytes with a maximum length. More...

#include <XtrMetadata.h>

Public Member Functions

 Id ()
 Id (size_t _length)
 Id (const u_int8_t *from, size_t len)
virtual ~Id ()
bool isLengthValid () const
size_t getLength () const
const u_int8_t * getBytes () const
u_int8_t & operator[] (size_t i)
virtual bool isEqual (const Id< max_len > &other) const
void setLength (size_t _length)
xtr_result setBytes (const u_int8_t *from, size_t len)
xtr_result pack (u_int8_t *dest, size_t *size) const
char * toString (char *dest, size_t size) const
virtual bool isValidLength (size_t len) const

Protected Attributes

size_t length
u_int8_t id [max_len]

Detailed Description

template<size_t max_len>
class xtr::Id< max_len >

Represents an id as an array of bytes with a maximum length.

Parameters:
max_lenthe maximum length of the id in bytes

Constructor & Destructor Documentation

template<size_t max_len>
xtr::Id< max_len >::Id ( ) [inline]
template<size_t max_len>
xtr::Id< max_len >::Id ( size_t  _length)
template<size_t max_len>
xtr::Id< max_len >::Id ( const u_int8_t *  from,
size_t  len 
)
template<size_t max_len>
virtual xtr::Id< max_len >::~Id ( ) [inline, virtual]

Member Function Documentation

template<size_t max_len>
const u_int8_t* xtr::Id< max_len >::getBytes ( ) const [inline]
template<size_t max_len>
size_t xtr::Id< max_len >::getLength ( ) const [inline]
template<size_t max_len>
bool xtr::Id< max_len >::isEqual ( const Id< max_len > &  other) const [virtual]
template<size_t max_len>
bool xtr::Id< max_len >::isLengthValid ( ) const [inline]
template<size_t max_len>
virtual bool xtr::Id< max_len >::isValidLength ( size_t  len) const [inline, virtual]
template<size_t max_len>
u_int8_t& xtr::Id< max_len >::operator[] ( size_t  i) [inline]
template<size_t max_len>
xtr_result xtr::Id< max_len >::pack ( u_int8_t *  dest,
size_t *  size 
) const

References XTR_FAIL, and XTR_SUCCESS.

template<size_t max_len>
xtr_result xtr::Id< max_len >::setBytes ( const u_int8_t *  from,
size_t  len 
)

References XTR_FAIL, and XTR_SUCCESS.

template<size_t max_len>
void xtr::Id< max_len >::setLength ( size_t  _length) [inline]
template<size_t max_len>
char * xtr::Id< max_len >::toString ( char *  dest,
size_t  size 
) const

References xtr::xtr_btoh().


Field Documentation

template<size_t max_len>
u_int8_t xtr::Id< max_len >::id[max_len] [protected]
template<size_t max_len>
size_t xtr::Id< max_len >::length [protected]

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