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 41 of file strategy-choice-module.hpp.

Member Function Documentation

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 153 of file strategy-choice-module.cpp.

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 197 of file strategy-choice-module.cpp.

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 177 of file strategy-choice-module.cpp.

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 186 of file strategy-choice-module.cpp.

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 167 of file strategy-choice-module.cpp.

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

the 'strategy list' command

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

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

register 'strategy list', 'strategy show', 'strategy set', 'strategy unset' commands

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

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

the 'strategy set' command

Todo:
#3887 list available strategies

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

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

the 'strategy show' command

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

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

the 'strategy unset' command

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