22 #ifndef NDN_CXX_MGMT_NFD_CONTROL_COMMAND_HPP
23 #define NDN_CXX_MGMT_NFD_CONTROL_COMMAND_HPP
43 using std::invalid_argument::invalid_argument;
78 ControlCommand(
const std::string& module,
const std::string& verb);
90 m_required[field] =
true;
99 m_optional[field] =
true;
111 std::vector<bool> m_required;
112 std::vector<bool> m_optional;
Represents an absolute name.
Represents a name component.
Represents an error in ControlParameters.
FieldValidator & required(ControlParameterField field)
Declare a required field.
FieldValidator & optional(ControlParameterField field)
Declare an optional field.
void validate(const ControlParameters ¶meters) const
Verify that all required fields are present, and all present fields are either required or optional.
Base class of NFD ControlCommand.
ControlCommand(const std::string &module, const std::string &verb)
Name getRequestName(const Name &commandPrefix, const ControlParameters ¶meters) const
Construct the Name for a request Interest.
virtual void validateResponse(const ControlParameters ¶meters) const
Validate response parameters.
virtual void applyDefaultsToRequest(ControlParameters ¶meters) const
Apply default values to missing fields in request.
virtual void validateRequest(const ControlParameters ¶meters) const
Validate request parameters.
virtual void applyDefaultsToResponse(ControlParameters ¶meters) const
Apply default values to missing fields in response.
FieldValidator m_responseValidator
FieldValidator for response ControlParameters.
FieldValidator m_requestValidator
FieldValidator for request ControlParameters.
virtual ~ControlCommand()
Represents parameters in a ControlCommand request or response.
Represents a cs/config command.
Represents a cs/erase command.
void validateResponse(const ControlParameters ¶meters) const override
Validate response parameters.
void validateRequest(const ControlParameters ¶meters) const override
Validate request parameters.
Represents a faces/create command.
void validateResponse(const ControlParameters ¶meters) const override
Validate response parameters.
void applyDefaultsToRequest(ControlParameters ¶meters) const override
Apply default values to missing fields in request.
Represents a faces/destroy command.
void validateRequest(const ControlParameters ¶meters) const override
Validate request parameters.
void validateResponse(const ControlParameters ¶meters) const override
Validate response parameters.
Represents a faces/update command.
void applyDefaultsToRequest(ControlParameters ¶meters) const override
Apply default values to missing fields in request.
void validateResponse(const ControlParameters ¶meters) const override
Represents a fib/add-nexthop command.
void applyDefaultsToRequest(ControlParameters ¶meters) const override
Apply default values to missing fields in request.
void validateResponse(const ControlParameters ¶meters) const override
Validate response parameters.
Represents a fib/remove-nexthop command.
void applyDefaultsToRequest(ControlParameters ¶meters) const override
Apply default values to missing fields in request.
void validateResponse(const ControlParameters ¶meters) const override
Validate response parameters.
FibRemoveNextHopCommand()
Represents a rib/register command.
void applyDefaultsToRequest(ControlParameters ¶meters) const override
Apply default values to missing fields in request.
void validateResponse(const ControlParameters ¶meters) const override
Validate response parameters.
Represents a rib/unregister command.
void validateResponse(const ControlParameters ¶meters) const override
Validate response parameters.
void applyDefaultsToRequest(ControlParameters ¶meters) const override
Apply default values to missing fields in request.
Represents a strategy-choice/set command.
StrategyChoiceSetCommand()
Represents a strategy-choice/set command.
void validateRequest(const ControlParameters ¶meters) const override
Validate request parameters.
StrategyChoiceUnsetCommand()
void validateResponse(const ControlParameters ¶meters) const override
Validate response parameters.