A ControlResponse 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.hpp>
Public Member Functions | |
ControlResponse () | |
Create a new ControlResponse where all values are unspecified. | |
ControlResponse (const ControlResponse &controlResponse) | |
Create a new ControlResponse as a deep copy of the given ControlResponse. More... | |
Blob | wireEncode (WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) const |
Encode this ControlResponse for a particular wire format. More... | |
void | wireDecode (const uint8_t *input, size_t inputLength, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
Decode the input using a particular wire format and update this ControlResponse. More... | |
void | wireDecode (const std::vector< uint8_t > &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
Decode the input using a particular wire format and update this ControlResponse. More... | |
void | wireDecode (const Blob &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
Decode the input using a particular wire format and update this ControlResponse. More... | |
void | get (ControlResponseLite &controlResponseLite) const |
Set controlResponseLite to point to the components in this ControlResponse, without copying any memory. More... | |
void | set (const ControlResponseLite &controlResponseLite) |
Clear this ControlResponse, and set the values by copying from controlResponseLite. More... | |
int | getStatusCode () const |
Get the status code. More... | |
const std::string & | getStatusText () const |
Get the status text. More... | |
const ControlParameters * | getBodyAsControlParameters () const |
Get the control response body as a ControlParameters. More... | |
ControlResponse & | setStatusCode (int statusCode) |
Set the status code. More... | |
ControlResponse & | setStatusText (const std::string &statusText) |
Set the status text. More... | |
ControlResponse & | setBodyAsControlParameters (const ControlParameters *controlParameters) |
Set the control response body as a ControlParameters. More... | |
A ControlResponse 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.
|
inline |
Create a new ControlResponse as a deep copy of the given ControlResponse.
controlResponse | The ControlResponse to copy. |
void ndn::ControlResponse::get | ( | ControlResponseLite & | controlResponseLite | ) | const |
Set controlResponseLite to point to the components in this ControlResponse, without copying any memory.
WARNING: The resulting pointers in controlResponseLite are invalid after a further use of this object which could reallocate memory.
controlResponseLite | The ControlResponseLite object which receives the values. where the name components arrays are already allocated. |
|
inline |
Get the control response body as a ControlParameters.
|
inline |
Get the status code.
|
inline |
Get the status text.
void ndn::ControlResponse::set | ( | const ControlResponseLite & | controlResponseLite | ) |
Clear this ControlResponse, and set the values by copying from controlResponseLite.
controlResponseLite | A ControlResponseLite object. |
|
inline |
Set the control response body as a ControlParameters.
controlParameters | A pointer to the ControlParameters for the body. This makes a copy of the ControlParameters. If not specified or if the body is not a ControlParameters, set to 0. |
|
inline |
Set the status code.
statusCode | The status code. If not specified, set to -1. |
|
inline |
Set the status text.
statusText | The status text. If not specified, set to "". |
|
inline |
Decode the input using a particular wire format and update this ControlResponse.
input | The input byte array to be decoded. |
inputLength | The length of input. |
wireFormat | (optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat(). |
|
inline |
Decode the input using a particular wire format and update this ControlResponse.
input | The input byte array to be decoded. |
wireFormat | (optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat(). |
|
inline |
Decode the input using a particular wire format and update this ControlResponse.
input | The input byte array to be decoded as an immutable Blob. |
wireFormat | (optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat(). |
|
inline |
Encode this ControlResponse for a particular wire format.
wireFormat | (optional) A WireFormat object used to encode this ControlResponse. If omitted, use WireFormat::getDefaultWireFormat(). |