ndn-cxx 0.9.0-43-g1d07fe6a
Loading...
Searching...
No Matches
ndn::nfd::ControlParametersCommandFormat Class Reference

Implements decoding, encoding, and validation of ControlParameters in control commands. More...

#include <ndn-cxx/mgmt/nfd/control-command.hpp>

Public Types

using ParametersType = ControlParameters
 

Public Member Functions

ControlParametersCommandFormat & optional (ControlParameterField field)
 Declare an optional field.
 
ControlParametersCommandFormat & required (ControlParameterField field)
 Declare a required field.
 
void validate (const ControlParameters &params) const
 Verify that all required fields are present, and all present fields are either required or optional.
 

Static Public Member Functions

static shared_ptr< ControlParameters > decode (const Interest &interest, size_t prefixLen)
 Extract the parameters from the request interest.
 
static void encode (Interest &interest, const ControlParameters &params)
 Serialize the parameters into the request interest.
 

Detailed Description

Implements decoding, encoding, and validation of ControlParameters in control commands.

According to this format, the request parameters are encoded as a single GenericNameComponent in the Interest name, immediately after the command module and command verb components.

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

Definition at line 53 of file control-command.hpp.

Member Typedef Documentation

◆ ParametersType

Member Function Documentation

◆ decode()

shared_ptr< ControlParameters > ndn::nfd::ControlParametersCommandFormat::decode ( const Interest &  interest,
size_t  prefixLen 
)
static

Extract the parameters from the request interest.

Definition at line 53 of file control-command.cpp.

◆ encode()

void ndn::nfd::ControlParametersCommandFormat::encode ( Interest &  interest,
const ControlParameters &  params 
)
static

Serialize the parameters into the request interest.

Precondition
params are valid.

Definition at line 60 of file control-command.cpp.

◆ optional()

ControlParametersCommandFormat & ndn::nfd::ControlParametersCommandFormat::optional ( ControlParameterField  field)
inline

Declare an optional field.

Definition at line 72 of file control-command.hpp.

◆ required()

ControlParametersCommandFormat & ndn::nfd::ControlParametersCommandFormat::required ( ControlParameterField  field)
inline

Declare a required field.

Definition at line 62 of file control-command.hpp.

◆ validate()

void ndn::nfd::ControlParametersCommandFormat::validate ( const ControlParameters &  params) const

Verify that all required fields are present, and all present fields are either required or optional.

Exceptions
ArgumentErrorParameters validation failed.

Definition at line 27 of file control-command.cpp.