ndn::nfd::Controller Class Reference

NFD Management protocol client. More...

#include <ndn-cxx/mgmt/nfd/controller.hpp>

+ Inheritance diagram for ndn::nfd::Controller:
+ Collaboration diagram for ndn::nfd::Controller:

Public Types

enum  : uint32_t {
  ERROR_LBOUND = 400 ,
  ERROR_SERVER = 500 ,
  ERROR_TIMEOUT = 10060 ,
  ERROR_NACK = 10800 ,
  ERROR_VALIDATION = 10021
}
 

Public Member Functions

 Controller (Face &face, KeyChain &keyChain, security::Validator &validator=security::getAcceptAllValidator())
 Construct a Controller that uses face as transport and keyChain to sign commands. More...
 
 ~Controller ()
 
template<typename Dataset >
std::enable_if_t< std::is_default_constructible_v< Dataset > > fetch (const DatasetSuccessCallback< Dataset > &onSuccess, const DatasetFailureCallback &onFailure, const CommandOptions &options={})
 Start dataset fetching. More...
 
template<typename Dataset , typename ParamType >
void fetch (ParamType &&param, const DatasetSuccessCallback< Dataset > &onSuccess, const DatasetFailureCallback &onFailure, const CommandOptions &options={})
 Start dataset fetching. More...
 
template<typename Command >
void start (const ControlParameters &parameters, const CommandSuccessCallback &onSuccess, const CommandFailureCallback &onFailure, const CommandOptions &options={})
 Start command execution. More...
 

Protected Attributes

Facem_face
 
std::set< shared_ptr< SegmentFetcher > > m_fetchers
 
KeyChainm_keyChain
 
security::InterestSigner m_signer
 
security::Validatorm_validator
 

Detailed Description

NFD Management protocol client.

See also
https://redmine.named-data.net/projects/nfd/wiki/Management

Definition at line 78 of file controller.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : uint32_t
Enumerator
ERROR_LBOUND 

Inclusive lower bound of error codes.

ERROR_SERVER 

Error code for server error.

ERROR_TIMEOUT 

Error code for timeout.

ERROR_NACK 

Error code for network Nack.

ERROR_VALIDATION 

Error code for response validation failure.

Definition at line 164 of file controller.hpp.

Constructor & Destructor Documentation

◆ Controller()

ndn::nfd::Controller::Controller ( Face face,
KeyChain keyChain,
security::Validator validator = security::getAcceptAllValidator() 
)

Construct a Controller that uses face as transport and keyChain to sign commands.

Definition at line 30 of file controller.cpp.

◆ ~Controller()

ndn::nfd::Controller::~Controller ( )

Definition at line 38 of file controller.cpp.

Member Function Documentation

◆ fetch() [1/2]

template<typename Dataset >
std::enable_if_t<std::is_default_constructible_v<Dataset> > ndn::nfd::Controller::fetch ( const DatasetSuccessCallback< Dataset > &  onSuccess,
const DatasetFailureCallback onFailure,
const CommandOptions options = {} 
)
inline

Start dataset fetching.

Definition at line 107 of file controller.hpp.

◆ fetch() [2/2]

template<typename Dataset , typename ParamType >
void ndn::nfd::Controller::fetch ( ParamType &&  param,
const DatasetSuccessCallback< Dataset > &  onSuccess,
const DatasetFailureCallback onFailure,
const CommandOptions options = {} 
)
inline

Start dataset fetching.

Definition at line 119 of file controller.hpp.

◆ start()

template<typename Command >
void ndn::nfd::Controller::start ( const ControlParameters parameters,
const CommandSuccessCallback onSuccess,
const CommandFailureCallback onFailure,
const CommandOptions options = {} 
)
inline

Start command execution.

Definition at line 94 of file controller.hpp.

Member Data Documentation

◆ m_face

Face& ndn::nfd::Controller::m_face
protected

Definition at line 178 of file controller.hpp.

◆ m_fetchers

std::set<shared_ptr<SegmentFetcher> > ndn::nfd::Controller::m_fetchers
protected

Definition at line 184 of file controller.hpp.

◆ m_keyChain

KeyChain& ndn::nfd::Controller::m_keyChain
protected

Definition at line 179 of file controller.hpp.

◆ m_signer

security::InterestSigner ndn::nfd::Controller::m_signer
protected

Definition at line 181 of file controller.hpp.

◆ m_validator

security::Validator& ndn::nfd::Controller::m_validator
protected

Definition at line 180 of file controller.hpp.