nfd::tools::nfdc::FaceModule Class Reference

Provides access to NFD face management. More...

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

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

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 formatItemXml (std::ostream &os, const FaceStatus &item) const
 Format a single status item as XML. 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 create (ExecuteContext &ctx)
 The 'face create' command. More...
 
static void destroy (ExecuteContext &ctx)
 The 'face destroy' command. More...
 
static void formatItemText (std::ostream &os, const FaceStatus &item, bool wantMultiLine)
 Format a single status item as text. More...
 
static void list (ExecuteContext &ctx)
 The 'face list' command. More...
 
static void printFaceParams (std::ostream &os, text::ItemAttributes &ia, const ControlParameters &resp)
 Print face response parameters to specified ostream. More...
 
static void printSuccess (std::ostream &os, const std::string &actionSummary, const ControlParameters &resp)
 Print face action success message to specified ostream. More...
 
static void registerCommands (CommandParser &parser)
 Register 'face list', 'face show', 'face create', 'face destroy' commands. More...
 
static void show (ExecuteContext &ctx)
 The 'face show' command. More...
 

Detailed Description

Provides access to NFD face management.

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

Definition at line 40 of file face-module.hpp.

Member Function Documentation

◆ create()

void nfd::tools::nfdc::FaceModule::create ( ExecuteContext ctx)
static

The 'face create' command.

Definition at line 154 of file face-module.cpp.

◆ destroy()

void nfd::tools::nfdc::FaceModule::destroy ( ExecuteContext ctx)
static

The 'face destroy' command.

Definition at line 319 of file face-module.cpp.

◆ fetchStatus()

void nfd::tools::nfdc::FaceModule::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 364 of file face-module.cpp.

◆ formatItemText()

void nfd::tools::nfdc::FaceModule::formatItemText ( std::ostream &  os,
const FaceStatus &  item,
bool  wantMultiLine 
)
static

Format a single status item as text.

Parameters
osoutput stream
itemstatus item
wantMultiLineuse multi-line style

Definition at line 467 of file face-module.cpp.

◆ formatItemXml()

void nfd::tools::nfdc::FaceModule::formatItemXml ( std::ostream &  os,
const FaceStatus &  item 
) const

Format a single status item as XML.

Parameters
osoutput stream
itemstatus item

Definition at line 388 of file face-module.cpp.

◆ formatStatusText()

void nfd::tools::nfdc::FaceModule::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 456 of file face-module.cpp.

◆ formatStatusXml()

void nfd::tools::nfdc::FaceModule::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 378 of file face-module.cpp.

◆ list()

void nfd::tools::nfdc::FaceModule::list ( ExecuteContext ctx)
static

The 'face list' command.

Definition at line 72 of file face-module.cpp.

◆ printFaceParams()

void nfd::tools::nfdc::FaceModule::printFaceParams ( std::ostream &  os,
text::ItemAttributes ia,
const ControlParameters &  resp 
)
static

Print face response parameters to specified ostream.

Parameters
osoutput stream
iaItemAttributes used to format output
respresponse control parameters to print

Definition at line 542 of file face-module.cpp.

◆ printSuccess()

void nfd::tools::nfdc::FaceModule::printSuccess ( std::ostream &  os,
const std::string &  actionSummary,
const ControlParameters &  resp 
)
static

Print face action success message to specified ostream.

Parameters
osoutput stream
actionSummarydescription of action taken
respresponse control parameters to print

Definition at line 528 of file face-module.cpp.

◆ registerCommands()

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

Register 'face list', 'face show', 'face create', 'face destroy' commands.

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

◆ show()

void nfd::tools::nfdc::FaceModule::show ( ExecuteContext ctx)
static

The 'face show' command.

Definition at line 112 of file face-module.cpp.