X-TraceC++Library
Public Types | Public Member Functions
xtr::OptionSeverity Class Reference

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

#include <XtrOption.h>

Inheritance diagram for xtr::OptionSeverity:
xtr::Option

Public Types

enum  Level {
  EMERG = 0, ALERT = 1, CRITICAL = 2, ERROR = 3,
  WARNING = 4, NOTICE = 5, INFO = 6, DEBUG = 7,
  _ALL = 8, _NONE = 255, _UNSET = 254, _DEFAULT = NOTICE
}
 The Severity levels. More...

Public Member Functions

 OptionSeverity ()
 OptionSeverity (const u_int8_t *b, size_t *size)
 OptionSeverity (u_int8_t s)
OptionSeverityclone () 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_int8_t getSeverity () const
void setSeverity (u_int8_t s)
xtr_result pack (u_int8_t *dest, size_t *size) const
 Writes the binary packed form of this option to the destination.

Detailed Description

A Severity X-Trace metadata option.


Member Enumeration Documentation

The Severity levels.

These are the same values and names as defined in the syslog RFC (RCF 3164). The values _ALL, _NONE, _ABSENT, and _DEFAULT are not valid to be carried in the X-Trace metadata, and are only defined in this implementation for internal use.

Enumerator:
EMERG 
ALERT 
CRITICAL 
ERROR 
WARNING 
NOTICE 
INFO 
DEBUG 
_ALL 
_NONE 
_UNSET 
_DEFAULT 

Constructor & Destructor Documentation

xtr::OptionSeverity::OptionSeverity ( ) [inline]

Referenced by clone().

xtr::OptionSeverity::OptionSeverity ( const u_int8_t *  b,
size_t *  size 
)
xtr::OptionSeverity::OptionSeverity ( u_int8_t  s) [inline]

Member Function Documentation

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

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

Implements xtr::Option.

References OptionSeverity().

u_int8_t xtr::OptionSeverity::getLength ( ) const [inline, virtual]

Returns the length of the payload for this option.

Implements xtr::Option.

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

Returns the size of the options when packed.

Implements xtr::Option.

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

Returns the type of this option.

Implements xtr::Option.

References xtr::Option::SEVERITY.

xtr_result xtr::OptionSeverity::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::OptionSeverity::setSeverity ( u_int8_t  s) [inline]

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