#include <icy/stun/attributes.h>Inherits:
Attribute
Implements a STUN/TURN attribute that holds an 8-bit integer.
| Return | Name | Description |
|---|---|---|
UInt8Attribute | #### Parameters | |
UInt8Attribute | Copy constructor. | |
std::unique_ptr< Attribute > | clone virtual | Returns a deep copy of this attribute. |
uint8_t | value const inline | #### Returns |
void | setValue inline | Sets the stored 8-bit value. |
bool | getBit const | Returns the state of a single bit within the stored byte. |
void | setBit | Sets or clears a single bit within the stored byte. |
void | read virtual | Reads the body (not the type or size) for this type of attribute from the given buffer. |
void | write virtual const | Writes the body (not the type or size) to the given buffer. |
UInt8Attribute(uint16_t type)type Wire type code for the concrete attribute.UInt8Attribute(const UInt8Attribute & r)Copy constructor.
virtual
virtual std::unique_ptr< Attribute > clone()Returns a deep copy of this attribute.
const inline
inline uint8_t value() constThe stored 8-bit value.
inline
inline void setValue(uint8_t bits)Sets the stored 8-bit value.
bits Value to store.const
bool getBit(int index) constReturns the state of a single bit within the stored byte.
index Bit position (0 = LSB, 7 = MSB).true if the bit is set.
void setBit(int index, bool value)Sets or clears a single bit within the stored byte.
index Bit position (0 = LSB, 7 = MSB).
value true to set, false to clear.
virtual
virtual void read(BitReader & reader)Reads the body (not the type or size) for this type of attribute from the given buffer.
reader Source bit reader positioned at the attribute body.virtual const
virtual void write(BitWriter & writer) constWrites the body (not the type or size) to the given buffer.
writer Destination bit writer.| Return | Name | Description |
|---|---|---|
constexpr uint16_t | Size static |
static
constexpr uint16_t Size = 1| Return | Name | Description |
|---|---|---|
uint8_t | _bits |
uint8_t _bits