SNMP 2.0.0
|
Base class for unsigned integer BER. More...
#include <src/BER.h>
Public Member Functions | |
virtual void | encode (Stream &stream) |
Encodes UIntegerBER to stream. | |
virtual void | decode (Stream &stream, const uint8_t flag=Flag::None) |
Decodes UIntegerBER from stream. | |
virtual uint8_t * | encode (uint8_t *buffer) |
Encodes UIntegerBER to memory buffer. | |
virtual uint8_t * | decode (uint8_t *buffer) |
Decodes UIntegerBER from memory buffer. | |
const T | getValue () const |
Gets the UIntegerBER value. | |
void | setValue (const T value) |
Sets the UIntegerBER value. | |
Public Member Functions inherited from SNMP::BER | |
BER (const unsigned int type) | |
Creates a BER object. | |
virtual | ~BER () |
BER destructor. | |
template<typename T > | |
void | encodeNumeric (T value, Stream &stream) |
Encodes BER numeric value to stream. | |
template<typename T > | |
void | decodeNumeric (T *value, Stream &stream, const uint8_t flag=Flag::None) |
Decodes BER numeric value from stream. | |
template<typename T > | |
uint8_t * | encodeNumeric (T value, uint8_t *buffer) |
Encodes BER numeric value to memory buffer. | |
template<typename T > | |
uint8_t * | decodeNumeric (T *value, uint8_t *buffer, const uint8_t flag=Flag::None) |
Decodes BER numeric value from memory buffer. | |
template<typename T > | |
void | setNegative (T value) |
Computes BER length of a negative integer. | |
template<typename T > | |
void | setPositive (T value) |
Computes BER length of a positive integer. | |
const unsigned int | getType () const |
Gets the BER type. | |
const unsigned int | getLength () const |
Gets the BER length. | |
virtual const unsigned int | getSize (const bool refresh=false) |
Gets the size of the BER. | |
Public Member Functions inherited from SNMP::Base | |
void | encode7bits (uint32_t value, uint8_t *buffer, const uint8_t size) |
Encodes integer value to memory buffer. | |
Protected Member Functions | |
UIntegerBER (const T value, const uint8_t type) | |
Creates an UIntegerBER. | |
Protected Member Functions inherited from SNMP::BER | |
BER * | create (const Type &type) |
Creates a BER of given type. | |
Private Attributes | |
T | _value |
Additional Inherited Members | |
Static Public Member Functions inherited from SNMP::Base | |
static void | encode7bits (uint32_t value, Stream &stream, const uint8_t size) |
Encodes integer value to stream. | |
Protected Attributes inherited from SNMP::BER | |
Length | _length |
Type | _type |
Protected Attributes inherited from SNMP::Base | |
unsigned int | _size = 0 |
Base class for unsigned integer BER.
T | Unsigned integer type. |
|
inlineprotected |
Creates an UIntegerBER.
value | UIntegerBER unsigned integer value. |
type | UIntegerBER type. |
Definition at line 2100 of file BER.h.
References SNMP::UIntegerBER< T >::setValue().
|
inlinevirtual |
Decodes UIntegerBER from stream.
The inherited BER::decodeNumeric<T>() template function decodes type, length and value.
stream | Stream to read from. |
flag | Decoding flag. |
Reimplemented from SNMP::BER.
Definition at line 2128 of file BER.h.
References SNMP::UIntegerBER< T >::_value, and SNMP::BER::decodeNumeric().
|
inlinevirtual |
Decodes UIntegerBER from memory buffer.
The inherited BER::decodeNumeric<T>() template function decodes type, length and value.
buffer | Pointer to the buffer. |
Reimplemented from SNMP::BER.
Definition at line 2154 of file BER.h.
References SNMP::UIntegerBER< T >::_value, and SNMP::BER::decodeNumeric().
|
inlinevirtual |
Encodes UIntegerBER to stream.
The inherited BER::encodeNumeric<T>() template function encodes type, length and value.
stream | Stream to write to. |
Reimplemented from SNMP::BER.
Definition at line 2115 of file BER.h.
References SNMP::UIntegerBER< T >::_value, and SNMP::BER::encodeNumeric().
|
inlinevirtual |
Encodes UIntegerBER to memory buffer.
The inherited BER::encodeNumeric<T>() template function encodes type, length and value.
buffer | Pointer to the buffer. |
Reimplemented from SNMP::BER.
Definition at line 2141 of file BER.h.
References SNMP::UIntegerBER< T >::_value, and SNMP::BER::encodeNumeric().
|
inline |
Gets the UIntegerBER value.
Definition at line 2164 of file BER.h.
References SNMP::UIntegerBER< T >::_value.
|
inline |
Sets the UIntegerBER value.
value | UIntegerBER unsigned integer value. |
Definition at line 2175 of file BER.h.
References SNMP::UIntegerBER< T >::_value, and SNMP::BER::setPositive().
Referenced by SNMP::UIntegerBER< T >::UIntegerBER().
|
private |
UIntegerBER unsigned integer value.
Definition at line 2182 of file BER.h.
Referenced by SNMP::UIntegerBER< T >::decode(), SNMP::UIntegerBER< T >::decode(), SNMP::UIntegerBER< T >::encode(), SNMP::UIntegerBER< T >::encode(), SNMP::UIntegerBER< T >::getValue(), and SNMP::UIntegerBER< T >::setValue().