IBR-DTNSuite 0.6

dtn::data::SDNV Class Reference

#include <SDNV.h>

List of all members.

Public Member Functions

 SDNV (const u_int64_t value)
 SDNV ()
size_t getLength () const
u_int64_t getValue () const
size_t decode (const char *data, const size_t len)
size_t encode (char *data, const size_t len) const
size_t operator= (const size_t &value)
bool operator== (const SDNV &value) const
bool operator!= (const SDNV &value) const
SDNV operator+ (const SDNV &value)
SDNVoperator+= (const SDNV &value)
SDNV operator- (const SDNV &value)
SDNVoperator-= (const SDNV &value)
bool operator& (const size_t &value) const

Static Public Member Functions

static size_t getLength (const u_int64_t &value)
static size_t getLength (const unsigned char *data)

Static Public Attributes

static const size_t MAX_LENGTH = 10

Friends

std::ostream & operator<< (std::ostream &stream, const dtn::data::SDNV &obj)
std::istream & operator>> (std::istream &stream, dtn::data::SDNV &obj)

Detailed Description

Definition at line 48 of file SDNV.h.


Constructor & Destructor Documentation

dtn::data::SDNV::SDNV ( const u_int64_t  value)

Constructor for a SDNV object

Parameters:
valueThe new value of the SDNV

Definition at line 31 of file SDNV.cpp.

dtn::data::SDNV::SDNV ( )

Empty constructor for a SDNV object

Definition at line 34 of file SDNV.cpp.

Referenced by operator+(), and operator-().


Member Function Documentation

size_t dtn::data::SDNV::decode ( const char *  data,
const size_t  len 
)

Decode a SDNV out of a existing char array.

Parameters:
dataThe char array.
lenThe size of the array. (overflow protection)
Returns:
The size of the encoded SDNV.

Definition at line 57 of file SDNV.cpp.

Referenced by dtn::data::operator>>().

size_t dtn::data::SDNV::encode ( char *  data,
const size_t  len 
) const

Encode a SDNV and write it to a data array.

Parameters:
dataThe data array to write to.
lenThe size of the array. (overflow protection)
Returns:
The size of the written data.

Definition at line 62 of file SDNV.cpp.

Referenced by dtn::data::operator<<().

size_t dtn::data::SDNV::getLength ( const u_int64_t &  value) [static]

Definition at line 42 of file SDNV.cpp.

size_t dtn::data::SDNV::getLength ( const unsigned char *  data) [static]

Definition at line 47 of file SDNV.cpp.

bool dtn::data::SDNV::operator!= ( const SDNV value) const

Definition at line 78 of file SDNV.cpp.

bool dtn::data::SDNV::operator& ( const size_t &  value) const

Definition at line 105 of file SDNV.cpp.

SDNV dtn::data::SDNV::operator+ ( const SDNV value)

Definition at line 83 of file SDNV.cpp.

References getValue(), and SDNV().

Here is the call graph for this function:

SDNV & dtn::data::SDNV::operator+= ( const SDNV value)

Definition at line 88 of file SDNV.cpp.

SDNV dtn::data::SDNV::operator- ( const SDNV value)

Definition at line 94 of file SDNV.cpp.

References getValue(), and SDNV().

Here is the call graph for this function:

SDNV & dtn::data::SDNV::operator-= ( const SDNV value)

Definition at line 99 of file SDNV.cpp.

size_t dtn::data::SDNV::operator= ( const size_t &  value)

Definition at line 67 of file SDNV.cpp.

bool dtn::data::SDNV::operator== ( const SDNV value) const

Definition at line 73 of file SDNV.cpp.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const dtn::data::SDNV obj 
) [friend]

Definition at line 110 of file SDNV.cpp.

std::istream& operator>> ( std::istream &  stream,
dtn::data::SDNV obj 
) [friend]

Definition at line 121 of file SDNV.cpp.


Member Data Documentation

const size_t dtn::data::SDNV::MAX_LENGTH = 10 [static]

The maximum length for this SDNV implementation is 10 bytes, since the maximum value is 64 bits wide.

Definition at line 55 of file SDNV.h.

Referenced by dtn::data::operator>>().


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