X-TraceC++Library
|
Represents the id of an X-Trace task. More...
#include <XtrMetadata.h>
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. |
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.
xtr::TaskId::TaskId | ( | size_t | len = 4 | ) |
xtr::TaskId::TaskId | ( | const u_int8_t * | from, |
size_t | len | ||
) |
Creates a new TaskId with the contents of from.
from | byte buffer to create the id from |
len | the 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. |
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 >.