Skip to content

Commit

Permalink
[core] add ecal 6 deprecation warnings. (#1844)
Browse files Browse the repository at this point in the history
* Remove last deprecated function.
* Deprecate SplitCombinedTopicType / CombinedTopicEncodingAndType.
  • Loading branch information
KerstinKeller authored Dec 6, 2024
1 parent a451039 commit a0ffc5a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 94 deletions.
35 changes: 5 additions & 30 deletions ecal/core/include/ecal/ecal_deprecate.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 Down Expand Up @@ -29,33 +29,8 @@
//uncomment this line if you do want to get deprecation warnings inside eCAL core
//#undef ECAL_NO_DEPRECATION_WARNINGS

#if !defined(ECAL_NO_DEPRECATION_WARNINGS) && ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 4, 0)
#define ECAL_DEPRECATE_SINCE_5_4(__message__) [[deprecated(__message__)]] //!< Deprecate the following function with eCAL Version 5.4.0
#if !defined(ECAL_NO_DEPRECATION_WARNINGS) && ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(6, 0, 0)
#define ECAL_DEPRECATE_SINCE_6_0(__message__) [[deprecated(__message__)]] //!< Deprecate the following function with eCAL Version 5.13.0
#else
#define ECAL_DEPRECATE_SINCE_5_4(__message__) //!< Deprecate the following function with eCAL Version 5.4.0
#endif


#if !defined(ECAL_NO_DEPRECATION_WARNINGS) && ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 10, 0)
#define ECAL_DEPRECATE_SINCE_5_10(__message__) [[deprecated(__message__)]] //!< Deprecate the following function with eCAL Version 5.10.0
#else
#define ECAL_DEPRECATE_SINCE_5_10(__message__) //!< Deprecate the following function with eCAL Version 5.10.0
#endif

#if !defined(ECAL_NO_DEPRECATION_WARNINGS) && ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 11, 0)
#define ECAL_DEPRECATE_SINCE_5_11(__message__) [[deprecated(__message__)]] //!< Deprecate the following function with eCAL Version 5.11.0
#else
#define ECAL_DEPRECATE_SINCE_5_11(__message__) //!< Deprecate the following function with eCAL Version 5.11.0
#endif

#if !defined(ECAL_NO_DEPRECATION_WARNINGS) && ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 12, 0)
#define ECAL_DEPRECATE_SINCE_5_12(__message__) [[deprecated(__message__)]] //!< Deprecate the following function with eCAL Version 5.12.0
#else
#define ECAL_DEPRECATE_SINCE_5_12(__message__) //!< Deprecate the following function with eCAL Version 5.12.0
#endif

#if !defined(ECAL_NO_DEPRECATION_WARNINGS) && ECAL_VERSION_INTEGER >= ECAL_VERSION_CALCULATE(5, 13, 0)
#define ECAL_DEPRECATE_SINCE_5_13(__message__) [[deprecated(__message__)]] //!< Deprecate the following function with eCAL Version 5.13.0
#else
#define ECAL_DEPRECATE_SINCE_5_13(__message__) //!< Deprecate the following function with eCAL Version 5.13.0
#endif
#define ECAL_DEPRECATE_SINCE_6_0(__message__) //!< Deprecate the following function with eCAL Version 5.13.0
#endif
3 changes: 3 additions & 0 deletions ecal/core/include/ecal/ecal_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once

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

#include <string>
#include <utility>
Expand Down Expand Up @@ -94,6 +95,7 @@ namespace eCAL
*
* @return std::pair(encoding, typename).
**/
ECAL_DEPRECATE_SINCE_6_0("Please refactor your code to use SDatatypeInformation. This function will be removed with eCAL 7")
ECAL_API std::pair<std::string, std::string> SplitCombinedTopicType(const std::string& combined_topic_type_);

/**
Expand All @@ -104,6 +106,7 @@ namespace eCAL
*
* @return "Old" typename. ( encoding:typename ).
**/
ECAL_DEPRECATE_SINCE_6_0("Please refactor your code to use SDatatypeInformation. This function will be removed with eCAL 7")
ECAL_API std::string CombinedTopicEncodingAndType(const std::string& topic_encoding_, const std::string& topic_type_);
}
}
64 changes: 0 additions & 64 deletions ecal/core/include/ecal/msg/protobuf/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,70 +131,6 @@ namespace eCAL
return CallAsync(method_name_, request_.SerializeAsString(), timeout_);
}

/**
* @brief Call method of this service, for specific host (deprecated).
*
* This method is deprecated. Instead using
*
* @code
* eCAL::SServiceResponse srv_response;
*
* pb::protobuf_message_request_type msg_request_pb;
* pb::protobuf_message_response_type msg_response_pb;
*
* auto success = my_service.Call("host_name", "service_name", msg_request_pb, srv_response, msg_response_pb);
* if (success)
* {
* // process msg_response_pb here
* }
* @endcode
*
* you should use the new Call API function returning a vector of all service responses like this
*
* @code
* eCAL::ServiceResponseVecT srv_response_vec;
*
* pb::protobuf_message_request_type msg_request_pb;
* pb::protobuf_message_response_type msg_response_pb;
*
* auto success = my_service.Call("service_name", msg_request_pb, -1, &srv_response_vec);
* if (success)
* {
* for (auto srv_response : srv_response_vec)
* {
* msg_response_pb.ParseFromString(service_response.response);
*
* // process msg_response_pb here
* }
* }
* @endcode
*
* @param host_name_ Host name.
* @param method_name_ Method name.
* @param request_ Request message.
* @param [out] service_response_ Service response struct for detailed informations.
* @param [out] response_ Response message.
*
* @return True if successful.
**/
ECAL_DEPRECATE_SINCE_5_10("Please use the method bool Call(const std::string& method_name_, const google::protobuf::Message& request_, const int timeout_, ServiceResponseVecT* service_response_vec_) instead. This function will be removed in eCAL6.")
bool Call(const std::string& host_name_, const std::string& method_name_, const google::protobuf::Message& request_, struct SServiceResponse& service_response_, google::protobuf::Message& response_)
{
ServiceResponseVecT service_response_vec;
const int timeout_(-1);
SetHostName(host_name_);
if (Call(method_name_, request_.SerializeAsString(), timeout_, &service_response_vec))
{
if (!service_response_vec.empty())
{
service_response_ = service_response_vec[0];
response_.ParseFromString(service_response_vec[0].response);
return true;
}
}
return false;
}

using eCAL::CServiceClient::Call;
using eCAL::CServiceClient::CallAsync;
private:
Expand Down

0 comments on commit a0ffc5a

Please sign in to comment.