X-TraceC++Library
Public Member Functions
xtr::Options Class Reference

Represents the list of options in the X-Trace metadata. More...

#include <XtrMetadata.h>

Public Member Functions

 Options ()
 Options (const u_int8_t *from, u_int8_t len)
 Options (const Options &)
 ~Options ()
Optionsoperator= (const Options &other)
size_t getCount () const
size_t getLength () const
bool isEqual (const Options &other) const
xtr_result reserve (u_int8_t n)
 Reserves the internal storage for n options.
void clear ()
Optionoperator[] (size_t i) const
xtr_result addOption (const Option &option)
xtr_result removeOptionAt (u_int8_t i)
 Remove one option from the list.
xtr_result pack (u_int8_t *dest, size_t *size) const
 Write the options in binary packed form to the array pointed to by dest.

Detailed Description

Represents the list of options in the X-Trace metadata.

Note:
: the fields are u_int8_t because they can't be larger than this according to the spec.

Constructor & Destructor Documentation

xtr::Options::Options ( ) [inline]
xtr::Options::Options ( const u_int8_t *  from,
u_int8_t  len 
)
xtr::Options::Options ( const Options )
xtr::Options::~Options ( )

Member Function Documentation

xtr_result xtr::Options::addOption ( const Option option)
void xtr::Options::clear ( )
size_t xtr::Options::getCount ( ) const [inline]
size_t xtr::Options::getLength ( ) const [inline]
bool xtr::Options::isEqual ( const Options other) const
Options& xtr::Options::operator= ( const Options other)
Option& xtr::Options::operator[] ( size_t  i) const [inline]
xtr_result xtr::Options::pack ( u_int8_t *  dest,
size_t *  size 
) const

Write the options in binary packed form to the array pointed to by dest.

Parameters:
destarray to write the packet options to
sizeinput: size of writable area
output: total size used.
Returns:
XTR_SUCCESS if successful, XTR_FAIL otherwise
xtr_result xtr::Options::removeOptionAt ( u_int8_t  i)

Remove one option from the list.

The index starts at 0.

Parameters:
iindex of option to remove, starting at 0.
Returns:
XTR_SUCCESS if the index is valid, XTR_FAIL otherwise.
xtr_result xtr::Options::reserve ( u_int8_t  n)

Reserves the internal storage for n options.

This function is used to avoid repeated allocations when adding new options.

Parameters:
nnumber of options to reserve space to. c is the total number of options, and not in addition to what's already stored.
Returns:
XTR_SUCCESS if successful, XTR_FAIL otherwise.

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