REC RPC library
|
#include "rec/rpc/defines.h"
#include "rec/rpc/rec_rpc_common.h"
#include "rec/rpc/rec_rpc_ClientInfo.h"
Go to the source code of this file.
Classes | |
struct | rec::rpc::NotifierBase |
RPC response notifier wrapper interface. More... | |
class | rec::rpc::Client |
RPC client base class. More... | |
Namespaces | |
rec | |
rec::rpc | |
Macros | |
#define | DECLARE_NOTIFIER(FUNCTIONNAME) |
Declare a RPC response notifier in the client class definition. More... | |
#define | BEGIN_NOTIFIER(CLASSNAME, FUNCTIONNAME) |
Begin the implementation of a RPC response notifier. More... | |
#define | END_NOTIFIER } |
End of a notifier implementation. More... | |
#define | REGISTER_NOTIFIER(FUNCTIONNAME) registerNotifier( #FUNCTIONNAME, create##FUNCTIONNAME##Notifier() ); |
Register a RPC response notifier. More... | |
#define | UNREGISTER_NOTIFIER(FUNCTIONNAME) unregisterNotifier( #FUNCTIONNAME ); |
Unregister a RPC response notifier. More... | |
#define | IS_NOTIFIER_REGISTERED(FUNCTIONNAME) isNotifierRegistered( #FUNCTIONNAME ); |
Check if a RPC response notifier for a given function name is registered. More... | |
#define | PREPARE(FUNCTIONNAME) |
#define | INVOKE(BLOCKING) invoke( funcName, paramPtr, resultPtr, BLOCKING ); |
#define | INVOKE_SIMPLE(FUNCTIONNAME, PARAM, BLOCKING) |
#define | INVOKE_SIMPLE_EMPTY(FUNCTIONNAME, BLOCKING) |
#define BEGIN_NOTIFIER | ( | CLASSNAME, | |
FUNCTIONNAME | |||
) |
Begin the implementation of a RPC response notifier.
Place this macro above the implementation of a notifier. The RPC function can be accessed via "result". The type of "result" is 'FUNCTIONNAME'Result. This type name must be defined and derived from Serializable. The error code is accessible via "errorCode".
CLASSNAME | Name of your client class. |
FUNCTIONNAME | Name of the RPC function (without qoutes). |
Definition at line 491 of file rec_rpc_Client.h.
#define DECLARE_NOTIFIER | ( | FUNCTIONNAME | ) |
Declare a RPC response notifier in the client class definition.
Use this macro to declare a response notifier in the definition of your own client class derived from rec::rpc::Client. All code which is necessary to register and invoke the notifier is inserted automatically.
FUNCTIONNAME | Name of the RPC function (without qoutes). |
Definition at line 476 of file rec_rpc_Client.h.
#define END_NOTIFIER } |
End of a notifier implementation.
Definition at line 502 of file rec_rpc_Client.h.
#define INVOKE | ( | BLOCKING | ) | invoke( funcName, paramPtr, resultPtr, BLOCKING ); |
This macro calls invoke() with the appropriate parameters and return values. PREPARE must be above this macro! If BLOCKING is true, the return values are accessible via "result" (a reference to an instance of a class derived from rec::rpc::serialization::Serializable).
BLOCKING | If true, the function call will block until a response has been received from the server. If an error occurs during a blocking function call, a rec::rpc::Exception will be thrown. |
rec::rpc::Exception | Error codes: NoConnection, UnknownFunction, WrongDataFormat, ExecutionTimeout, ExecutionCancelled. |
Definition at line 563 of file rec_rpc_Client.h.
#define INVOKE_SIMPLE | ( | FUNCTIONNAME, | |
PARAM, | |||
BLOCKING | |||
) |
This macro declares and initializes the parameters and return values for a function call. It can be used if the parameters consist of one single value only. It calls invoke() with the appropriate parameters and return values. If BLOCKING is true, the return values are accessible via "result" (a reference an instance of a class derived from rec::rpc::serialization::Serializable).
FUNCTIONNAME | Name of the RPC function. |
PARAM | RPC function parameters. |
BLOCKING | If true, the function call will block until a response has been received from the server. If an error occurs during a blocking function call, a rec::rpc::Exception will be thrown. |
rec::rpc::Exception | Error codes: NoConnection, UnknownFunction, WrongDataFormat, ExecutionTimeout, ExecutionCancelled. |
Definition at line 579 of file rec_rpc_Client.h.
#define INVOKE_SIMPLE_EMPTY | ( | FUNCTIONNAME, | |
BLOCKING | |||
) |
This macro declares and initializes the parameters and return values for a function call. It can be used if the function has no parameters. It calls invoke() with the appropriate return values. If BLOCKING is true, the return values are accessible via "result" (a reference to an instance of a class derived from rec::rpc::serialization::Serializable).
FUNCTIONNAME | Name of the RPC function. |
BLOCKING | If true, the function call will block until a response has been received from the server. If an error occurs during a blocking function call, a rec::rpc::Exception will be thrown. |
rec::rpc::Exception | Error codes: NoConnection, UnknownFunction, WrongDataFormat, ExecutionTimeout, ExecutionCancelled. |
Definition at line 597 of file rec_rpc_Client.h.
#define IS_NOTIFIER_REGISTERED | ( | FUNCTIONNAME | ) | isNotifierRegistered( #FUNCTIONNAME ); |
Check if a RPC response notifier for a given function name is registered.
FUNCTIONNAME | Name of the RPC function (without quotes). |
Definition at line 534 of file rec_rpc_Client.h.
#define PREPARE | ( | FUNCTIONNAME | ) |
This macro declares and initializes the parameters and return values for a function call. Below this macro, the parameters can be modified. They are accessible via "param". After adpting the parameters, INVOKE must be called.
FUNCTIONNAME | Name of the RPC function. |
Definition at line 545 of file rec_rpc_Client.h.
#define REGISTER_NOTIFIER | ( | FUNCTIONNAME | ) | registerNotifier( #FUNCTIONNAME, create##FUNCTIONNAME##Notifier() ); |
Register a RPC response notifier.
This macro is used to add a notifier that is invoked when the result of a non-blocking function call is ready. It creates the wrapper object and calls registerNotifier automatically.
FUNCTIONNAME | Name of the RPC function (without quotes). |
Definition at line 514 of file rec_rpc_Client.h.
#define UNREGISTER_NOTIFIER | ( | FUNCTIONNAME | ) | unregisterNotifier( #FUNCTIONNAME ); |
Unregister a RPC response notifier.
This macro is used to remove a notifier.
FUNCTIONNAME | Name of the RPC function (without quotes). |
Definition at line 525 of file rec_rpc_Client.h.