SNMP 2.0.0
|
Length of a BER object. More...
#include <src/BER.h>
Public Member Functions | |
Length (unsigned int length=0) | |
Creates a BER length from a length value. | |
void | encode (Stream &stream) |
Encodes BER length to stream. | |
void | decode (Stream &stream) |
Decodes BER length from stream. | |
uint8_t * | encode (uint8_t *buffer) |
Encodes BER length to memory buffer. | |
uint8_t * | decode (uint8_t *buffer) |
Decodes BER length from memory buffer. | |
operator unsigned int () const | |
Unsigned int conversion function. | |
Length & | operator= (const unsigned int length) |
Unsigned int assignment operator. | |
Length & | operator+= (const unsigned int length) |
Addition operator. | |
Length & | operator-= (const unsigned int length) |
Subtraction operator. | |
Length & | operator++ () |
Prefix increment operator. | |
Length | operator++ (int) |
Postfix increment operator. | |
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. | |
Private Member Functions | |
void | setLength (unsigned int length) |
Sets length from integer. | |
Private Attributes | |
unsigned int | _length |
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::Base | |
unsigned int | _size = 0 |
This class handles the length of a BER object.
|
inline |
Creates a BER length from a length value.
length |
Definition at line 556 of file BER.h.
References setLength().
|
inline |
Decodes BER length from stream.
stream | Stream to read from. |
Definition at line 589 of file BER.h.
References _length, and SNMP::Base::_size.
Referenced by SNMP::BER::decode(), and SNMP::BER::decode().
|
inline |
Decodes BER length from memory buffer.
buffer | Pointer to the buffer. |
Definition at line 637 of file BER.h.
References _length, and SNMP::Base::_size.
|
inline |
Encodes BER length to stream.
There is two ways to encode a BER length.
stream | Stream to write to. |
Definition at line 572 of file BER.h.
References _length, and SNMP::Base::_size.
Referenced by SNMP::BER::encode(), and SNMP::BER::encode().
|
inline |
|
inline |
|
inline |
Prefix increment operator.
Increments length and return incremented value.
Definition at line 734 of file BER.h.
References _length, and setLength().
Referenced by operator++().
|
inline |
Postfix increment operator.
Increments length and return value before increment.
Definition at line 751 of file BER.h.
References operator++().
|
inline |
|
inline |
|
inline |
Unsigned int assignment operator.
Sets length from integer.
length |
Definition at line 681 of file BER.h.
References setLength().
|
inlineprivate |
Sets length from integer.
Length is set and the size is computed again.
length |
Definition at line 768 of file BER.h.
References _length, and SNMP::Base::_size.
Referenced by Length(), operator++(), operator+=(), operator-=(), and operator=().
|
private |
Definition at line 759 of file BER.h.
Referenced by decode(), decode(), encode(), encode(), operator unsigned int(), operator++(), operator+=(), operator-=(), and setLength().