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

A ChainId X-Trace metadata option. More...

#include <XtrOption.h>

Inheritance diagram for xtr::OptionChainId:
xtr::Option

Public Member Functions

 OptionChainId ()
 Creates an empty chainId option.
 OptionChainId (const u_int8_t *b, size_t *size)
 Creates a ChainId option from the array.
 OptionChainId (u_int16_t _id)
OptionChainIdclone () const
 Returns a pointer to a newly allocated Option, of the same subtype as the cloned object.
u_int8_t getType () const
 Returns the type of this option.
u_int8_t getLength () const
 Returns the length of the payload for this option.
u_int8_t getSize () const
 Returns the size of the options when packed.
u_int16_t getId () const
void setId (u_int16_t _id)
xtr_result pack (u_int8_t *dest, size_t *size) const
 Writes the binary packed form of this option to the destination.
 ~OptionChainId ()

Detailed Description

A ChainId X-Trace metadata option.


Constructor & Destructor Documentation

xtr::OptionChainId::OptionChainId ( ) [inline]

Creates an empty chainId option.

Referenced by clone().

xtr::OptionChainId::OptionChainId ( const u_int8_t *  b,
size_t *  size 
)

Creates a ChainId option from the array.

If the type is wrong, size is set to 0 upon return, and the option will serialize to nothing

xtr::OptionChainId::OptionChainId ( u_int16_t  _id) [inline]
xtr::OptionChainId::~OptionChainId ( ) [inline]

Member Function Documentation

OptionChainId* xtr::OptionChainId::clone ( ) const [inline, virtual]

Returns a pointer to a newly allocated Option, of the same subtype as the cloned object.

Implements xtr::Option.

References OptionChainId().

u_int16_t xtr::OptionChainId::getId ( ) const [inline]
u_int8_t xtr::OptionChainId::getLength ( ) const [inline, virtual]

Returns the length of the payload for this option.

Implements xtr::Option.

u_int8_t xtr::OptionChainId::getSize ( ) const [inline, virtual]

Returns the size of the options when packed.

Implements xtr::Option.

u_int8_t xtr::OptionChainId::getType ( ) const [inline, virtual]

Returns the type of this option.

Implements xtr::Option.

References xtr::Option::CHAIN_ID.

xtr_result xtr::OptionChainId::pack ( u_int8_t *  dest,
size_t *  size 
) const [virtual]

Writes the binary packed form of this option to the destination.

Parameters:
destbuffer to write option to
sizeINPUT: maximum safe size to write to dest
OUTPUT: actual number of bytes written
Returns:
XTR_SUCCESS if enough space, XTR_FAIL otherwise

Implements xtr::Option.

void xtr::OptionChainId::setId ( u_int16_t  _id) [inline]

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