Class CServiceClient

Class Documentation

class eCAL::CServiceClient

Service client wrapper class.

Public Functions

CServiceClient()

Constructor.

CServiceClient(const std::string &service_name_)

Constructor.

Parameters

service_name_ – Unique service name.

virtual ~CServiceClient()

Destructor.

CServiceClient(const CServiceClient&) = delete

CServiceClients are non-copyable.

CServiceClient &operator=(const CServiceClient&) = delete

CServiceClients are non-copyable.

bool Create(const std::string &service_name_)

Creates this object.

Parameters

service_name_ – Unique service name.

Returns

True if successful.

bool Destroy()

Destroys this object.

Returns

True if successful.

bool SetHostName(const std::string &host_name_)

Change the host name filter for that client instance.

Parameters

host_name_ – Host name filter (empty or “*” == all hosts)

Returns

True if successful.

bool Call(const std::string &method_name_, const std::string &request_)

Call method of this service, for all hosts, responses will be returned by callback.

Parameters
  • method_name_ – Method name.

  • request_ – Request string.

Returns

True if successful.

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

Call method of this service, for specific host.

Parameters
  • host_name_ – Host name.

  • method_name_ – Method name.

  • request_ – Request string.

  • service_info_[out] Service info struct for detailed informations.

  • response_[out] Response string.

Returns

True if successful.

void CallAsync(const std::string &method_name_, const std::string &request_)

Asynchronously call method of this service, for all hosts, responses will be returned by callback.

Parameters
  • method_name_ – Method name.

  • request_ – Request string.

void CallAsync(const std::string &host_name_, const std::string &method_name_, const std::string &request_)

Asynchronously call method of this service asynchronously, for specific host, response will be returned by callback.

Parameters
  • host_name_ – Host name.

  • method_name_ – Method name.

  • request_ – Request string.

bool AddResponseCallback(const ResponseCallbackT &callback_)

Add server response callback.

Parameters

callback_ – Callback function for server response.

Returns

True if successful.

bool RemResponseCallback()

Remove server response callback.

Returns

True if successful.