Open Lighting Architecture
0.9.3
|
A RpcController object is passed every time an RPC is invoked and is used to indicate the success or failure of the RPC.
On the client side, the controller can is used once the callback completes to check the outcome of the RPC with Failed(). If the RPC failed, a description of the error is available by calling ErrorText().
On the server side, the server can fail the RPC by calling SetFailed(...).
Public Member Functions | |
RpcController (RpcSession *session=NULL) | |
Create a new RpcController. | |
void | Reset () |
Reset the state of this controller. Does not affect the session. | |
bool | Failed () const |
Check if the RPC call this controller was associated with failed. | |
std::string | ErrorText () const |
Return the error string if the RPC failed. | |
void | SetFailed (const std::string &reason) |
Mark this RPC as failed. | |
RpcSession * | Session () |
Get the session infomation for this RPC. |
|
explicit |
Create a new RpcController.
session | the RpcSession to use. Ownership is not transferred. |
|
inline |
Return the error string if the RPC failed.
|
inline |
Check if the RPC call this controller was associated with failed.
RpcSession * ola::rpc::RpcController::Session | ( | ) |
Get the session infomation for this RPC.
Unless specfically provided, the session be NULL on the client side.
void ola::rpc::RpcController::SetFailed | ( | const std::string & | reason | ) |
Mark this RPC as failed.
reason | the string to return in ErrorText(). |