X-TraceC++Library
|
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 () | |
Options & | operator= (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 () |
Option & | operator[] (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. |
Represents the list of options in the X-Trace metadata.
xtr::Options::Options | ( | ) | [inline] |
xtr::Options::Options | ( | const u_int8_t * | from, |
u_int8_t | len | ||
) |
xtr::Options::Options | ( | const Options & | ) |
xtr::Options::~Options | ( | ) |
xtr_result xtr::Options::addOption | ( | const Option & | option | ) |
Referenced by xtr::Metadata::addOption().
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 |
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.
dest | array to write the packet options to |
size | input: size of writable area output: total size used. |
xtr_result xtr::Options::removeOptionAt | ( | u_int8_t | i | ) |
Remove one option from the list.
The index starts at 0.
i | index of option to remove, starting at 0. |
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.
n | number of options to reserve space to. c is the total number of options, and not in addition to what's already stored. |