NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::RecordContainer< T > Class Template Reference

Container of PendingInterest, RegisteredPrefix, or InterestFilterRecord. More...

#include <record-container.hpp>

Inheritance diagram for ndn::RecordContainer< T >:
Collaboration diagram for ndn::RecordContainer< T >:

Public Types

using Record = T
 
using Container = std::map< RecordId, Record >
 

Public Member Functions

Recordget (RecordId id)
 Retrieve record by ID. More...
 
template<typename ... TArgs>
Recordput (RecordId id, TArgs &&... args)
 Insert a record with given ID. More...
 
RecordId allocateId ()
 
template<typename ... TArgs>
Recordinsert (TArgs &&... args)
 Insert a record with newly assigned ID. More...
 
void erase (RecordId id)
 
void clear ()
 
template<typename Visitor >
void removeIf (const Visitor &f)
 Visit all records with the option to erase. More...
 
template<typename Visitor >
void forEach (const Visitor &f)
 Visit all records. More...
 
NDN_CXX_NODISCARD bool empty () const noexcept
 
size_t size () const noexcept
 

Public Attributes

util::Signal< RecordContainer< T > > onEmpty
 Signals when container becomes empty. More...
 

Detailed Description

template<typename T>
class ndn::RecordContainer< T >

Container of PendingInterest, RegisteredPrefix, or InterestFilterRecord.

Template Parameters
Trecord type

Definition at line 35 of file record-container.hpp.

Member Typedef Documentation

◆ Record

template<typename T >
using ndn::RecordContainer< T >::Record = T

Definition at line 76 of file record-container.hpp.

◆ Container

template<typename T >
using ndn::RecordContainer< T >::Container = std::map<RecordId, Record>

Definition at line 77 of file record-container.hpp.

Member Function Documentation

◆ get()

template<typename T >
Record* ndn::RecordContainer< T >::get ( RecordId  id)
inline

Retrieve record by ID.

Definition at line 82 of file record-container.hpp.

Referenced by ndn::Face::Impl::asyncUnregisterPrefix(), and ndn::Face::Impl::asyncUnsetInterestFilter().

◆ put()

template<typename T >
template<typename ... TArgs>
Record& ndn::RecordContainer< T >::put ( RecordId  id,
TArgs &&...  args 
)
inline

◆ allocateId()

template<typename T >
RecordId ndn::RecordContainer< T >::allocateId ( )
inline

◆ insert()

template<typename T >
template<typename ... TArgs>
Record& ndn::RecordContainer< T >::insert ( TArgs &&...  args)
inline

Insert a record with newly assigned ID.

Definition at line 118 of file record-container.hpp.

Referenced by ndn::Face::Impl::processIncomingInterest(), and ndn::Face::Impl::registerPrefix().

◆ erase()

◆ clear()

template<typename T >
void ndn::RecordContainer< T >::clear ( )
inline

◆ removeIf()

template<typename T >
template<typename Visitor >
void ndn::RecordContainer< T >::removeIf ( const Visitor &  f)
inline

Visit all records with the option to erase.

Template Parameters
Visitorfunction of type 'bool f(Record& record)'
Parameters
fvisitor function, return true to erase record

Definition at line 145 of file record-container.hpp.

Referenced by ndn::RecordContainer< PendingInterest >::forEach(), ndn::Face::Impl::nackPendingInterests(), and ndn::Face::Impl::satisfyPendingInterests().

◆ forEach()

template<typename T >
template<typename Visitor >
void ndn::RecordContainer< T >::forEach ( const Visitor &  f)
inline

Visit all records.

Template Parameters
Visitorfunction of type 'void f(Record& record)'
Parameters
fvisitor function

Definition at line 167 of file record-container.hpp.

Referenced by ndn::Face::Impl::dispatchInterest().

◆ empty()

◆ size()

template<typename T >
size_t ndn::RecordContainer< T >::size ( ) const
inlinenoexcept

Definition at line 182 of file record-container.hpp.

Member Data Documentation

◆ onEmpty


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