OptFieldWithPresenceInd is a class modeling an optional field (in an Information Element, a management frame, etc.) having an associated Presence Indicator bit. More...
#include "wifi-opt-field.h"
Public Member Functions | |
| OptFieldWithPresenceInd (bool &presenceFlag) | |
| constructor | |
| OptFieldWithPresenceInd (const OptFieldWithPresenceInd &)=delete | |
| OptFieldWithPresenceInd (OptFieldWithPresenceInd &&)=delete | |
| template<class... Args> | |
| constexpr T & | emplace (Args &&... args) |
| Construct the contained value in-place. | |
| constexpr bool | has_value () const |
| Check whether this object contains a value. | |
| constexpr | operator bool () const |
| Operator bool. | |
| constexpr T & | operator* () |
| constexpr const T & | operator* () const |
| constexpr T * | operator-> () |
| constexpr const T * | operator-> () const |
| OptFieldWithPresenceInd & | operator= (const OptFieldWithPresenceInd &)=delete |
| constexpr OptFieldWithPresenceInd & | operator= (const std::optional< T > &other) |
| Assign the given value to the optional field. | |
| OptFieldWithPresenceInd & | operator= (OptFieldWithPresenceInd &&)=delete |
| constexpr OptFieldWithPresenceInd & | operator= (std::nullopt_t) |
| Destroy the value (if any) contained in the optional field. | |
| constexpr OptFieldWithPresenceInd & | operator= (std::optional< T > &&other) |
| Assign the given value to the optional field. | |
| constexpr void | reset () |
| Destroy the value (if any) contained in the optional field. | |
| constexpr std::optional< T > | ToOptional () const |
| This is a helper function commonly used in the copy/move constructors and copy/move assignment operators of the owner class to assign a member of OptFieldWithPresenceInd type. | |
Private Attributes | |
| std::optional< T > | m_field |
| the optional field | |
| std::reference_wrapper< bool > | m_presenceFlag |
| the Presence Indicator flag | |
OptFieldWithPresenceInd is a class modeling an optional field (in an Information Element, a management frame, etc.) having an associated Presence Indicator bit.
This class is a wrapper around std::optional (most of its functions are exposed, more can be added if needed) that additionally sets the Presence Indicator flag appropriately when operations like reset or assignment of a value are performed on the optional field.
Any class declaring a member of type OptFieldWithPresenceInd must provide a copy constructor and a copy assignment operator (and a move constructor and a move assignment operator, if needed) that correctly bind the Presence Indicator flag of the OptFieldWithPresenceInd member(s). The copy/move constructors and copy/move assignment operators of this class are deleted, so that the compiler will signal the need of adding copy/move constructors and/or copy/move assignment operators in the owner class.
Definition at line 35 of file wifi-opt-field.h.
| ns3::OptFieldWithPresenceInd< T >::OptFieldWithPresenceInd | ( | bool & | presenceFlag | ) |
constructor
| presenceFlag | the Presence Indicator flag |
Definition at line 120 of file wifi-opt-field.h.
References m_presenceFlag.
Referenced by OptFieldWithPresenceInd(), OptFieldWithPresenceInd(), operator bool(), operator=(), and operator=().
|
delete |
|
delete |
|
constexpr |
Construct the contained value in-place.
| Args | the type of arguments to pass to the constructor |
| args | the arguments to pass to the constructor |
Definition at line 208 of file wifi-opt-field.h.
References m_field, and m_presenceFlag.
|
constexpr |
Check whether this object contains a value.
Definition at line 165 of file wifi-opt-field.h.
References m_field.
|
explicitconstexpr |
Operator bool.
Definition at line 156 of file wifi-opt-field.h.
References OptFieldWithPresenceInd(), and m_field.
|
constexpr |
Definition at line 200 of file wifi-opt-field.h.
References m_field.
|
constexpr |
Definition at line 193 of file wifi-opt-field.h.
References m_field.
|
constexpr |
Definition at line 186 of file wifi-opt-field.h.
|
constexpr |
Definition at line 179 of file wifi-opt-field.h.
|
delete |
|
constexpr |
Assign the given value to the optional field.
| other | the given value |
Definition at line 137 of file wifi-opt-field.h.
References m_field, and m_presenceFlag.
|
delete |
|
constexpr |
Destroy the value (if any) contained in the optional field.
Definition at line 128 of file wifi-opt-field.h.
References m_field, and m_presenceFlag.
|
constexpr |
Assign the given value to the optional field.
| other | the given value |
Definition at line 146 of file wifi-opt-field.h.
References m_field, and m_presenceFlag.
|
constexpr |
Destroy the value (if any) contained in the optional field.
Definition at line 217 of file wifi-opt-field.h.
References m_field, and m_presenceFlag.
|
constexpr |
This is a helper function commonly used in the copy/move constructors and copy/move assignment operators of the owner class to assign a member of OptFieldWithPresenceInd type.
Definition at line 172 of file wifi-opt-field.h.
References m_field.
Referenced by ns3::FilsDiscHeader::FilsDiscHeader(), and ns3::FilsDiscHeader::operator=().
|
private |
the optional field
Definition at line 106 of file wifi-opt-field.h.
Referenced by emplace(), has_value(), operator bool(), operator*(), operator*(), operator=(), operator=(), operator=(), reset(), and ToOptional().
|
private |
the Presence Indicator flag
Definition at line 107 of file wifi-opt-field.h.
Referenced by OptFieldWithPresenceInd(), emplace(), operator=(), operator=(), operator=(), and reset().