Skip to content

Commit

Permalink
Rename a few more service types.
Browse files Browse the repository at this point in the history
  • Loading branch information
KerstinKeller committed Jan 28, 2025
1 parent 671a2a7 commit 0fb06d3
Show file tree
Hide file tree
Showing 22 changed files with 98 additions and 98 deletions.
4 changes: 2 additions & 2 deletions ecal/core/include/ecal/registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace eCAL
*
* @return True if information could be queried.
**/
ECAL_API bool GetServerInfo(const SServiceId& id_, ServiceMethodInfoSetT& service_method_info_);
ECAL_API bool GetServerInfo(const SServiceId& id_, ServiceMethodInformationSetT& service_method_info_);

/**
* @brief Get complete snapshot of all known clients.
Expand All @@ -151,7 +151,7 @@ namespace eCAL
*
* @return True if information could be queried.
**/
ECAL_API bool GetClientInfo(const SServiceId& id_, ServiceMethodInfoSetT& service_method_info_);
ECAL_API bool GetClientInfo(const SServiceId& id_, ServiceMethodInformationSetT& service_method_info_);

/**
* @brief Get all topic names.
Expand Down
8 changes: 4 additions & 4 deletions ecal/core/include/ecal/service/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace eCAL
* @param event_callback_ The client event callback funtion.
**/
ECAL_API_EXPORTED_MEMBER
CServiceClient(const std::string& service_name_, const ServiceMethodInfoSetT& method_information_set_ = ServiceMethodInfoSetT(), const ClientEventCallbackT event_callback_ = ClientEventCallbackT());
CServiceClient(const std::string& service_name_, const ServiceMethodInformationSetT& method_information_set_ = ServiceMethodInformationSetT(), const ClientEventCallbackT event_callback_ = ClientEventCallbackT());

/**
* @brief Destructor.
Expand Down Expand Up @@ -102,7 +102,7 @@ namespace eCAL
* @return True if all calls were successful.
**/
ECAL_API_EXPORTED_MEMBER
bool CallWithResponse(const std::string& method_name_, const std::string& request_, int timeout_, ServiceIDResponseVecT& service_response_vec_) const;
bool CallWithResponse(const std::string& method_name_, const std::string& request_, int timeout_, ServiceResponseVecT& service_response_vec_) const;

/**
* @brief Blocking call (with timeout) of a service method for all existing service instances, using callback
Expand All @@ -115,7 +115,7 @@ namespace eCAL
* @return True if all calls were successful.
**/
ECAL_API_EXPORTED_MEMBER
bool CallWithCallback(const std::string& method_name_, const std::string& request_, int timeout_, const ResponseIDCallbackT& response_callback_) const;
bool CallWithCallback(const std::string& method_name_, const std::string& request_, int timeout_, const ResponseCallbackT& response_callback_) const;

/**
* @brief Asynchronous call of a service method for all existing service instances, using callback
Expand All @@ -127,7 +127,7 @@ namespace eCAL
* @return True if all calls were successful.
**/
ECAL_API_EXPORTED_MEMBER
bool CallWithCallbackAsync(const std::string& method_name_, const std::string& request_, const ResponseIDCallbackT& response_callback_) const;
bool CallWithCallbackAsync(const std::string& method_name_, const std::string& request_, const ResponseCallbackT& response_callback_) const;

/**
* @brief Retrieve service name.
Expand Down
6 changes: 3 additions & 3 deletions ecal/core/include/ecal/service/client_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace eCAL
* @return success state and service response
**/
ECAL_API_EXPORTED_MEMBER
std::pair<bool, SServiceIDResponse> CallWithResponse(const std::string& method_name_, const std::string& request_, int timeout_ = -1);
std::pair<bool, SServiceResponse> CallWithResponse(const std::string& method_name_, const std::string& request_, int timeout_ = -1);

/**
* @brief Blocking call of a service method, using callback
Expand All @@ -78,7 +78,7 @@ namespace eCAL
* @return True if successful.
**/
ECAL_API_EXPORTED_MEMBER
bool CallWithCallback(const std::string& method_name_, const std::string& request_, int timeout_, const ResponseIDCallbackT& response_callback_);
bool CallWithCallback(const std::string& method_name_, const std::string& request_, int timeout_, const ResponseCallbackT& response_callback_);

/**
* @brief Asynchronous call of a service method, using callback
Expand All @@ -90,7 +90,7 @@ namespace eCAL
* @return True if successful.
**/
ECAL_API_EXPORTED_MEMBER
bool CallWithCallbackAsync(const std::string& method_name_, const std::string& request_, const ResponseIDCallbackT& response_callback_);
bool CallWithCallbackAsync(const std::string& method_name_, const std::string& request_, const ResponseCallbackT& response_callback_);

/**
* @brief Check connection state.
Expand Down
10 changes: 5 additions & 5 deletions ecal/core/include/ecal/service/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ namespace eCAL
* Used to Create a Client Instance
* Can be queried from eCAL::Registration.
**/
using ServiceMethodInfoSetT = std::set<SServiceMethodInformation>;
using ServiceMethodInformationSetT = std::set<SServiceMethodInformation>;

/**
* @brief Service response struct containing the (responding) server informations and the response itself.
* @brief Service response struct containing the (responding) server information and the response itself.
**/
struct SServiceIDResponse
struct SServiceResponse
{
eCallState call_state = eCallState::none; //!< call state, to indicate if the call was successful or not

Expand All @@ -148,14 +148,14 @@ namespace eCAL

std::string error_msg; //!< human readable error message
};
using ServiceIDResponseVecT = std::vector<SServiceIDResponse>; //!< vector of multiple service responses
using ServiceResponseVecT = std::vector<SServiceResponse>; //!< vector of multiple service responses

/**
* @brief Service response callback function type (low level client interface).
*
* @param service_response_ Service response struct containing the (responding) server informations and the response itself.
**/
using ResponseIDCallbackT = std::function<void (const SServiceIDResponse& service_response_)>;
using ResponseCallbackT = std::function<void (const SServiceResponse& service_response_)>;

/**
* @brief Service method callback function type (low level server interface).
Expand Down
4 changes: 2 additions & 2 deletions ecal/core/include/ecal/v5/ecal_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace eCAL
* @param method_information_map_ Map of method names and corresponding datatype information.
**/
ECAL_API_EXPORTED_MEMBER
explicit CServiceClient(const std::string& service_name_, const ServiceMethodInfoSetT& method_information_map_);
explicit CServiceClient(const std::string& service_name_, const ServiceMethodInformationSetT& method_information_map_);

/**
* @brief Destructor.
Expand Down Expand Up @@ -104,7 +104,7 @@ namespace eCAL
* @return True if successful.
**/
ECAL_API_EXPORTED_MEMBER
bool Create(const std::string& service_name_, const ServiceMethodInfoSetT& method_information_map_);
bool Create(const std::string& service_name_, const ServiceMethodInformationSetT& method_information_map_);

/**
* @brief Destroys this object.
Expand Down
10 changes: 5 additions & 5 deletions ecal/core/src/ecal_descgate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ namespace
// we could also think about an update function here
// e.g. we don't always copy everything, but only write if things have changed. At least this would be beneficial for performance.
template<typename Service>
eCAL::ServiceMethodInfoSetT Convert(const Service& service_)
eCAL::ServiceMethodInformationSetT Convert(const Service& service_)
{
eCAL::ServiceMethodInfoSetT methods;
eCAL::ServiceMethodInformationSetT methods;
for (const auto& method : service_.methods)
{
const eCAL::SDataTypeInformation request_datatype = GetDataTypeInformation(method.req_datatype, method.req_type, method.req_desc);
Expand Down Expand Up @@ -220,7 +220,7 @@ namespace eCAL
return GetServiceIDs(m_service_info_map);
}

bool CDescGate::GetServerInfo(const SServiceId& id_, ServiceMethodInfoSetT& service_info_) const
bool CDescGate::GetServerInfo(const SServiceId& id_, ServiceMethodInformationSetT& service_info_) const
{
return GetService(id_, m_service_info_map, service_info_);
}
Expand All @@ -230,7 +230,7 @@ namespace eCAL
return GetServiceIDs(m_client_info_map);
}

bool CDescGate::GetClientInfo(const SServiceId& id_, ServiceMethodInfoSetT& service_info_) const
bool CDescGate::GetClientInfo(const SServiceId& id_, ServiceMethodInformationSetT& service_info_) const
{
return GetService(id_, m_client_info_map, service_info_);
}
Expand Down Expand Up @@ -274,7 +274,7 @@ namespace eCAL
return service_id_set;
}

bool CDescGate::GetService(const SServiceId& id_, const SServiceIdInfoMap& service_method_info_map_, ServiceMethodInfoSetT& service_method_info_)
bool CDescGate::GetService(const SServiceId& id_, const SServiceIdInfoMap& service_method_info_map_, ServiceMethodInformationSetT& service_method_info_)
{
const std::lock_guard<std::mutex> lock(service_method_info_map_.mtx);
auto iter = service_method_info_map_.id_map.find(id_);
Expand Down
8 changes: 4 additions & 4 deletions ecal/core/src/ecal_descgate.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ namespace eCAL

// get service information
std::set<SServiceId> GetServerIDs() const;
bool GetServerInfo(const SServiceId& id_, ServiceMethodInfoSetT& service_info_) const;
bool GetServerInfo(const SServiceId& id_, ServiceMethodInformationSetT& service_info_) const;

// get client information
std::set<SServiceId> GetClientIDs() const;
bool GetClientInfo(const SServiceId& id_, ServiceMethodInfoSetT& service_info_) const;
bool GetClientInfo(const SServiceId& id_, ServiceMethodInformationSetT& service_info_) const;

// delete copy constructor and copy assignment operator
CDescGate(const CDescGate&) = delete;
Expand All @@ -90,7 +90,7 @@ namespace eCAL
TopicEventCallbackMap map;
};

using ServiceIdInfoMap = std::map<SServiceId, ServiceMethodInfoSetT>;
using ServiceIdInfoMap = std::map<SServiceId, ServiceMethodInformationSetT>;
struct SServiceIdInfoMap
{
mutable std::mutex mtx;
Expand All @@ -103,7 +103,7 @@ namespace eCAL
static bool GetTopic (const STopicId& id_, const STopicIdInfoMap& topic_info_map_, SDataTypeInformation& topic_info_);

static std::set<SServiceId> GetServiceIDs(const SServiceIdInfoMap& service_method_info_map_);
static bool GetService (const SServiceId& id_, const SServiceIdInfoMap& service_method_info_map_, ServiceMethodInfoSetT& service_method_info_);
static bool GetService (const SServiceId& id_, const SServiceIdInfoMap& service_method_info_map_, ServiceMethodInformationSetT& service_method_info_);

Registration::CallbackToken CreateToken();

Expand Down
8 changes: 4 additions & 4 deletions ecal/core/src/registration/ecal_registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace eCAL
return g_descgate()->GetServerIDs();
}

bool GetServerInfo(const SServiceId& id_, ServiceMethodInfoSetT& service_info_)
bool GetServerInfo(const SServiceId& id_, ServiceMethodInformationSetT& service_info_)
{
if (g_descgate() == nullptr) return false;
return g_descgate()->GetServerInfo(id_, service_info_);
Expand All @@ -100,7 +100,7 @@ namespace eCAL
return g_descgate()->GetClientIDs();
}

bool GetClientInfo(const SServiceId& id_, ServiceMethodInfoSetT& service_info_)
bool GetClientInfo(const SServiceId& id_, ServiceMethodInformationSetT& service_info_)
{
if (g_descgate() == nullptr) return false;
return g_descgate()->GetClientInfo(id_, service_info_);
Expand Down Expand Up @@ -131,7 +131,7 @@ namespace eCAL
const std::set<SServiceId> server_id_set = GetServerIDs();
for (const auto& server_id : server_id_set)
{
eCAL::ServiceMethodInfoSetT methods;
eCAL::ServiceMethodInformationSetT methods;
(void)GetServerInfo(server_id, methods);
for (const auto& method : methods)
{
Expand All @@ -148,7 +148,7 @@ namespace eCAL
const std::set<SServiceId> client_id_set = GetClientIDs();
for (const auto& client_id : client_id_set)
{
eCAL::ServiceMethodInfoSetT methods;
eCAL::ServiceMethodInformationSetT methods;
(void)GetClientInfo(client_id, methods);
for (const auto& method : methods)
{
Expand Down
16 changes: 8 additions & 8 deletions ecal/core/src/service/ecal_service_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

namespace eCAL
{
CServiceClient::CServiceClient(const std::string & service_name_, const ServiceMethodInfoSetT& method_information_set_, const ClientEventCallbackT event_callback_)
CServiceClient::CServiceClient(const std::string & service_name_, const ServiceMethodInformationSetT& method_information_set_, const ClientEventCallbackT event_callback_)
{
// create client implementation
m_service_client_impl = CServiceClientImpl::CreateInstance(service_name_, method_information_set_, event_callback_);
Expand Down Expand Up @@ -78,13 +78,13 @@ namespace eCAL
return instances;
}

bool CServiceClient::CallWithResponse(const std::string & method_name_, const std::string & request_, int timeout_, ServiceIDResponseVecT & service_response_vec_) const
bool CServiceClient::CallWithResponse(const std::string & method_name_, const std::string & request_, int timeout_, ServiceResponseVecT & service_response_vec_) const
{
auto instances = GetClientInstances();
size_t num_instances = instances.size();

// vector to hold futures for the return values and responses
std::vector<std::future<std::pair<bool, SServiceIDResponse>>> futures;
std::vector<std::future<std::pair<bool, SServiceResponse>>> futures;
futures.reserve(num_instances);

// launch asynchronous calls for each instance
Expand All @@ -107,9 +107,9 @@ namespace eCAL
try
{
// explicitly unpack the pair
const std::pair<bool, SServiceIDResponse> result = future.get();
const std::pair<bool, SServiceResponse> result = future.get();
bool success = result.first;
const SServiceIDResponse response = result.second;
const SServiceResponse response = result.second;

// add response to the vector
service_response_vec_.emplace_back(response);
Expand All @@ -120,7 +120,7 @@ namespace eCAL
catch (const std::exception& e)
{
// handle exceptions and add an error response
SServiceIDResponse error_response;
SServiceResponse error_response;
error_response.error_msg = e.what();
error_response.call_state = eCallState::failed;
service_response_vec_.emplace_back(error_response);
Expand All @@ -133,7 +133,7 @@ namespace eCAL
return overall_success;
}

bool CServiceClient::CallWithCallback(const std::string & method_name_, const std::string & request_, int timeout_, const ResponseIDCallbackT & response_callback_) const
bool CServiceClient::CallWithCallback(const std::string & method_name_, const std::string & request_, int timeout_, const ResponseCallbackT & response_callback_) const
{
auto instances = GetClientInstances();
size_t num_instances = instances.size();
Expand Down Expand Up @@ -168,7 +168,7 @@ namespace eCAL
return return_state;
}

bool CServiceClient::CallWithCallbackAsync(const std::string & method_name_, const std::string & request_, const ResponseIDCallbackT & response_callback_) const
bool CServiceClient::CallWithCallbackAsync(const std::string & method_name_, const std::string & request_, const ResponseCallbackT & response_callback_) const
{
bool return_state = true;
auto instances = GetClientInstances();
Expand Down
Loading

0 comments on commit 0fb06d3

Please sign in to comment.