Class CClientInstance
Defined in File client_instance.h
Class Documentation
-
class CClientInstance
Public Functions
-
~CClientInstance() = default
-
CClientInstance(const CClientInstance&) = delete
-
CClientInstance &operator=(const CClientInstance&) = delete
-
ECAL_API_EXPORTED_MEMBER CClientInstance(CClientInstance &&rhs) noexcept = default
- ECAL_API_EXPORTED_MEMBER CClientInstance & operator= (CClientInstance &&rhs) noexcept=default
- ECAL_API_EXPORTED_MEMBER std::pair< bool, SServiceResponse > CallWithResponse (const std::string &method_name_, const std::string &request_, int timeout_ms_=DEFAULT_TIME_ARGUMENT)
Blocking call of a service method, response will be returned as pair<bool, SServiceReponse>
- Parameters:
method_name_ – Method name.
request_ – Request string.
timeout_ms_ – Maximum time before operation returns (in milliseconds, DEFAULT_TIME_ARGUMENT means infinite).
- Returns:
success state and service response
- ECAL_API_EXPORTED_MEMBER bool CallWithCallback (const std::string &method_name_, const std::string &request_, const ResponseCallbackT &response_callback_, int timeout_ms_=DEFAULT_TIME_ARGUMENT)
Blocking call of a service method, using callback.
- Parameters:
method_name_ – Method name.
request_ – Request string.
response_callback_ – Callback function for the service method response.
timeout_ms_ – Maximum time before operation returns (in milliseconds, DEFAULT_TIME_ARGUMENT means infinite).
- Returns:
True if successful.
- ECAL_API_EXPORTED_MEMBER bool CallWithCallbackAsync (const std::string &method_name_, const std::string &request_, const ResponseCallbackT &response_callback_)
Asynchronous call of a service method, using callback.
- Parameters:
method_name_ – Method name.
request_ – Request string.
response_callback_ – Callback function for the service method response.
- Returns:
True if successful.
- ECAL_API_EXPORTED_MEMBER bool IsConnected () const
Check connection state.
- Returns:
True if connected, false if not.
- ECAL_API_EXPORTED_MEMBER const SEntityId & GetClientID () const
Get unique client entity id.
- Returns:
The client entity id.
Public Static Attributes
- static ECAL_API_EXPORTED_MEMBER constexpr long long DEFAULT_TIME_ARGUMENT = -1
Use DEFAULT_TIME_ARGUMENT in the
CallWithResponse()
andCallWithCallback()
functions for blocking calls
-
~CClientInstance() = default