STUN module (rfc5389)
UInt64Attribute
Implements a STUN/TURN attribute that holds a 64-bit integer.
UInt64Attribute
#include <icy/stun/attributes.h>Inherits:
Attribute
Implements a STUN/TURN attribute that holds a 64-bit integer.
Public Methods
| Return | Name | Description |
|---|---|---|
UInt64Attribute | #### Parameters | |
UInt64Attribute | Copy constructor. | |
std::unique_ptr< Attribute > | clone virtual | Returns a deep copy of this attribute. |
uint64_t | value const inline | #### Returns |
void | setValue inline | Sets the stored 64-bit value. |
bool | getBit const | Returns the state of a single bit within the stored quad-word. |
void | setBit | Sets or clears a single bit within the stored quad-word. |
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. |
UInt64Attribute
UInt64Attribute(uint16_t type)Parameters
typeWire type code for the concrete attribute.
UInt64Attribute
UInt64Attribute(const UInt64Attribute & r)Copy constructor.
clone
virtual
virtual std::unique_ptr< Attribute > clone()Returns a deep copy of this attribute.
value
const inline
inline uint64_t value() constReturns
The stored 64-bit value.
setValue
inline
inline void setValue(uint64_t bits)Sets the stored 64-bit value.
Parameters
bitsValue to store.
getBit
const
bool getBit(int index) constReturns the state of a single bit within the stored quad-word.
Parameters
indexBit position (0 = LSB, 63 = MSB).
Returns
true if the bit is set.
setBit
void setBit(int index, bool value)Sets or clears a single bit within the stored quad-word.
Parameters
indexBit position (0 = LSB, 63 = MSB).valuetrue to set, false to clear.
read
virtual
virtual void read(BitReader & reader)Reads the body (not the type or size) for this type of attribute from the given buffer.
Parameters
readerSource bit reader positioned at the attribute body.
write
virtual const
virtual void write(BitWriter & writer) constWrites the body (not the type or size) to the given buffer.
Parameters
writerDestination bit writer.
Public Static Attributes
| Return | Name | Description |
|---|---|---|
constexpr uint16_t | Size static |
Size
static
constexpr uint16_t Size = 8Private Attributes
| Return | Name | Description |
|---|---|---|
uint64_t | _bits |
_bits
uint64_t _bits