SNMP++  3.3.4
Counter64 Class Reference

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

#include <ctr64.h>

Inheritance diagram for Counter64:
Collaboration diagram for Counter64:

Public Member Functions

 Counter64 (unsigned long hi, unsigned long lo)
 Constructs a valid Counter64 with the given values. More...
 
 Counter64 (pp_uint64 val=0)
 Constructs a valid Counter64 with the given value (default 0). More...
 
 Counter64 (const Counter64 &ctr64)
 Copy constructor. More...
 
 ~Counter64 ()
 Destructor (ensure that SnmpSyntax::~SnmpSyntax() is overridden). More...
 
 operator pp_uint64 () const
 
unsigned long high () const
 Get the high 32 bit part. More...
 
unsigned long low () const
 Get the low 32 bit part. More...
 
void set_high (const unsigned long h)
 Set the high 32 bit part. More...
 
void set_low (const unsigned long l)
 Set the low 32 bit part. More...
 
const char * get_printable () const
 Get a printable ASCII string representing the current value. More...
 
SmiUINT32 get_syntax () const
 Get the Syntax of the object. More...
 
SnmpSyntaxclone () const
 Clone the object. More...
 
SnmpSyntaxoperator= (const SnmpSyntax &val)
 Overloaded assignement operator. More...
 
bool valid () const
 Return validity of the object. More...
 
int get_asn1_length () const
 Return the space needed for serialization. More...
 
void clear ()
 Reset the object. More...
 
Counter64operator= (const Counter64 &ctr64)
 Assign a Counter64 to a Counter64. More...
 
Counter64operator= (const pp_uint64 i)
 Assign a unsigned long to a Counter64. More...
 
- Public Member Functions inherited from SnmpSyntax
virtual ~SnmpSyntax ()
 Virtual destructor to ensure deletion of derived classes... More...
 

Protected Attributes

SNMP_PP_MUTABLE char output_buffer [CTR64OUTBUF]
 
SNMP_PP_MUTABLE bool m_changed
 
- Protected Attributes inherited from SnmpSyntax
SmiVALUE smival
 

Additional Inherited Members

- Protected Member Functions inherited from SnmpSyntax
 SnmpSyntax ()
 

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 76 of file ctr64.h.

Constructor & Destructor Documentation

Counter64::Counter64 ( unsigned long  hi,
unsigned long  lo 
)
inline

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)

Definition at line 100 of file ctr64.h.

References sNMP_SYNTAX_CNTR64.

Counter64::Counter64 ( pp_uint64  val = 0)
inline

Constructs a valid Counter64 with the given value (default 0).

Parameters
val- value (full 64-bit)

Definition at line 113 of file ctr64.h.

References sNMP_SYNTAX_CNTR64, and UINT32_MAX.

Counter64::Counter64 ( const Counter64 ctr64)
inline

Copy constructor.

Parameters
ctr64- value

Definition at line 126 of file ctr64.h.

References SmiVALUE::hNumber, SnmpSyntax::smival, sNMP_SYNTAX_CNTR64, and SmiVALUE::value.

Counter64::~Counter64 ( )
inline

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

Definition at line 136 of file ctr64.h.

Member Function Documentation

void Counter64::clear ( )
inlinevirtual

Reset the object.

Implements SnmpSyntax.

Definition at line 256 of file ctr64.h.

SnmpSyntax* Counter64::clone ( ) const
inlinevirtual

Clone the object.

Returns
A cloned Counter64 object allocated through new.

Implements SnmpSyntax.

Definition at line 229 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
inlinevirtual

Get the Syntax of the object.

Returns
This method always returns sNMP_SYNTAX_CNTR64.

Implements SnmpSyntax.

Definition at line 222 of file ctr64.h.

References 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 179 of file ctr64.h.

Referenced by operator=().

unsigned long Counter64::low ( ) const
inline

Get the low 32 bit part.

Returns
The low part of the Counter64

Definition at line 186 of file ctr64.h.

Referenced by operator=().

Counter64::operator pp_uint64 ( ) const
inline

Definition at line 165 of file ctr64.h.

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.

Implements SnmpSyntax.

Counter64& Counter64::operator= ( const Counter64 ctr64)
inline

Assign a Counter64 to a Counter64.

Definition at line 265 of file ctr64.h.

References high(), and low().

Counter64& Counter64::operator= ( const pp_uint64  i)
inline

Assign a unsigned long to a Counter64.

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

Definition at line 281 of file ctr64.h.

References UINT32_MAX.

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 193 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 201 of file ctr64.h.

bool Counter64::valid ( ) const
inlinevirtual

Return validity of the object.

Returns
Always true

Implements SnmpSyntax.

Definition at line 244 of file ctr64.h.

Member Data Documentation

SNMP_PP_MUTABLE bool Counter64::m_changed
protected

Definition at line 370 of file ctr64.h.

SNMP_PP_MUTABLE char Counter64::output_buffer[CTR64OUTBUF]
protected

Definition at line 369 of file ctr64.h.


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