Skip to content

class eCAL::CServiceClient

Service client wrapper class.

Members

public ECAL_API CServiceClient()

Constructor.

public ECAL_API CServiceClient(const std::string & service_name_)

Constructor.

Parameters

  • service_name_ Unique service name.

public virtual ECAL_API ~CServiceClient()

Destructor.

public ECAL_API CServiceClient(const CServiceClient &) = delete

CServiceClients are non-copyable.

public ECAL_API CServiceClient&operator=(const CServiceClient &) = delete

CServiceClients are non-copyable.

public ECAL_API bool Create(const std::string & service_name_)

Creates this object.

Parameters

  • service_name_ Unique service name.

Returns

True if successful.

public ECAL_API bool Destroy()

Destroys this object.

Returns

True if successful.

public ECAL_API bool SetHostName(const std::string & host_name_)

Change the host name filter for that client instance.

Parameters

  • host_name_ Host name filter (empty == all hosts)

Returns

True if successful.

public ECAL_API bool Call(const std::string & method_name_,const std::string & request_,int timeout_)

Call a method of this service, responses will be returned by callback.

Parameters

  • method_name_ Method name.

  • request_ Request string.

  • timeout_ Maximum time before operation returns (in milliseconds, -1 means infinite).

Returns

True if successful.

public ECAL_API bool Call(const std::string & method_name_,const std::string & request_,int timeout_,ServiceResponseVecT * service_response_vec_)

Call a method of this service, all responses will be returned in service_response_vec_.

Parameters

  • method_name_ Method name.

  • request_ Request string.

  • timeout_ Maximum time before operation returns (in milliseconds, -1 means infinite).

  • service_response_vec_ Response vector containing service responses from every called service (null pointer == no response).

Returns

True if successful.

public ECAL_API bool Call(const std::string & host_name_,const std::string & method_name_,const std::string & request_,struct SServiceResponse & service_info_,std::string & response_)

Call method of this service, for specific host.

Deprecated: Please use the create method bool Call(const std::string& method_name_, const std::string& request_, int timeout_, ServiceResponseVecT* service_response_vec_) instead. This function will be removed in future eCAL versions.

Parameters

  • host_name_ Host name.

  • method_name_ Method name.

  • request_ Request string.

  • service_info_ Service response struct for detailed informations.

  • response_ Response string.

Returns

True if successful.

public ECAL_API bool CallAsync(const std::string & method_name_,const std::string & request_,int timeout_)

Call a method of this service asynchronously, responses will be returned by callback.

Parameters

  • method_name_ Method name.

  • request_ Request string.

  • timeout_ Maximum time before operation returns (in milliseconds, -1 means infinite) - NOT SUPPORTED YET.

Returns

True if successful.

public ECAL_API bool AddResponseCallback(const ResponseCallbackT & callback_)

Add server response callback.

Parameters

  • callback_ Callback function for server response.

Returns

True if successful.

public ECAL_API bool RemResponseCallback()

Remove server response callback.

Returns

True if successful.

public ECAL_API bool AddEventCallback(eCAL_Client_Event type_,ClientEventCallbackT callback_)

Add client event callback function.

Parameters

  • type_ The event type to react on.

  • callback_ The callback function to add.

Returns

True if succeeded, false if not.

public ECAL_API bool RemEventCallback(eCAL_Client_Event type_)

Remove client event callback function.

Parameters

  • type_ The event type to remove.

Returns

True if succeeded, false if not.

public ECAL_API std::string GetServiceName()

Retrieve service name.

Returns

The service name.

public ECAL_API bool IsConnected()

Check connection state.

Returns

True if connected, false if not.

protected std::shared_ptr< eCAL::CServiceClientImpl > m_service_client_impl

protected bool m_created