UInt16ListAttribute
UInt16ListAttribute
#include <icy/stun/attributes.h>Inherits:
Attribute
Implements a STUN/TURN attribute that holds a list of attribute type codes. Used by the UNKNOWN-ATTRIBUTES attribute (RFC 5389 section 15.9).
Public Methods
| Return | Name | Description |
|---|---|---|
UInt16ListAttribute | #### Parameters | |
UInt16ListAttribute | Copy constructor; duplicates the type list. | |
std::unique_ptr< Attribute > | clone virtual | Returns a deep copy of this attribute. |
size_t | size const | #### Returns |
uint16_t | getType const | Returns the type code at the given list position. |
void | setType | Overwrites the type code at the given list position. |
void | addType | Appends a type code to the list and updates the attribute size. |
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. |
UInt16ListAttribute
UInt16ListAttribute(uint16_t type, uint16_t size)Parameters
typeWire type code for the concrete attribute.sizeInitial body length in bytes.
UInt16ListAttribute
UInt16ListAttribute(const UInt16ListAttribute & r)Copy constructor; duplicates the type list.
clone
virtual
virtual std::unique_ptr< Attribute > clone()Returns a deep copy of this attribute.
size
const
size_t size() constReturns
Number of attribute type codes in the list.
getType
const
uint16_t getType(int index) constReturns the type code at the given list position.
Parameters
indexZero-based list index.
Returns
Attribute type code at index.
setType
void setType(int index, uint16_t value)Overwrites the type code at the given list position.
Parameters
indexZero-based list index.valueNew attribute type code.
addType
void addType(uint16_t value)Appends a type code to the list and updates the attribute size.
Parameters
valueAttribute type code to append.
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.
Private Attributes
| Return | Name | Description |
|---|---|---|
std::vector< uint16_t > | _attrTypes |
_attrTypes
std::vector< uint16_t > _attrTypes