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 | |
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 |
constexpr OptFieldWithPresenceInd & | operator= (const std::optional< T > &other) |
Assign the given value to the optional field. | |
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. | |
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.
Definition at line 28 of file wifi-opt-field.h.
ns3::OptFieldWithPresenceInd< T >::OptFieldWithPresenceInd | ( | bool & | presenceFlag | ) |
constructor
presenceFlag | the Presence Indicator flag |
Definition at line 94 of file wifi-opt-field.h.
References ns3::OptFieldWithPresenceInd< T >::m_presenceFlag.
|
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 171 of file wifi-opt-field.h.
|
constexpr |
Check whether this object contains a value.
Definition at line 135 of file wifi-opt-field.h.
Referenced by ns3::FilsDiscHeader::GetInformationFieldSize(), ns3::OptFieldWithPresenceInd< T >::operator bool(), ns3::OptFieldWithPresenceInd< T >::operator=(), ns3::FilsDiscHeader::Print(), and ns3::FilsDiscHeader::Serialize().
|
explicitconstexpr |
Operator bool.
Definition at line 128 of file wifi-opt-field.h.
References ns3::OptFieldWithPresenceInd< T >::has_value().
|
constexpr |
Definition at line 163 of file wifi-opt-field.h.
|
constexpr |
Definition at line 156 of file wifi-opt-field.h.
|
constexpr |
Definition at line 149 of file wifi-opt-field.h.
|
constexpr |
Definition at line 142 of file wifi-opt-field.h.
|
constexpr |
Assign the given value to the optional field.
other | the given value |
Definition at line 111 of file wifi-opt-field.h.
References ns3::OptFieldWithPresenceInd< T >::has_value().
|
constexpr |
Destroy the value (if any) contained in the optional field.
Definition at line 102 of file wifi-opt-field.h.
References ns3::OptFieldWithPresenceInd< T >::reset().
|
constexpr |
Assign the given value to the optional field.
other | the given value |
Definition at line 120 of file wifi-opt-field.h.
|
constexpr |
Destroy the value (if any) contained in the optional field.
Definition at line 180 of file wifi-opt-field.h.
Referenced by ns3::OptFieldWithPresenceInd< T >::operator=(), and ns3::FilsDiscHeader::SetLengthSubfield().
|
private |
the optional field
Definition at line 80 of file wifi-opt-field.h.
|
private |
the Presence Indicator flag
Definition at line 81 of file wifi-opt-field.h.
Referenced by ns3::OptFieldWithPresenceInd< T >::OptFieldWithPresenceInd().