SNMP 2.0.0
Loading...
Searching...
No Matches
SNMP::OpaqueFloatBER Class Reference

BER object to handle float. More...

#include <src/BER.h>

Inheritance diagram for SNMP::OpaqueFloatBER:
[legend]
Collaboration diagram for SNMP::OpaqueFloatBER:
[legend]

Public Member Functions

 OpaqueFloatBER (const float value)
 Creates an OpaqueFloatBER object.
 
- Public Member Functions inherited from SNMP::FloatBER
 FloatBER (const float value, const unsigned int type=Type::Float)
 Creates a FloatBER object.
 
virtual void encode (Stream &stream)
 Encodes FloatBER to stream.
 
virtual void decode (Stream &stream, const uint8_t flag=Flag::None)
 Decodes FloatBER from stream.
 
virtual uint8_t * encode (uint8_t *buffer)
 Encodes FloatBER to memory buffer.
 
virtual uint8_t * decode (uint8_t *buffer)
 Decodes FloatBER from memory buffer.
 
const float getValue () const
 Gets the FloatBER value.
 
void setValue (const float value)
 Sets the FloatBER 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.
 

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
BERcreate (const Type &type)
 Creates a BER of given type.
 
- Protected Attributes inherited from SNMP::FloatBER
float _value
 
- Protected Attributes inherited from SNMP::BER
Length _length
 
Type _type
 
- Protected Attributes inherited from SNMP::Base
unsigned int _size = 0
 
- Static Protected Attributes inherited from SNMP::FloatBER
static constexpr uint8_t LENGTH = 4
 

Detailed Description

BER object to handle float.

IEEE 754 single precision 32-bit is used to represent float.

  • Type is TYPE_OPAQUEFLOAT.
  • Length is fixed, 4 bytes, short form encoding.
  • Size is fixed, 7 bytes.

Example

OpaqueFLoat Encoding
25.589001 9f 78 04 41 CC B6 46
Note
OpaqueFloatBER is never used alone but always embedded in an OpaqueBER.
See also
Support for Floating-Point in SNMP

Definition at line 2629 of file BER.h.

Constructor & Destructor Documentation

◆ OpaqueFloatBER()

SNMP::OpaqueFloatBER::OpaqueFloatBER ( const float value)
inline

Creates an OpaqueFloatBER object.

Parameters
valueOpaqueFloatBER float value.

Definition at line 2636 of file BER.h.


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