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

Represents the id of an X-Trace task. More...

#include <XtrMetadata.h>

Inheritance diagram for xtr::TaskId:
xtr::Id< XTR_MAX_TASK_ID_LEN >

Public Member Functions

 TaskId (size_t len=4)
 Creates a new TaskId with all bytes set to 0.
 TaskId (const u_int8_t *from, size_t len)
 Creates a new TaskId with the contents of from.
bool isValid () const
 Returns true if the id is not all 0's.
bool isValidLength (size_t len) const
 Returns true if the length is 4, 8, 12, or 20.

Detailed Description

Represents the id of an X-Trace task.

A TaskId can have different lengths, and currently the supported lengths are 4, 8, 12, and 20 bytes.


Constructor & Destructor Documentation

xtr::TaskId::TaskId ( size_t  len = 4)

Creates a new TaskId with all bytes set to 0.

Default length is 4, and with no parameters this is the default constructor.

Parameters:
lenThe length of the new TaskId. Valid lengths are 4, 8, 12, and 20. If len is invalid, the TaskId will be created with length 4 and all 0's.
xtr::TaskId::TaskId ( const u_int8_t *  from,
size_t  len 
)

Creates a new TaskId with the contents of from.

Parameters:
frombyte buffer to create the id from
lenthe size of the id to be created. The buffer in from MUST be of at least this size. Valid lengths are 4, 8, 12, and 20. If the length is invalid, the created TaskId has length 4 and all 0's as content.

Member Function Documentation

bool xtr::TaskId::isValid ( ) const

Returns true if the id is not all 0's.

Referenced by xtr::Metadata::isValid().

bool xtr::TaskId::isValidLength ( size_t  len) const [inline, virtual]

Returns true if the length is 4, 8, 12, or 20.

Reimplemented from xtr::Id< XTR_MAX_TASK_ID_LEN >.


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