Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

Counter64 Class Reference

#include <ctr64.h>

Inheritance diagram for Counter64:

[legend]
Collaboration diagram for Counter64:
[legend]
List of all members.

Detailed Description

Counter64 Class encapsulates two unsigned integers into a a single entity.

This type has is available in SNMPv2 but may be used anywhere where needed.

Definition at line 84 of file ctr64.h.

Public Member Functions

 Counter64 ()
 Constructs a valid Couter64 with value 0.

 Counter64 (unsigned long lo)
 Constructs a valid Counter64 with the given value as the lower 32 bits.

 Counter64 (unsigned long hi, unsigned long lo)
 Constructs a valid Counter64 with the given values.

 Counter64 (const Counter64 &ctr64)
 Copy constructor.

 ~Counter64 ()
 Destructor (ensure that SnmpSyntax::~SnmpSyntax() is overridden).

long double c64_to_ld () const
 Get the value of this object as long double.

unsigned long high () const
 Get the high 32 bit part.

unsigned long low () const
 Get the low 32 bit part.

void set_high (const unsigned long h)
 Set the high 32 bit part.

void set_low (const unsigned long l)
 Set the low 32 bit part.

const char * get_printable () const
 Get a printable ASCII string representing the current value.

SmiUINT32 get_syntax () const
 Get the Syntax of the object.

SnmpSyntaxclone () const
 Clone the object.

SnmpSyntaxoperator= (const SnmpSyntax &val)
 Overloaded assignement operator.

bool valid () const
 Return validity of the object.

int get_asn1_length () const
 Return the space needed for serialization.

void clear ()
 Reset the object.

Counter64operator= (const Counter64 &ctr64)
 Assign a Counter64 to a Counter64.

Counter64operator= (const unsigned long i)
 Assign a unsigned long to a Counter64.

Counter64 operator+ (const Counter64 &c) const
 Add two Counter64.

Counter64 operator- (const Counter64 &c) const
 Subtract two Counter64.

Counter64 operator * (const Counter64 &c) const
 Multiply two Counter64.

Counter64 operator/ (const Counter64 &c) const
 Divide two Counter64.


Static Public Member Functions

long double c64_to_ld (const Counter64 &c64)
 Get the value of the object as long double.

Counter64 ld_to_c64 (const long double &ld)
 Convert a long double to a Counter64.


Private Attributes

char output_buffer [CTR64OUTBUF]

Friends

DLLOPT friend Counter64 operator+ (unsigned long ul, const Counter64 &c64)
 Add a unsigned long and a Counter64.

DLLOPT friend Counter64 operator- (unsigned long ul, const Counter64 &c64)
 Subtract a unsigned long and a Counter64.

DLLOPT friend Counter64 operator * (unsigned long ul, const Counter64 &c64)
 Multiply a unsigned long and a Counter64.

DLLOPT friend Counter64 operator/ (unsigned long ul, const Counter64 &c64)
 Divide a unsigned long and a Counter64.

DLLOPT friend bool operator== (const Counter64 &lhs, const Counter64 &rhs)
 Equal operator for two Cunter64.

DLLOPT friend bool operator!= (const Counter64 &lhs, const Counter64 &rhs)
 Not equal operator for two Cunter64.

DLLOPT friend bool operator< (const Counter64 &lhs, const Counter64 &rhs)
 Less than operator for two Cunter64.

DLLOPT friend bool operator<= (const Counter64 &lhs, const Counter64 &rhs)
 Less than or equal operator for two Cunter64.

DLLOPT friend bool operator> (const Counter64 &lhs, const Counter64 &rhs)
 Greater than operator for two Cunter64.

DLLOPT friend bool operator>= (const Counter64 &lhs, const Counter64 &rhs)
 Greater than or equal operator for two Cunter64.


Constructor & Destructor Documentation

Counter64::Counter64  ) 
 

Constructs a valid Couter64 with value 0.

Counter64::Counter64 unsigned long  lo  ) 
 

Constructs a valid Counter64 with the given value as the lower 32 bits.

Parameters:
lo - value (0..MAX_UINT32)

Counter64::Counter64 unsigned long  hi,
unsigned long  lo
 

Constructs a valid Counter64 with the given values.

Parameters:
hi - value for the high 32 bits (0..MAX_UINT32)
lo - value for the low 32 bits (0..MAX_UINT32)

Counter64::Counter64 const Counter64 ctr64  ) 
 

Copy constructor.

Parameters:
ctr64 - value

Counter64::~Counter64  )  [inline]
 

Destructor (ensure that SnmpSyntax::~SnmpSyntax() is overridden).

Definition at line 120 of file ctr64.h.


Member Function Documentation

long double Counter64::c64_to_ld  )  const
 

Get the value of this object as long double.

Returns:
value as a long double

long double Counter64::c64_to_ld const Counter64 c64  )  [static]
 

Get the value of the object as long double.

Parameters:
c64 - The Counter64 object whose value should be returned
Returns:
value as a long double

void Counter64::clear  )  [inline, virtual]
 

Reset the object.

Implements SnmpSyntax.

Definition at line 229 of file ctr64.h.

SnmpSyntax* Counter64::clone  )  const [inline, virtual]
 

Clone the object.

Returns:
A cloned Counter64 object allocated through new.

Implements SnmpSyntax.

Definition at line 202 of file ctr64.h.

int Counter64::get_asn1_length  )  const [virtual]
 

Return the space needed for serialization.

Returns:
The needed space that depends on the current value.

Implements SnmpSyntax.

const char* Counter64::get_printable  )  const [virtual]
 

Get a printable ASCII string representing the current value.

Note:
The returned string is valid as long as the object is not modified.
Returns:
Null terminated string.

Implements SnmpSyntax.

SmiUINT32 Counter64::get_syntax  )  const [inline, virtual]
 

Get the Syntax of the object.

Returns:
This method always returns sNMP_SYNTAX_CNTR64.

Implements SnmpSyntax.

Definition at line 195 of file ctr64.h.

References SmiUINT32, and sNMP_SYNTAX_CNTR64.

unsigned long Counter64::high  )  const [inline]
 

Get the high 32 bit part.

Returns:
The high part of the Counter64

Definition at line 154 of file ctr64.h.

Counter64 Counter64::ld_to_c64 const long double &  ld  )  [static]
 

Convert a long double to a Counter64.

Parameters:
ld - the value to convert
Returns:
A Counter64 object with the value of the param ld.

unsigned long Counter64::low  )  const [inline]
 

Get the low 32 bit part.

Returns:
The low part of the Counter64

Definition at line 161 of file ctr64.h.

Counter64 Counter64::operator * const Counter64 c  )  const
 

Multiply two Counter64.

Counter64 Counter64::operator+ const Counter64 c  )  const
 

Add two Counter64.

Counter64 Counter64::operator- const Counter64 c  )  const
 

Subtract two Counter64.

Counter64 Counter64::operator/ const Counter64 c  )  const
 

Divide two Counter64.

Counter64& Counter64::operator= const unsigned long  i  ) 
 

Assign a unsigned long to a Counter64.

Parameters:
i - The new low part. The high part is cleared.

Counter64& Counter64::operator= const Counter64 ctr64  ) 
 

Assign a Counter64 to a Counter64.

SnmpSyntax& Counter64::operator= const SnmpSyntax val  )  [virtual]
 

Overloaded assignement operator.

Parameters:
val - Try to map the given value to a Counter64 and assign it
Returns:
Always *this with the new value.

Reimplemented from SnmpSyntax.

void Counter64::set_high const unsigned long  h  )  [inline]
 

Set the high 32 bit part.

The low part will stay unchanged.

Parameters:
h - The new high part of the Counter64

Definition at line 168 of file ctr64.h.

void Counter64::set_low const unsigned long  l  )  [inline]
 

Set the low 32 bit part.

The high part will stay unchanged.

Parameters:
l - The new low part of the Counter64

Definition at line 175 of file ctr64.h.

bool Counter64::valid  )  const [inline, virtual]
 

Return validity of the object.

Returns:
Always true

Implements SnmpSyntax.

Definition at line 217 of file ctr64.h.


Friends And Related Function Documentation

DLLOPT friend Counter64 operator * unsigned long  ul,
const Counter64 c64
[friend]
 

Multiply a unsigned long and a Counter64.

Definition at line 276 of file ctr64.h.

DLLOPT friend bool operator!= const Counter64 lhs,
const Counter64 rhs
[friend]
 

Not equal operator for two Cunter64.

DLLOPT friend Counter64 operator+ unsigned long  ul,
const Counter64 c64
[friend]
 

Add a unsigned long and a Counter64.

Definition at line 254 of file ctr64.h.

DLLOPT friend Counter64 operator- unsigned long  ul,
const Counter64 c64
[friend]
 

Subtract a unsigned long and a Counter64.

Definition at line 265 of file ctr64.h.

DLLOPT friend Counter64 operator/ unsigned long  ul,
const Counter64 c64
[friend]
 

Divide a unsigned long and a Counter64.

Definition at line 287 of file ctr64.h.

DLLOPT friend bool operator< const Counter64 lhs,
const Counter64 rhs
[friend]
 

Less than operator for two Cunter64.

DLLOPT friend bool operator<= const Counter64 lhs,
const Counter64 rhs
[friend]
 

Less than or equal operator for two Cunter64.

DLLOPT friend bool operator== const Counter64 lhs,
const Counter64 rhs
[friend]
 

Equal operator for two Cunter64.

DLLOPT friend bool operator> const Counter64 lhs,
const Counter64 rhs
[friend]
 

Greater than operator for two Cunter64.

DLLOPT friend bool operator>= const Counter64 lhs,
const Counter64 rhs
[friend]
 

Greater than or equal operator for two Cunter64.


Member Data Documentation

char Counter64::output_buffer[CTR64OUTBUF] [private]
 

Definition at line 323 of file ctr64.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 4 22:42:16 2005 for SNMP++ by doxygen 1.3.2