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 (ndn::nfd::Controller &controller, const std::function< void()> &onSuccess, const ndn::nfd::DatasetFailureCallback &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 42 of file strategy-choice-module.hpp.

Member Function Documentation

◆ fetchStatus()

void nfd::tools::nfdc::StrategyChoiceModule::fetchStatus ( ndn::nfd::Controller &  controller,
const std::function< void()> &  onSuccess,
const ndn::nfd::DatasetFailureCallback &  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.

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

◆ list()

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

The 'strategy list' command.

Definition at line 63 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 34 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 101 of file strategy-choice-module.cpp.

◆ show()

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

The 'strategy show' command.

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

◆ unset()

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

The 'strategy unset' command.

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