A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::OptFieldWithPresenceInd< T > Class Template Reference

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"

+ Inheritance diagram for ns3::OptFieldWithPresenceInd< T >:
+ Collaboration diagram for ns3::OptFieldWithPresenceInd< T >:

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 OptFieldWithPresenceIndoperator= (const std::optional< T > &other)
 Assign the given value to the optional field.
 
constexpr OptFieldWithPresenceIndoperator= (std::nullopt_t)
 Destroy the value (if any) contained in the optional field.
 
constexpr OptFieldWithPresenceIndoperator= (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
 

Detailed Description

template<typename T>
class ns3::OptFieldWithPresenceInd< T >

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 39 of file wifi-opt-field.h.

Constructor & Destructor Documentation

◆ OptFieldWithPresenceInd()

template<typename T >
ns3::OptFieldWithPresenceInd< T >::OptFieldWithPresenceInd ( bool &  presenceFlag)

constructor

Parameters
presenceFlagthe Presence Indicator flag

Definition at line 105 of file wifi-opt-field.h.

References ns3::OptFieldWithPresenceInd< T >::m_presenceFlag.

Member Function Documentation

◆ emplace()

template<typename T >
template<class... Args>
constexpr T & ns3::OptFieldWithPresenceInd< T >::emplace ( Args &&...  args)
constexpr

Construct the contained value in-place.

Template Parameters
Argsthe type of arguments to pass to the constructor
Parameters
argsthe arguments to pass to the constructor
Returns
a reference to the new contained value

Definition at line 182 of file wifi-opt-field.h.

◆ has_value()

template<typename T >
constexpr bool ns3::OptFieldWithPresenceInd< T >::has_value
constexpr

Check whether this object contains a value.

Returns
whether this object contains a value

Definition at line 146 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().

+ Here is the caller graph for this function:

◆ operator bool()

template<typename T >
constexpr ns3::OptFieldWithPresenceInd< T >::operator bool
explicitconstexpr

Operator bool.

Returns
whether this object contains a value

Definition at line 139 of file wifi-opt-field.h.

References ns3::OptFieldWithPresenceInd< T >::has_value().

+ Here is the call graph for this function:

◆ operator*() [1/2]

template<typename T >
constexpr T & ns3::OptFieldWithPresenceInd< T >::operator*
constexpr
Returns
a reference to the contained value

Definition at line 174 of file wifi-opt-field.h.

◆ operator*() [2/2]

template<typename T >
constexpr const T & ns3::OptFieldWithPresenceInd< T >::operator*
constexpr
Returns
a reference to the contained value

Definition at line 167 of file wifi-opt-field.h.

◆ operator->() [1/2]

template<typename T >
constexpr T * ns3::OptFieldWithPresenceInd< T >::operator->
constexpr
Returns
a pointer to the contained value

Definition at line 160 of file wifi-opt-field.h.

◆ operator->() [2/2]

template<typename T >
constexpr const T * ns3::OptFieldWithPresenceInd< T >::operator->
constexpr
Returns
a pointer to the contained value

Definition at line 153 of file wifi-opt-field.h.

◆ operator=() [1/3]

template<typename T >
constexpr OptFieldWithPresenceInd< T > & ns3::OptFieldWithPresenceInd< T >::operator= ( const std::optional< T > &  other)
constexpr

Assign the given value to the optional field.

Parameters
otherthe given value
Returns
a reference to this object

Definition at line 122 of file wifi-opt-field.h.

References ns3::OptFieldWithPresenceInd< T >::has_value().

+ Here is the call graph for this function:

◆ operator=() [2/3]

template<typename T >
constexpr OptFieldWithPresenceInd< T > & ns3::OptFieldWithPresenceInd< T >::operator= ( std::nullopt_t  )
constexpr

Destroy the value (if any) contained in the optional field.

Returns
a reference to this object

Definition at line 113 of file wifi-opt-field.h.

References ns3::OptFieldWithPresenceInd< T >::reset().

+ Here is the call graph for this function:

◆ operator=() [3/3]

template<typename T >
constexpr OptFieldWithPresenceInd< T > & ns3::OptFieldWithPresenceInd< T >::operator= ( std::optional< T > &&  other)
constexpr

Assign the given value to the optional field.

Parameters
otherthe given value
Returns
a reference to this object

Definition at line 131 of file wifi-opt-field.h.

◆ reset()

template<typename T >
constexpr void ns3::OptFieldWithPresenceInd< T >::reset
constexpr

Destroy the value (if any) contained in the optional field.

Definition at line 191 of file wifi-opt-field.h.

Referenced by ns3::OptFieldWithPresenceInd< T >::operator=(), and ns3::FilsDiscHeader::SetLengthSubfield().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_field

template<typename T >
std::optional<T> ns3::OptFieldWithPresenceInd< T >::m_field
private

the optional field

Definition at line 91 of file wifi-opt-field.h.

◆ m_presenceFlag

template<typename T >
std::reference_wrapper<bool> ns3::OptFieldWithPresenceInd< T >::m_presenceFlag
private

the Presence Indicator flag

Definition at line 92 of file wifi-opt-field.h.

Referenced by ns3::OptFieldWithPresenceInd< T >::OptFieldWithPresenceInd().


The documentation for this class was generated from the following file: