|
SNMP 2.1.0
|
BER object to handle boolean. More...
#include <src/BER.h>
Public Member Functions | |
| BooleanBER (const bool value) | |
| Creates a BooleanBER object. | |
| virtual void | encode (Stream &stream) |
| Encodes BooleanBER to stream. | |
| virtual void | decode (Stream &stream, const uint8_t flag=Flag::None) |
| Decodes BooleanBER from stream. | |
| virtual uint8_t * | encode (uint8_t *buffer) |
| Encodes BooleanBER to memory buffer. | |
| virtual uint8_t * | decode (uint8_t *buffer) |
| Decodes BooleanBER from memory buffer. | |
| const bool | getValue () const |
| Gets the BooleanBER value. | |
| void | setValue (const bool value) |
| Sets the BooleanBER 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. | |
Private Attributes | |
| bool | _value |
Static Private Attributes | |
| static constexpr uint8_t | LENGTH = 1 |
| static constexpr uint8_t | SIZE = 3 |
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 Member Functions inherited from SNMP::BER | |
| BER * | create (const Type &type) |
| Creates a BER of given type. | |
Protected Attributes inherited from SNMP::BER | |
| Length | _length |
| Type | _type |
Protected Attributes inherited from SNMP::Base | |
| unsigned int | _size = 0 |
|
inline |
Creates a BooleanBER object.
| value | BooleanBER boolean value. |
Definition at line 1064 of file BER.h.
References SNMP::BER::_length, _value, SNMP::BER::BER(), and LENGTH.
|
inlinevirtual |
Decodes BooleanBER from stream.
Type and length are decoded by the inherited BER::decode() then BooleanBER value is decoded.
| stream | Stream to read from. |
| flag | Decoding flag. |
Reimplemented from SNMP::BER.
Definition at line 1093 of file BER.h.
References _value, SNMP::BER::decode(), and SNMP::Flag::None.
|
inlinevirtual |
Decodes BooleanBER from memory buffer.
Type and length are decoded by the inherited BER::decode() then BooleanBER value is decoded.
| buffer | Pointer to the buffer. |
Reimplemented from SNMP::BER.
Definition at line 1122 of file BER.h.
References _value, SNMP::BER::decode(), and SIZE.
|
inlinevirtual |
Encodes BooleanBER to stream.
Type and length are encoded by the inherited BER::encode() then BooleanBER value is encoded.
| stream | Stream to write to. |
Reimplemented from SNMP::BER.
Definition at line 1079 of file BER.h.
References _value, and SNMP::BER::encode().
|
inlinevirtual |
Encodes BooleanBER to memory buffer.
Type and length are encoded by the inherited BER::encode() then BooleanBER value is encoded.
| buffer | Pointer to the buffer. |
Reimplemented from SNMP::BER.
Definition at line 1107 of file BER.h.
References _value, SNMP::BER::encode(), and SIZE.
|
inline |
Gets the BooleanBER value.
Definition at line 1134 of file BER.h.
References _value.
|
inline |
Sets the BooleanBER value.
| value | IntegerBER boolean value. |
Definition at line 1145 of file BER.h.
References _value.
|
private |
BooleanBER boolean value.
Definition at line 1155 of file BER.h.
Referenced by BooleanBER(), decode(), decode(), encode(), encode(), getValue(), and setValue().
|
staticconstexprprivate |
|
staticconstexprprivate |
Fixed size of the BooleanBER.