UInt32Attribute
#include <icy/stun/attributes.h>
class UInt32AttributeDefined in src/stun/include/icy/stun/attributes.h:269
- Inherits
Attribute
List of all members
| Name | Kind | Owner |
|---|---|---|
UInt32Attribute | function | Declared here |
UInt32Attribute | function | Declared here |
clone | function | Declared here |
value | function | Declared here |
setValue | function | Declared here |
getBit | function | Declared here |
setBit | function | Declared here |
read | function | Declared here |
write | function | Declared here |
Size | variable | Declared here |
_bits | variable | Declared here |
~Attribute | function | Inherited from Attribute |
clone | function | Inherited from Attribute |
read | function | Inherited from Attribute |
write | function | Inherited from Attribute |
type | function | Inherited from Attribute |
size | function | Inherited from Attribute |
paddingBytes | function | Inherited from Attribute |
paddedBytes | function | Inherited from Attribute |
consumePadding | function | Inherited from Attribute |
writePadding | function | Inherited from Attribute |
typeString | function | Inherited from Attribute |
TypeID | variable | Inherited from Attribute |
create | function | Inherited from Attribute |
paddingBytes | function | Inherited from Attribute |
paddedBytes | function | Inherited from Attribute |
typeString | function | Inherited from Attribute |
_type | variable | Inherited from Attribute |
_size | variable | Inherited from Attribute |
Attribute | function | Inherited from Attribute |
setLength | function | Inherited from Attribute |
Type | enum | Inherited from Attribute |
Inherited from Attribute
| Kind | Name | Description |
|---|---|---|
function | ~Attribute virtual inline | |
function | clone virtual | Returns a deep copy of this attribute. |
function | read virtual | Reads the body (not the type or size) for this type of attribute from the given buffer. |
function | write virtual const | Writes the body (not the type or size) to the given buffer. |
function | type const | |
function | size const | |
function | paddingBytes const inline | |
function | paddedBytes const inline | |
function | consumePadding const | Advances the reader past any 4-byte alignment padding that follows this attribute's body. |
function | writePadding const | Writes zero-fill padding bytes to align this attribute to a 4-byte boundary. |
function | typeString | |
variable | TypeID static constexpr | |
function | create static | Creates an attribute of the given wire type and body size. Returns nullptr if the type is unknown or the size is invalid. |
function | paddingBytes static inline constexpr | Returns the 4-byte alignment padding required for a body of size bytes. |
function | paddedBytes static inline constexpr | Returns the body length including 4-byte alignment padding. |
function | typeString static | |
variable | _type | |
variable | _size | |
function | Attribute | |
function | setLength | Updates the stored body length. |
enum | Type |
Public Methods
| Return | Name | Description |
|---|---|---|
UInt32Attribute | ||
UInt32Attribute | Copy constructor. | |
std::unique_ptr< Attribute > | clone virtual override | Returns a deep copy of this attribute. |
uint32_t | value const inline | |
void | setValue inline | Sets the stored 32-bit value. |
bool | getBit const | Returns the state of a single bit within the stored word. |
void | setBit | Sets or clears a single bit within the stored word. |
void | read virtual override | Reads the body (not the type or size) for this type of attribute from the given buffer. |
void | write virtual const override | Writes the body (not the type or size) to the given buffer. |
UInt32Attribute
UInt32Attribute(uint16_t type)Defined in src/stun/include/icy/stun/attributes.h:273
Parameters
| Parameter | Type | Description |
|---|---|---|
type | uint16_t | Wire type code for the concrete attribute. |
UInt32Attribute
UInt32Attribute(const UInt32Attribute & r)Defined in src/stun/include/icy/stun/attributes.h:276
Copy constructor.
clone
virtual override
virtual std::unique_ptr< Attribute > clone() overrideDefined in src/stun/include/icy/stun/attributes.h:279
Returns a deep copy of this attribute.
Reimplements
value
const inline
inline uint32_t value() constDefined in src/stun/include/icy/stun/attributes.h:284
Returns
The stored 32-bit value.
setValue
inline
inline void setValue(uint32_t bits)Defined in src/stun/include/icy/stun/attributes.h:288
Sets the stored 32-bit value.
Parameters
| Parameter | Type | Description |
|---|---|---|
bits | uint32_t | Value to store. |
getBit
const
bool getBit(int index) constDefined in src/stun/include/icy/stun/attributes.h:293
Returns the state of a single bit within the stored word.
Returns
true if the bit is set.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | int | Bit position (0 = LSB, 31 = MSB). |
setBit
void setBit(int index, bool value)Defined in src/stun/include/icy/stun/attributes.h:298
Sets or clears a single bit within the stored word.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | int | Bit position (0 = LSB, 31 = MSB). |
value | bool | true to set, false to clear. |
read
virtual override
virtual void read(BitReader & reader) overrideDefined in src/stun/include/icy/stun/attributes.h:300
Reads the body (not the type or size) for this type of attribute from the given buffer.
Reimplements
Parameters
| Parameter | Type | Description |
|---|---|---|
reader | BitReader & | Source bit reader positioned at the attribute body. |
write
virtual const override
virtual void write(BitWriter & writer) const overrideDefined in src/stun/include/icy/stun/attributes.h:301
Writes the body (not the type or size) to the given buffer.
Reimplements
Parameters
| Parameter | Type | Description |
|---|---|---|
writer | BitWriter & | Destination bit writer. |
Public Static Attributes
| Return | Name | Description |
|---|---|---|
constexpr uint16_t | Size static constexpr |
Size
static constexpr
constexpr uint16_t Size = 4Defined in src/stun/include/icy/stun/attributes.h:281
Private Attributes
| Return | Name | Description |
|---|---|---|
uint32_t | _bits |
_bits
uint32_t _bits