IBR-DTNSuite  0.8
dtn::data::SDNV Class Reference

#include <SDNV.h>

List of all members.

Public Member Functions

 SDNV (const u_int64_t value)
 SDNV ()
 ~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
bool operator< (const SDNV &value) const
bool operator<= (const SDNV &value) const
bool operator> (const SDNV &value) const
bool operator>= (const SDNV &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.

Empty constructor for a SDNV object

Definition at line 34 of file SDNV.cpp.

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

Destructor

Returns:

Definition at line 37 of file SDNV.cpp.


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 60 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 65 of file SDNV.cpp.

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

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

Definition at line 45 of file SDNV.cpp.

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

Definition at line 50 of file SDNV.cpp.

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

Definition at line 81 of file SDNV.cpp.

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

Definition at line 108 of file SDNV.cpp.

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

Definition at line 86 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 91 of file SDNV.cpp.

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

Definition at line 97 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 102 of file SDNV.cpp.

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

Definition at line 113 of file SDNV.cpp.

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

Definition at line 118 of file SDNV.cpp.

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

Definition at line 70 of file SDNV.cpp.

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

Definition at line 76 of file SDNV.cpp.

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

Definition at line 123 of file SDNV.cpp.

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

Definition at line 128 of file SDNV.cpp.


Friends And Related Function Documentation

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

Definition at line 133 of file SDNV.cpp.

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

Definition at line 144 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: