Skip to content

Commit

Permalink
[core] registration specific functions moved from Util:: to Registrat…
Browse files Browse the repository at this point in the history
…ion:: (#1700)

* registration specific functions moved from Util:: to Registration::
  • Loading branch information
rex-schilasky committed Aug 8, 2024
1 parent 2b2e4d7 commit ab0870c
Show file tree
Hide file tree
Showing 26 changed files with 1,266 additions and 1,074 deletions.
2 changes: 1 addition & 1 deletion app/mon/mon_cli/src/ecal_mon_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void ProcProto(const std::string& topic_name, int msg_count)

// get topic type
eCAL::SDataTypeInformation topic_info;
eCAL::Util::GetTopicDataTypeInformation(topic_name, topic_info);
eCAL::Registration::GetTopicDataTypeInformation(topic_name, topic_info);
if(topic_info.name.empty())
{
std::cout << "could not get type name for topic " << topic_name << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions app/mon/mon_gui/src/widgets/models/topic_tree_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const
if (!monitor_topic_name.empty())
{
eCAL::SDataTypeInformation topic_info;
eCAL::Util::GetTopicDataTypeInformation(monitor_topic_name, topic_info);
eCAL::Registration::GetTopicDataTypeInformation(monitor_topic_name, topic_info);
return topic_info.encoding.c_str();
}
}
Expand All @@ -115,7 +115,7 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const
if (!monitor_topic_name.empty())
{
eCAL::SDataTypeInformation topic_info;
eCAL::Util::GetTopicDataTypeInformation(monitor_topic_name, topic_info);
eCAL::Registration::GetTopicDataTypeInformation(monitor_topic_name, topic_info);
return topic_info.name.c_str();
}
}
Expand Down
4 changes: 4 additions & 0 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ if (ECAL_CORE_REGISTRATION)
set(ecal_registration_src
src/registration/ecal_process_registration.cpp
src/registration/ecal_process_registration.h
src/registration/ecal_registration.cpp
src/registration/ecal_registration_provider.cpp
src/registration/ecal_registration_provider.h
src/registration/ecal_registration_receiver.cpp
Expand Down Expand Up @@ -452,6 +453,7 @@ set(ecal_c_src
src/cimpl/ecal_monitoring_cimpl.cpp
src/cimpl/ecal_process_cimpl.cpp
src/cimpl/ecal_publisher_cimpl.cpp
src/cimpl/ecal_registration_cimpl.cpp
src/cimpl/ecal_server_cimpl.cpp
src/cimpl/ecal_subscriber_cimpl.cpp
src/cimpl/ecal_time_cimpl.cpp
Expand Down Expand Up @@ -491,6 +493,7 @@ set(ecal_header_cmn
include/ecal/ecal_monitoring.h
include/ecal/ecal_process.h
include/ecal/ecal_process_severity.h
include/ecal/ecal_registration.h
include/ecal/ecal_publisher.h
include/ecal/ecal_server.h
include/ecal/ecal_service_info.h
Expand All @@ -511,6 +514,7 @@ set(ecal_header_cimpl
include/ecal/cimpl/ecal_monitoring_cimpl.h
include/ecal/cimpl/ecal_process_cimpl.h
include/ecal/cimpl/ecal_publisher_cimpl.h
include/ecal/cimpl/ecal_registration_cimpl.h
include/ecal/cimpl/ecal_server_cimpl.h
include/ecal/cimpl/ecal_service_info_cimpl.h
include/ecal/cimpl/ecal_subscriber_cimpl.h
Expand Down
176 changes: 176 additions & 0 deletions ecal/core/include/ecal/cimpl/ecal_registration_cimpl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ========================= eCAL LICENSE =================================
*/

/**
* @file ecal_registration_cimpl.h
* @brief eCAL registration c interface
**/

#ifndef ecal_registration_cimpl_h_included
#define ecal_registration_cimpl_h_included

#include <ecal/ecal_os.h>
#include <ecal/ecalc_types.h>

#ifdef __cplusplus
extern "C"
{
#endif /*__cplusplus*/
/**
* @brief Gets type name of the specified topic.
*
* @param topic_name_ Topic name.
* @param [out] topic_type_ Pointer to store the type name information.
* @param topic_type_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Registration_GetTopicTypeName(const char* topic_name_, void* topic_type_, int topic_type_len_);

/**
* @brief Gets encoding of the specified topic.
*
* @param topic_name_ Topic name.
* @param [out] topic_encoding_ Pointer to store the encoding information.
* @param topic_encoding__len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Registration_GetTopicEncoding(const char* topic_name_, void* topic_encoding_, int topic_encoding_len_);

/**
* @brief Gets type description of the specified topic.
*
* @param topic_name_ Topic name.
* @param [out] topic_desc_ Pointer to store the type description0 information.
* @param topic_desc_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Registration_GetTopicDescription(const char* topic_name_, void* topic_desc_, int topic_desc_len_);

/**
* @brief Gets service method request type name.
*
* @param service_name_ Service name.
* @param method_name_ Method name.
* @param [out] req_type_ Pointer to store the request type.
* @param req_type_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Registration_GetServiceRequestTypeName(const char* service_name_, const char* method_name_, void* req_type_, int req_type_len_);

/**
* @brief Gets service method response type name.
*
* @param service_name_ Service name.
* @param method_name_ Method name.
* @param [out] resp_type_ Pointer to store the response type.
* @param resp_type_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Registration_GetServiceResponseTypeName(const char* service_name_, const char* method_name_, void* resp_type_, int resp_type_len_);

/**
* @brief Gets service method request description.
*
* @param service_name_ Service name.
* @param method_name_ Method name.
* @param [out] req_desc_ Pointer to store the request description.
* @param req_desc_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Request description buffer length or zero if failed.
**/
ECALC_API int eCAL_Registration_GetServiceRequestDescription(const char* service_name_, const char* method_name_, void* req_desc_, int req_desc_len_);

/**
* @brief Gets service method response description.
*
* @param service_name_ Service name.
* @param method_name_ Method name.
* @param [out] resp_desc_ Pointer to store the response description.
* @param resp_desc_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Response description buffer length or zero if failed.
**/
ECALC_API int eCAL_Registration_GetServiceResponseDescription(const char* service_name_, const char* method_name_, void* resp_desc_, int resp_desc_len_);

/**
* @brief Gets client method request type name.
*
* @param client_name_ Client name.
* @param method_name_ Method name.
* @param [out] req_type_ Pointer to store the request type.
* @param req_type_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Registration_GetClientRequestTypeName(const char* client_name_, const char* method_name_, void* req_type_, int req_type_len_);

/**
* @brief Gets client method response type name.
*
* @param client_name_ Client name.
* @param method_name_ Method name.
* @param [out] resp_type_ Pointer to store the response type.
* @param resp_type_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Registration_GetClientResponseTypeName(const char* client_name_, const char* method_name_, void* resp_type_, int resp_type_len_);

/**
* @brief Gets client method request description.
*
* @param client_name_ Client name.
* @param method_name_ Method name.
* @param [out] req_desc_ Pointer to store the request description.
* @param req_desc_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Request description buffer length or zero if failed.
**/
ECALC_API int eCAL_Registration_GetClientRequestDescription(const char* client_name_, const char* method_name_, void* req_desc_, int req_desc_len_);

/**
* @brief Gets client method response description.
*
* @param client_name_ Client name.
* @param method_name_ Method name.
* @param [out] resp_desc_ Pointer to store the response description.
* @param resp_desc_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Response description buffer length or zero if failed.
**/
ECALC_API int eCAL_Registration_GetClientResponseDescription(const char* client_name_, const char* method_name_, void* resp_desc_, int resp_desc_len_);
#ifdef __cplusplus
}
#endif /*__cplusplus*/

#endif /*ecal_registration_cimpl_h_included*/
141 changes: 1 addition & 140 deletions ecal/core/include/ecal/cimpl/ecal_util_cimpl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,7 +26,6 @@
#define ecal_util_cimpl_h_included

#include <ecal/ecal_os.h>
#include <ecal/ecalc_types.h>

#ifdef __cplusplus
extern "C"
Expand Down Expand Up @@ -64,144 +63,6 @@ extern "C"
* @param state_ Switch on message loop back..
**/
ECALC_API void eCAL_Util_EnableLoopback(int state_);

/**
* @brief Gets type name of the specified topic.
*
* @param topic_name_ Topic name.
* @param [out] topic_type_ Pointer to store the type name information.
* @param topic_type_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Util_GetTopicTypeName(const char* topic_name_, void* topic_type_, int topic_type_len_);

/**
* @brief Gets encoding of the specified topic.
*
* @param topic_name_ Topic name.
* @param [out] topic_encoding_ Pointer to store the encoding information.
* @param topic_encoding__len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Util_GetTopicEncoding(const char* topic_name_, void* topic_encoding_, int topic_encoding_len_);

/**
* @brief Gets type description of the specified topic.
*
* @param topic_name_ Topic name.
* @param [out] topic_desc_ Pointer to store the type description0 information.
* @param topic_desc_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Util_GetTopicDescription(const char* topic_name_, void* topic_desc_, int topic_desc_len_);

/**
* @brief Gets service method request type name.
*
* @param service_name_ Service name.
* @param method_name_ Method name.
* @param [out] req_type_ Pointer to store the request type.
* @param req_type_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Util_GetServiceRequestTypeName(const char* service_name_, const char* method_name_, void* req_type_, int req_type_len_);

/**
* @brief Gets service method response type name.
*
* @param service_name_ Service name.
* @param method_name_ Method name.
* @param [out] resp_type_ Pointer to store the response type.
* @param resp_type_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Util_GetServiceResponseTypeName(const char* service_name_, const char* method_name_, void* resp_type_, int resp_type_len_);

/**
* @brief Gets service method request description.
*
* @param service_name_ Service name.
* @param method_name_ Method name.
* @param [out] req_desc_ Pointer to store the request description.
* @param req_desc_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Request description buffer length or zero if failed.
**/
ECALC_API int eCAL_Util_GetServiceRequestDescription(const char* service_name_, const char* method_name_, void* req_desc_, int req_desc_len_);

/**
* @brief Gets service method response description.
*
* @param service_name_ Service name.
* @param method_name_ Method name.
* @param [out] resp_desc_ Pointer to store the response description.
* @param resp_desc_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Response description buffer length or zero if failed.
**/
ECALC_API int eCAL_Util_GetServiceResponseDescription(const char* service_name_, const char* method_name_, void* resp_desc_, int resp_desc_len_);

/**
* @brief Gets client method request type name.
*
* @param client_name_ Client name.
* @param method_name_ Method name.
* @param [out] req_type_ Pointer to store the request type.
* @param req_type_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Util_GetClientRequestTypeName(const char* client_name_, const char* method_name_, void* req_type_, int req_type_len_);

/**
* @brief Gets client method response type name.
*
* @param client_name_ Client name.
* @param method_name_ Method name.
* @param [out] resp_type_ Pointer to store the response type.
* @param resp_type_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
*
* @return Type name buffer length or zero if failed.
**/
ECALC_API int eCAL_Util_GetClientResponseTypeName(const char* client_name_, const char* method_name_, void* resp_type_, int resp_type_len_);

/**
* @brief Gets client method request description.
*
* @param client_name_ Client name.
* @param method_name_ Method name.
* @param [out] req_desc_ Pointer to store the request description.
* @param req_desc_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Request description buffer length or zero if failed.
**/
ECALC_API int eCAL_Util_GetClientRequestDescription(const char* client_name_, const char* method_name_, void* req_desc_, int req_desc_len_);

/**
* @brief Gets client method response description.
*
* @param client_name_ Client name.
* @param method_name_ Method name.
* @param [out] resp_desc_ Pointer to store the response description.
* @param resp_desc_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if
* eCAL should allocate the buffer for you (see eCAL_FreeMem).
*
* @return Response description buffer length or zero if failed.
**/
ECALC_API int eCAL_Util_GetClientResponseDescription(const char* client_name_, const char* method_name_, void* resp_desc_, int resp_desc_len_);
#ifdef __cplusplus
}
#endif /*__cplusplus*/
Expand Down
Loading

0 comments on commit ab0870c

Please sign in to comment.