A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::InterferenceHelper::NiChanges Class Reference

Sorted-by-time list of NI changes for a single band. More...

#include "interference-helper.h"

Collaboration diagram for ns3::InterferenceHelper::NiChanges:

Classes

struct  TimeLess
 Comparator for heterogeneous lookup of entries by Time. More...

Public Types

using const_iterator = std::vector<value_type>::const_iterator
 const iterator type
using iterator = std::vector<value_type>::iterator
 iterator type
using size_type = std::size_t
 size type
using value_type = std::pair<Time, NiChange>
 (time, NI change) entry

Public Member Functions

value_type & at (size_type i)
 Bounds-checked access the i-th entry.
iterator begin ()
const_iterator begin () const
const_iterator cbegin () const
const_iterator cend () const
template<typename... Args>
iterator emplace (Args &&... args)
 Construct a value_type from args and insert it at its sorted position.
iterator end ()
const_iterator end () const
iterator erase (const_iterator first, const_iterator last)
 Erase the entries in the range [first, last).
iterator insert (const value_type &v)
 Sorted insert: the position is located via upper_bound, so entries with equal times keep their insertion order.
iterator insert (const_iterator hint, value_type value)
 Insert at a caller-provided position (typically the result of upper_bound(t)).
iterator lower_bound (const Time &t)
 Locate the first entry with time greater than or equal to t.
const_iterator lower_bound (const Time &t) const
 Locate the first entry with time greater than or equal to t.
value_type & operator[] (size_type i)
 Access the i-th entry.
size_type size () const
iterator upper_bound (const Time &t)
 Locate the first entry with time strictly greater than t.
const_iterator upper_bound (const Time &t) const
 Locate the first entry with time strictly greater than t.

Private Attributes

std::vector< value_type > m_data
 storage, kept in non-decreasing time order

Detailed Description

Sorted-by-time list of NI changes for a single band.

Entries are kept in non-decreasing time order and duplicate times are allowed. The backing std::vector amortises allocations across growth; insert/erase shift the tail, which is cheap because the steady-state size is small (a handful of in-flight events per band).

Definition at line 410 of file interference-helper.h.

Member Typedef Documentation

◆ const_iterator

using ns3::InterferenceHelper::NiChanges::const_iterator = std::vector<value_type>::const_iterator

const iterator type

Definition at line 415 of file interference-helper.h.

◆ iterator

iterator type

Definition at line 414 of file interference-helper.h.

◆ size_type

size type

Definition at line 416 of file interference-helper.h.

◆ value_type

(time, NI change) entry

Definition at line 413 of file interference-helper.h.

Member Function Documentation

◆ at()

value_type & ns3::InterferenceHelper::NiChanges::at ( size_type i)
inline

Bounds-checked access the i-th entry.

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

Definition at line 475 of file interference-helper.h.

References m_data.

◆ begin() [1/2]

iterator ns3::InterferenceHelper::NiChanges::begin ( )
inline
Returns
an iterator to the first entry

Definition at line 419 of file interference-helper.h.

References m_data.

Referenced by ns3::InterferenceHelper::CalculatePhyHeaderPer(), and ns3::InterferenceHelper::CalculatePhyHeaderSectionPsr().

Here is the caller graph for this function:

◆ begin() [2/2]

const_iterator ns3::InterferenceHelper::NiChanges::begin ( ) const
inline
Returns
a const iterator to the first entry

Definition at line 431 of file interference-helper.h.

References m_data.

◆ cbegin()

const_iterator ns3::InterferenceHelper::NiChanges::cbegin ( ) const
inline
Returns
a const iterator to the first entry

Definition at line 443 of file interference-helper.h.

References m_data.

Referenced by ns3::InterferenceHelper::CalculatePayloadPer().

Here is the caller graph for this function:

◆ cend()

const_iterator ns3::InterferenceHelper::NiChanges::cend ( ) const
inline
Returns
a const iterator one past the last entry

Definition at line 449 of file interference-helper.h.

References m_data.

Referenced by ns3::InterferenceHelper::CalculatePayloadPer().

Here is the caller graph for this function:

◆ emplace()

template<typename... Args>
iterator ns3::InterferenceHelper::NiChanges::emplace ( Args &&... args)
inline

Construct a value_type from args and insert it at its sorted position.

Template Parameters
Argstypes of the value_type constructor arguments
Parameters
argsthe value_type constructor arguments
Returns
iterator to the inserted entry

Definition at line 554 of file interference-helper.h.

References m_data, upper_bound(), and v.

Referenced by ns3::InterferenceHelper::CalculateNoiseInterferenceW().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [1/2]

iterator ns3::InterferenceHelper::NiChanges::end ( )
inline
Returns
an iterator one past the last entry

Definition at line 425 of file interference-helper.h.

References m_data.

Referenced by ns3::InterferenceHelper::CalculatePhyHeaderSectionPsr().

Here is the caller graph for this function:

◆ end() [2/2]

const_iterator ns3::InterferenceHelper::NiChanges::end ( ) const
inline
Returns
a const iterator one past the last entry

Definition at line 437 of file interference-helper.h.

References m_data.

◆ erase()

iterator ns3::InterferenceHelper::NiChanges::erase ( const_iterator first,
const_iterator last )
inline

Erase the entries in the range [first, last).

Parameters
firstthe first entry to erase
lastone past the last entry to erase
Returns
iterator to the entry following the last erased one

Definition at line 567 of file interference-helper.h.

References m_data.

◆ insert() [1/2]

iterator ns3::InterferenceHelper::NiChanges::insert ( const value_type & v)
inline

Sorted insert: the position is located via upper_bound, so entries with equal times keep their insertion order.

Parameters
vthe entry to insert
Returns
iterator to the inserted entry

Definition at line 540 of file interference-helper.h.

References m_data, upper_bound(), and v.

Here is the call graph for this function:

◆ insert() [2/2]

iterator ns3::InterferenceHelper::NiChanges::insert ( const_iterator hint,
value_type value )
inline

Insert at a caller-provided position (typically the result of upper_bound(t)).

May invalidate other iterators if the vector reallocates.

Parameters
hintthe position to insert at
valuethe entry to insert
Returns
iterator to the inserted entry

Definition at line 528 of file interference-helper.h.

References m_data.

Referenced by ns3::InterferenceHelper::CalculateNoiseInterferenceW().

Here is the caller graph for this function:

◆ lower_bound() [1/2]

iterator ns3::InterferenceHelper::NiChanges::lower_bound ( const Time & t)
inline

Locate the first entry with time greater than or equal to t.

Parameters
tthe time to search for
Returns
iterator to the first entry with time greater than or equal to t

Definition at line 505 of file interference-helper.h.

References m_data.

◆ lower_bound() [2/2]

const_iterator ns3::InterferenceHelper::NiChanges::lower_bound ( const Time & t) const
inline

Locate the first entry with time greater than or equal to t.

Parameters
tthe time to search for
Returns
const iterator to the first entry with time greater than or equal to t

Definition at line 515 of file interference-helper.h.

References m_data.

◆ operator[]()

value_type & ns3::InterferenceHelper::NiChanges::operator[] ( size_type i)
inline

Access the i-th entry.

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

Definition at line 465 of file interference-helper.h.

References m_data.

◆ size()

size_type ns3::InterferenceHelper::NiChanges::size ( ) const
inline
Returns
the number of entries

Definition at line 455 of file interference-helper.h.

References m_data.

◆ upper_bound() [1/2]

iterator ns3::InterferenceHelper::NiChanges::upper_bound ( const Time & t)
inline

Locate the first entry with time strictly greater than t.

Parameters
tthe time to search for
Returns
iterator to the first entry with time strictly greater than t

Definition at line 485 of file interference-helper.h.

References m_data.

Referenced by emplace(), and insert().

Here is the caller graph for this function:

◆ upper_bound() [2/2]

const_iterator ns3::InterferenceHelper::NiChanges::upper_bound ( const Time & t) const
inline

Locate the first entry with time strictly greater than t.

Parameters
tthe time to search for
Returns
const iterator to the first entry with time strictly greater than t

Definition at line 495 of file interference-helper.h.

References m_data.

Member Data Documentation

◆ m_data

std::vector<value_type> ns3::InterferenceHelper::NiChanges::m_data
private

storage, kept in non-decreasing time order

Definition at line 599 of file interference-helper.h.

Referenced by at(), begin(), begin(), cbegin(), cend(), emplace(), end(), end(), erase(), insert(), insert(), lower_bound(), lower_bound(), operator[](), size(), upper_bound(), and upper_bound().


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