nfd::rib::Service Class Reference

Initializes and executes the NFD-RIB service thread. More...

#include <daemon/rib/service.hpp>

+ Inheritance diagram for nfd::rib::Service:
+ Collaboration diagram for nfd::rib::Service:

Public Member Functions

 Service (const ConfigSection &configSection, ndn::KeyChain &keyChain)
 Create NFD-RIB service. More...
 
 Service (const std::string &configFile, ndn::KeyChain &keyChain)
 Create NFD-RIB service. More...
 
 ~Service ()
 
RibManagergetRibManager () noexcept
 

Static Public Member Functions

static Serviceget ()
 Get a reference to the only instance of this class. More...
 

Detailed Description

Initializes and executes the NFD-RIB service thread.

Only one instance of this class can be created at any time. After initialization, NFD-RIB instance can be started by running the global io_service.

Definition at line 51 of file service.hpp.

Constructor & Destructor Documentation

◆ Service() [1/2]

nfd::rib::Service::Service ( const std::string &  configFile,
ndn::KeyChain &  keyChain 
)

Create NFD-RIB service.

Parameters
configFileabsolute or relative path of configuration file
keyChainthe KeyChain
Exceptions
std::logic_errorInstance of rib::Service has been already constructed
std::logic_errorInstance of rib::Service is not constructed on RIB thread

Definition at line 88 of file service.cpp.

◆ Service() [2/2]

nfd::rib::Service::Service ( const ConfigSection configSection,
ndn::KeyChain &  keyChain 
)

Create NFD-RIB service.

Parameters
configSectionparsed configuration section
keyChainthe KeyChain
Note
This constructor overload is more appropriate for integrated environments, such as NS-3 or android. Error messages related to configuration file will use "internal://nfd.conf" as configuration filename.
Exceptions
std::logic_errorInstance of rib::Service has been already constructed
std::logic_errorInstance of rib::Service is not constructed on RIB thread

Definition at line 96 of file service.cpp.

◆ ~Service()

nfd::rib::Service::~Service ( )

Definition at line 133 of file service.cpp.

Member Function Documentation

◆ get()

Service & nfd::rib::Service::get ( )
static

Get a reference to the only instance of this class.

Exceptions
std::logic_errorNo instance has been constructed
std::logic_errorThis function is invoked on a thread other than the RIB thread

Definition at line 139 of file service.cpp.

◆ getRibManager()

RibManager& nfd::rib::Service::getRibManager ( )
inlinenoexcept

Definition at line 86 of file service.hpp.