Class CServiceServer#

Class Documentation#

class CServiceServer#

Service Server wrapper class.

Public Functions

ECAL_API CServiceServer()#

Constructor.

ECAL_API explicit CServiceServer(const std::string &service_name_)#

Constructor.

Parameters:

service_name_ – Unique service name.

ECAL_API virtual ~CServiceServer()#

Destructor.

CServiceServer(const CServiceServer&) = delete#

CServiceServers are non-copyable.

CServiceServer &operator=(const CServiceServer&) = delete#

CServiceServers are non-copyable.

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

Creates this object.

Parameters:

service_name_ – Unique service name.

Returns:

True if successful.

ECAL_API bool Destroy()#

Destroys this object.

Returns:

True if successful.

ECAL_API bool AddDescription(const std::string &method_, const std::string &req_type_, const std::string &req_desc_, const std::string &resp_type_, const std::string &resp_desc_)#

Add method type descriptions.

Parameters:
  • method_ – Service method name.

  • req_type_ – Service method request type.

  • req_desc_ – Service method request description.

  • resp_type_ – Service method response type.

  • resp_desc_ – Service method response description.

Returns:

True if successful.

ECAL_API bool AddMethodCallback(const std::string &method_, const std::string &req_type_, const std::string &resp_type_, const MethodCallbackT &callback_)#

Add method callback.

Parameters:
  • method_ – Service method name.

  • req_type_ – Service method request type.

  • resp_type_ – Service method response type.

  • callback_ – Callback function for client request.

Returns:

True if successful.

ECAL_API bool RemMethodCallback(const std::string &method_)#

Remove method callback.

Parameters:

method_ – Service method name.

Returns:

True if successful.

ECAL_API bool AddEventCallback(eCAL_Server_Event type_, ServerEventCallbackT callback_)#

Add server event callback function.

Parameters:
  • type_ – The event type to react on.

  • callback_ – The callback function to add.

Returns:

True if succeeded, false if not.

ECAL_API bool RemEventCallback(eCAL_Server_Event type_)#

Remove server event callback function.

Parameters:

type_ – The event type to remove.

Returns:

True if succeeded, false if not.

ECAL_API std::string GetServiceName()#

Retrieve service name.

Returns:

The service name.

ECAL_API bool IsConnected()#

Check connection state.

Returns:

True if connected, false if not.