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

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

#include <record-container.hpp>

Inheritance diagram for ndn::detail::RecordContainer< T >:
Collaboration diagram for ndn::detail::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::detail::RecordContainer< T >

Container of PendingInterest, RegisteredPrefix, or InterestFilterRecord.

Template Parameters
Trecord type

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

Member Typedef Documentation

◆ Record

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

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

◆ Container

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

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

Member Function Documentation

◆ get()

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

Retrieve record by ID.

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

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

◆ put()

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

Insert a record with given ID.

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

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

◆ allocateId()

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

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

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

◆ insert()

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

Insert a record with newly assigned ID.

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

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

◆ erase()

template<typename T>
void ndn::detail::RecordContainer< T >::erase ( RecordId  id)
inline

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

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

◆ clear()

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

◆ removeIf()

template<typename T>
template<typename Visitor >
void ndn::detail::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 146 of file record-container.hpp.

Referenced by ndn::Face::Impl::nackPendingInterests(), and ndn::Face::Impl::satisfyPendingInterests().

◆ forEach()

template<typename T>
template<typename Visitor >
void ndn::detail::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 168 of file record-container.hpp.

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

◆ empty()

template<typename T>
NDN_CXX_NODISCARD bool ndn::detail::RecordContainer< T >::empty ( ) const
inlinenoexcept

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

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

◆ size()

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

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

Member Data Documentation

◆ onEmpty

template<typename T>
util::Signal<RecordContainer<T> > ndn::detail::RecordContainer< T >::onEmpty

Signals when container becomes empty.

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

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


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