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

Fixed-capacity inline vector holding the per-segment data of a WifiSpectrumBandInfo. More...

#include "wifi-phy-common.h"

Inheritance diagram for ns3::WifiBandSegments< T, N >:
Collaboration diagram for ns3::WifiBandSegments< T, N >:

Public Types

using const_iterator = typename std::array<T, N>::const_iterator
 const iterator type
using iterator = typename std::array<T, N>::iterator
 iterator type
using size_type = std::size_t
 size type
using value_type = T
 element type

Public Member Functions

 WifiBandSegments ()=default
 Default constructor (empty).
 WifiBandSegments (std::initializer_list< T > init)
 Initializer-list constructor so existing call sites can write.
T & at (size_type i)
 Access the i-th element.
const T & at (size_type i) const
 Access the i-th element.
T & back ()
const T & back () const
iterator begin ()
const_iterator begin () const
const_iterator cbegin () const
const_iterator cend () const
template<typename... Args>
void emplace_back (Args &&... args)
 Append a new element constructed in-place.
bool empty () const
iterator end ()
const_iterator end () const
T & front ()
const T & front () const
bool operator== (const WifiBandSegments &other) const
 Equality compares size and elements element-wise.
size_type size () const

Private Attributes

std::array< T, N > m_data {}
 inline storage
std::uint8_t m_size {0}
 number of elements currently held

Detailed Description

template<typename T, std::size_t N>
class ns3::WifiBandSegments< T, N >

Fixed-capacity inline vector holding the per-segment data of a WifiSpectrumBandInfo.

A band has at most a small known number of segments (a single contiguous range in the common case, two for 80+80 split RUs), so inline storage covers every case without heap allocations and keeps band copies cheap.

Template Parameters
Telement type
Nmaximum number of elements

Definition at line 69 of file wifi-phy-common.h.

Member Typedef Documentation

◆ const_iterator

template<typename T, std::size_t N>
using ns3::WifiBandSegments< T, N >::const_iterator = typename std::array<T, N>::const_iterator

const iterator type

Definition at line 75 of file wifi-phy-common.h.

◆ iterator

template<typename T, std::size_t N>
using ns3::WifiBandSegments< T, N >::iterator = typename std::array<T, N>::iterator

iterator type

Definition at line 74 of file wifi-phy-common.h.

◆ size_type

template<typename T, std::size_t N>
using ns3::WifiBandSegments< T, N >::size_type = std::size_t

size type

Definition at line 73 of file wifi-phy-common.h.

◆ value_type

template<typename T, std::size_t N>
using ns3::WifiBandSegments< T, N >::value_type = T

element type

Definition at line 72 of file wifi-phy-common.h.

Constructor & Destructor Documentation

◆ WifiBandSegments() [1/2]

template<typename T, std::size_t N>
ns3::WifiBandSegments< T, N >::WifiBandSegments ( )
default

Default constructor (empty).

Referenced by operator==().

Here is the caller graph for this function:

◆ WifiBandSegments() [2/2]

template<typename T, std::size_t N>
ns3::WifiBandSegments< T, N >::WifiBandSegments ( std::initializer_list< T > init)
inline

Initializer-list constructor so existing call sites can write.

WifiBandSegments()=default
Default constructor (empty).

.

Parameters
initthe elements to copy in

Definition at line 85 of file wifi-phy-common.h.

References m_data, m_size, NS_ASSERT, and v.

Member Function Documentation

◆ at() [1/2]

template<typename T, std::size_t N>
T & ns3::WifiBandSegments< T, N >::at ( size_type i)
inline

Access the i-th element.

Parameters
ithe index of the element
Returns
reference to the i-th element

Definition at line 111 of file wifi-phy-common.h.

References m_data.

Referenced by ns3::operator<<().

Here is the caller graph for this function:

◆ at() [2/2]

template<typename T, std::size_t N>
const T & ns3::WifiBandSegments< T, N >::at ( size_type i) const
inline

Access the i-th element.

Parameters
ithe index of the element
Returns
const reference to the i-th element

Definition at line 121 of file wifi-phy-common.h.

References m_data.

◆ back() [1/2]

template<typename T, std::size_t N>
T & ns3::WifiBandSegments< T, N >::back ( )
inline
Returns
reference to the last element

Definition at line 139 of file wifi-phy-common.h.

References m_data, and m_size.

Referenced by ns3::operator<().

Here is the caller graph for this function:

◆ back() [2/2]

template<typename T, std::size_t N>
const T & ns3::WifiBandSegments< T, N >::back ( ) const
inline
Returns
const reference to the last element

Definition at line 145 of file wifi-phy-common.h.

References m_data, and m_size.

◆ begin() [1/2]

template<typename T, std::size_t N>
iterator ns3::WifiBandSegments< T, N >::begin ( )
inline
Returns
iterator to the first element

Definition at line 162 of file wifi-phy-common.h.

References m_data.

◆ begin() [2/2]

template<typename T, std::size_t N>
const_iterator ns3::WifiBandSegments< T, N >::begin ( ) const
inline
Returns
const_iterator to the first element

Definition at line 174 of file wifi-phy-common.h.

References m_data.

◆ cbegin()

template<typename T, std::size_t N>
const_iterator ns3::WifiBandSegments< T, N >::cbegin ( ) const
inline
Returns
const_iterator to the first element

Definition at line 186 of file wifi-phy-common.h.

References m_data.

Referenced by ns3::InterferenceHelper::IsBandInFrequencyRange(), and operator==().

Here is the caller graph for this function:

◆ cend()

template<typename T, std::size_t N>
const_iterator ns3::WifiBandSegments< T, N >::cend ( ) const
inline
Returns
const_iterator one past the last element

Definition at line 192 of file wifi-phy-common.h.

References m_data, and m_size.

Referenced by ns3::InterferenceHelper::IsBandInFrequencyRange(), and operator==().

Here is the caller graph for this function:

◆ emplace_back()

template<typename T, std::size_t N>
template<typename... Args>
void ns3::WifiBandSegments< T, N >::emplace_back ( Args &&... args)
inline

Append a new element constructed in-place.

Parameters
argsconstructor arguments

Definition at line 155 of file wifi-phy-common.h.

References m_data, m_size, and NS_ASSERT.

Referenced by ns3::SpectrumWifiPhy::GetBandForInterface().

Here is the caller graph for this function:

◆ empty()

template<typename T, std::size_t N>
bool ns3::WifiBandSegments< T, N >::empty ( ) const
inline
Returns
true if no elements are held

Definition at line 101 of file wifi-phy-common.h.

References m_size.

◆ end() [1/2]

template<typename T, std::size_t N>
iterator ns3::WifiBandSegments< T, N >::end ( )
inline
Returns
iterator one past the last element

Definition at line 168 of file wifi-phy-common.h.

References m_data, and m_size.

◆ end() [2/2]

template<typename T, std::size_t N>
const_iterator ns3::WifiBandSegments< T, N >::end ( ) const
inline
Returns
const_iterator one past the last element

Definition at line 180 of file wifi-phy-common.h.

References m_data, and m_size.

◆ front() [1/2]

template<typename T, std::size_t N>
T & ns3::WifiBandSegments< T, N >::front ( )
inline
Returns
reference to the first element

Definition at line 127 of file wifi-phy-common.h.

References m_data.

Referenced by ns3::operator<().

Here is the caller graph for this function:

◆ front() [2/2]

template<typename T, std::size_t N>
const T & ns3::WifiBandSegments< T, N >::front ( ) const
inline
Returns
const reference to the first element

Definition at line 133 of file wifi-phy-common.h.

References m_data.

◆ operator==()

template<typename T, std::size_t N>
bool ns3::WifiBandSegments< T, N >::operator== ( const WifiBandSegments< T, N > & other) const
inline

Equality compares size and elements element-wise.

Parameters
otherthe other vector to compare against
Returns
true if the two vectors have the same content

Definition at line 202 of file wifi-phy-common.h.

References WifiBandSegments(), cbegin(), cend(), and m_size.

Here is the call graph for this function:

◆ size()

template<typename T, std::size_t N>
size_type ns3::WifiBandSegments< T, N >::size ( ) const
inline
Returns
number of elements currently held

Definition at line 95 of file wifi-phy-common.h.

References m_size.

Referenced by ns3::operator<<().

Here is the caller graph for this function:

Member Data Documentation

◆ m_data

template<typename T, std::size_t N>
std::array<T, N> ns3::WifiBandSegments< T, N >::m_data {}
private

inline storage

Definition at line 208 of file wifi-phy-common.h.

Referenced by WifiBandSegments(), at(), at(), back(), back(), begin(), begin(), cbegin(), cend(), emplace_back(), end(), end(), front(), and front().

◆ m_size

template<typename T, std::size_t N>
std::uint8_t ns3::WifiBandSegments< T, N >::m_size {0}
private

number of elements currently held

Definition at line 209 of file wifi-phy-common.h.

Referenced by WifiBandSegments(), back(), back(), cend(), emplace_back(), empty(), end(), end(), operator==(), and size().


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