A ControlResponseLite holds a status code, status text and other fields for a ControlResponse which is used, for example, in the response from sending a register prefix control command to a forwarder.
More...
#include <control-response-lite.hpp>
|
|
class | Tlv0_2WireFormatLite |
| |
A ControlResponseLite holds a status code, status text and other fields for a ControlResponse which is used, for example, in the response from sending a register prefix control command to a forwarder.
| ndn::ControlResponseLite::ControlResponseLite |
( |
struct ndn_NameComponent * |
nameComponents, |
|
|
size_t |
maxNameComponents, |
|
|
struct ndn_NameComponent * |
strategyNameComponents, |
|
|
size_t |
strategyMaxNameComponents |
|
) |
| |
Create a ControlResponseLite to use the pre-allocated nameComponents and strategyNameComponents for the ControlParameters, and with default field values.
- Parameters
-
| nameComponents | The pre-allocated array of ndn_NameComponent for the main name. Instead of an array of NameLite::Component, this is an array of the underlying ndn_NameComponent struct so that it doesn't run the default constructor unnecessarily. |
| maxNameComponents | The number of elements in the allocated nameComponents array. |
| strategyNameComponents | The pre-allocated array of ndn_NameComponent for the strategy name. Instead of an array of NameLite::Component, this is an array of the underlying ndn_NameComponent struct so that it doesn't run the default constructor unnecessarily. |
| strategyMaxNameComponents | The number of elements in the allocated strategyNameComponents array. |
Get the bodyAsControlParameters, if specified.
- Returns
- The bodyAsControlParameters. This is only meaningful if getHasName() is true.
| bool ndn::ControlResponseLite::getHasBodyAsControlParameters |
( |
| ) |
const |
|
inline |
Check if the bodyAsControlParameters is specified.
- Returns
- True if the bodyAsControlParameters is specified, false if not.
| ndn_Error ndn::ControlResponseLite::setBodyAsControlParameters |
( |
const ControlParametersLite & |
bodyAsControlParameters | ) |
|
|
inline |
Set the bodyAsControlParameters to have the values from the given control parameters.
This also calls setHasBodyAsControlParameters(true).
- Parameters
-
| bodyAsControlParameters | The control parameters to get values from. If the bodyAsControlParameters is not specified, call setBodyAsControlParameters(false). |
- Returns
- 0 for success, or an error code if there is not enough room in this object's name components array.
| void ndn::ControlResponseLite::setHasBodyAsControlParameters |
( |
bool |
hasBodyAsControlParameters | ) |
|
|
inline |
Set the flag for whether the bodyAsControlParameters is specified.
Note that setBodyAsControlParameters automatically calls setHasName(true).
- Parameters
-
| hasBodyAsControlParameters | True if the bodyAsControlParameters is specified, false if not. |
Set the status code.
- Parameters
-
| statusCode | The new status code, or -1 for not specified. |
- Returns
- This ControlResponseLite so that you can chain calls to update values.
Set status text.
- Parameters
-
| statusText | The new status text, or an empty string for not specified. |
- Returns
- This ControlResponseLite so that you can chain calls to update values.
The documentation for this class was generated from the following files: