nfd::tools::nfdc::CsModule Class Reference

Provides access to NFD CS management. More...

#include <tools/nfdc/cs-module.hpp>

+ Inheritance diagram for nfd::tools::nfdc::CsModule:
+ Collaboration diagram for nfd::tools::nfdc::CsModule:

Public Member Functions

void fetchStatus (Controller &controller, const std::function< void()> &onSuccess, const Controller::DatasetFailCallback &onFailure, const CommandOptions &options) override
 Collect status from NFD. More...
 
void formatStatusText (std::ostream &os) const override
 Format collected status as text. More...
 
void formatStatusXml (std::ostream &os) const override
 Format collected status as XML. More...
 

Static Public Member Functions

static void config (ExecuteContext &ctx)
 The 'cs config' command. More...
 
static void erase (ExecuteContext &ctx)
 The 'cs erase' command. More...
 
static void formatItemText (std::ostream &os, const CsInfo &item)
 
static void formatItemXml (std::ostream &os, const CsInfo &item)
 
static void registerCommands (CommandParser &parser)
 Register 'cs config' command. More...
 

Detailed Description

Provides access to NFD CS management.

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

Definition at line 39 of file cs-module.hpp.

Member Function Documentation

◆ config()

void nfd::tools::nfdc::CsModule::config ( ExecuteContext ctx)
static

The 'cs config' command.

Definition at line 53 of file cs-module.cpp.

◆ erase()

void nfd::tools::nfdc::CsModule::erase ( ExecuteContext ctx)
static

The 'cs erase' command.

Definition at line 88 of file cs-module.cpp.

◆ fetchStatus()

void nfd::tools::nfdc::CsModule::fetchStatus ( Controller &  controller,
const std::function< void()> &  onSuccess,
const Controller::DatasetFailCallback &  onFailure,
const CommandOptions &  options 
)
overridevirtual

Collect status from NFD.

Precondition
no other fetchStatus is in progress
Parameters
controllera controller through which StatusDataset can be requested
onSuccessinvoked when status has been collected into this instance
onFailurepassed to controller.fetch
optionspassed to controller.fetch

Implements nfd::tools::nfdc::Module.

Definition at line 132 of file cs-module.cpp.

◆ formatItemText()

void nfd::tools::nfdc::CsModule::formatItemText ( std::ostream &  os,
const CsInfo &  item 
)
static

Definition at line 173 of file cs-module.cpp.

◆ formatItemXml()

void nfd::tools::nfdc::CsModule::formatItemXml ( std::ostream &  os,
const CsInfo &  item 
)
static

Definition at line 152 of file cs-module.cpp.

◆ formatStatusText()

void nfd::tools::nfdc::CsModule::formatStatusText ( std::ostream &  os) const
overridevirtual

Format collected status as text.

Precondition
fetchStatus has been successful
Parameters
osoutput stream

Implements nfd::tools::nfdc::Module.

Definition at line 165 of file cs-module.cpp.

◆ formatStatusXml()

void nfd::tools::nfdc::CsModule::formatStatusXml ( std::ostream &  os) const
overridevirtual

Format collected status as XML.

Precondition
fetchStatus has been successful
Parameters
osoutput stream

Implements nfd::tools::nfdc::Module.

Definition at line 146 of file cs-module.cpp.

◆ registerCommands()

void nfd::tools::nfdc::CsModule::registerCommands ( CommandParser parser)
static

Register 'cs config' command.

Definition at line 34 of file cs-module.cpp.