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

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

Static Public Member Functions

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

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.