nfd::tools::nfdc::StrategyChoiceModule Class Reference

Provides access to NFD Strategy Choice management. More...

#include <tools/nfdc/strategy-choice-module.hpp>

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

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 StrategyChoice &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 formatItemText (std::ostream &os, const StrategyChoice &item, bool wantMultiLine=false)
 Format a single status item as text. More...
 
static void list (ExecuteContext &ctx)
 The 'strategy list' command. More...
 
static void registerCommands (CommandParser &parser)
 Register 'strategy list', 'strategy show', 'strategy set', 'strategy unset' commands. More...
 
static void set (ExecuteContext &ctx)
 The 'strategy set' command. More...
 
static void show (ExecuteContext &ctx)
 The 'strategy show' command. More...
 
static void unset (ExecuteContext &ctx)
 The 'strategy unset' command. More...
 

Detailed Description

Provides access to NFD Strategy Choice management.

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

Definition at line 39 of file strategy-choice-module.hpp.

Member Function Documentation

◆ fetchStatus()

void nfd::tools::nfdc::StrategyChoiceModule::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 151 of file strategy-choice-module.cpp.

◆ formatItemText()

void nfd::tools::nfdc::StrategyChoiceModule::formatItemText ( std::ostream &  os,
const StrategyChoice &  item,
bool  wantMultiLine = false 
)
static

Format a single status item as text.

Parameters
osoutput stream
itemstatus item
wantMultiLineuse multi-line style

Definition at line 195 of file strategy-choice-module.cpp.

◆ formatItemXml()

void nfd::tools::nfdc::StrategyChoiceModule::formatItemXml ( std::ostream &  os,
const StrategyChoice &  item 
) const

Format a single status item as XML.

Parameters
osoutput stream
itemstatus item

Definition at line 175 of file strategy-choice-module.cpp.

◆ formatStatusText()

void nfd::tools::nfdc::StrategyChoiceModule::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 184 of file strategy-choice-module.cpp.

◆ formatStatusXml()

void nfd::tools::nfdc::StrategyChoiceModule::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 165 of file strategy-choice-module.cpp.

◆ list()

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

The 'strategy list' command.

Definition at line 61 of file strategy-choice-module.cpp.

◆ registerCommands()

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

Register 'strategy list', 'strategy show', 'strategy set', 'strategy unset' commands.

Definition at line 32 of file strategy-choice-module.cpp.

◆ set()

void nfd::tools::nfdc::StrategyChoiceModule::set ( ExecuteContext ctx)
static

The 'strategy set' command.

Todo:
#3887 list available strategies

Definition at line 99 of file strategy-choice-module.cpp.

◆ show()

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

The 'strategy show' command.

Definition at line 77 of file strategy-choice-module.cpp.

◆ unset()

void nfd::tools::nfdc::StrategyChoiceModule::unset ( ExecuteContext ctx)
static

The 'strategy unset' command.

Definition at line 127 of file strategy-choice-module.cpp.