From 5397da448b12fa9d0af2ac2a323b453b2b3153dd Mon Sep 17 00:00:00 2001 From: Rex Schilasky <49162693+rex-schilasky@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:24:24 +0100 Subject: [PATCH] [core] prepare api for ecal6 (#1399) deprecate all functions that will be finally removed in eCAL6 --- cpack/innosetup.cmake | 2 +- .../include/ecal/cimpl/ecal_callback_cimpl.h | 32 +++--- .../include/ecal/cimpl/ecal_event_cimpl.h | 17 ++- .../core/include/ecal/cimpl/ecal_init_cimpl.h | 2 +- ecal/core/include/ecal/cimpl/ecal_log_cimpl.h | 12 +- .../include/ecal/cimpl/ecal_process_cimpl.h | 29 +++-- .../ecal_proto_dyn_json_subscriber_cimpl.h | 17 +-- .../include/ecal/cimpl/ecal_publisher_cimpl.h | 9 +- ecal/core/include/ecal/cimpl/ecal_qos_cimpl.h | 6 +- .../include/ecal/cimpl/ecal_service_cimpl.h | 4 +- .../ecal/cimpl/ecal_subscriber_cimpl.h | 36 +++++- .../include/ecal/cimpl/ecal_tlayer_cimpl.h | 2 +- .../core/include/ecal/cimpl/ecal_util_cimpl.h | 32 +++++- ecal/core/include/ecal/ecal_clang.h | 6 +- ecal/core/include/ecal/ecal_client.h | 5 +- ecal/core/include/ecal/ecal_event.h | 16 ++- ecal/core/include/ecal/ecal_eventhandle.h | 5 +- ecal/core/include/ecal/ecal_log.h | 10 ++ ecal/core/include/ecal/ecal_monitoring.h | 13 ++- ecal/core/include/ecal/ecal_process.h | 23 +++- ecal/core/include/ecal/ecal_publisher.h | 29 +++-- ecal/core/include/ecal/ecal_qos.h | 6 +- ecal/core/include/ecal/ecal_service.h | 4 +- ecal/core/include/ecal/ecal_subscriber.h | 24 ++-- ecal/core/include/ecal/ecal_timed_cb.h | 14 ++- ecal/core/include/ecal/ecal_tlayer.h | 4 +- ecal/core/include/ecal/ecal_util.h | 40 +++---- .../core/include/ecal/msg/capnproto/dynamic.h | 3 +- .../include/ecal/msg/capnproto/subscriber.h | 3 +- ecal/core/include/ecal/msg/protobuf/client.h | 2 +- .../include/ecal/msg/protobuf/publisher.h | 6 +- ecal/core/include/ecal/msg/publisher.h | 11 +- ecal/core/include/ecal/msg/string/publisher.h | 3 +- ecal/core/include/ecal/msg/subscriber.h | 10 +- ecal/core/src/ecal_clang.cpp | 32 ++++-- ecal/core/src/ecal_util.cpp | 1 + ecal/core/src/ecalc.cpp | 107 +++++++++++++----- ecal/core/src/pubsub/ecal_subgate.cpp | 1 + samples/CMakeLists.txt | 2 - samples/cpp/misc/event_rec/CMakeLists.txt | 39 ------- samples/cpp/misc/event_rec/src/event_rec.cpp | 65 ----------- samples/cpp/misc/event_snd/CMakeLists.txt | 39 ------- samples/cpp/misc/event_snd/src/event_snd.cpp | 64 ----------- testing/ecal/event_test/src/event_test.cpp | 1 + 44 files changed, 410 insertions(+), 378 deletions(-) delete mode 100644 samples/cpp/misc/event_rec/CMakeLists.txt delete mode 100644 samples/cpp/misc/event_rec/src/event_rec.cpp delete mode 100644 samples/cpp/misc/event_snd/CMakeLists.txt delete mode 100644 samples/cpp/misc/event_snd/src/event_snd.cpp diff --git a/cpack/innosetup.cmake b/cpack/innosetup.cmake index ef80d6b2f9..65e91d7f0d 100644 --- a/cpack/innosetup.cmake +++ b/cpack/innosetup.cmake @@ -29,4 +29,4 @@ else() COMMAND "${ISSC_PATH}" "${CPACK_TOPLEVEL_DIRECTORY}/innosetup/ecal_setup.iss" WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/innosetup" ) -endif() +endif() \ No newline at end of file diff --git a/ecal/core/include/ecal/cimpl/ecal_callback_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_callback_cimpl.h index fb0d76a97f..3baaf54e40 100644 --- a/ecal/core/include/ecal/cimpl/ecal_callback_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_callback_cimpl.h @@ -34,7 +34,7 @@ enum eCAL_Subscriber_Event sub_event_connected = 1, sub_event_disconnected = 2, sub_event_dropped = 3, - sub_event_timeout = 4, + sub_event_timeout = 4, //!< deprecated, will be removed in future eCAL versions sub_event_corrupted = 5, sub_event_update_connection = 6, }; @@ -106,12 +106,15 @@ struct SReceiveCallbackDataC **/ struct SPubEventCallbackDataC { - enum eCAL_Publisher_Event type; //!< event type - long long time; //!< event time stamp - long long clock; //!< event clock - const char* tid; //!< topic id of the connected subscriber (for pub_event_update_connection only) - const char* ttype; //!< topic type information of the connected subscriber (for pub_event_update_connection only) - const char* tdesc; //!< topic descriptor information of the connected subscriber (for pub_event_update_connection only) + enum eCAL_Publisher_Event type; //!< event type + long long time; //!< event time stamp + long long clock; //!< event clock + const char* tid; //!< topic id of the connected subscriber (for pub_event_update_connection only) + const char* tname; //!< topic type name of the connected subscriber (for pub_event_update_connection only) + const char* tencoding; //!< topic type encoding of the connected subscriber (for pub_event_update_connection only) + const char* tdesc; //!< topic type descriptor information of the connected subscriber (for pub_event_update_connection only) + + const char* ttype; //!< deprecated, please use new tname + tencoding fields }; /** @@ -119,12 +122,15 @@ struct SPubEventCallbackDataC **/ struct SSubEventCallbackDataC { - enum eCAL_Subscriber_Event type; //!< event type - long long time; //!< event time stamp - long long clock; //!< event clock - const char* tid; //!< topic id of the connected publisher (for sub_event_update_connection only) - const char* ttype; //!< topic type information of the connected publisher (for sub_event_update_connection only) - const char* tdesc; //!< topic descriptor information of the connected publisher (for sub_event_update_connection only) + enum eCAL_Subscriber_Event type; //!< event type + long long time; //!< event time stamp + long long clock; //!< event clock + const char* tid; //!< topic id of the connected publisher (for sub_event_update_connection only) + const char* tname; //!< topic type name of the connected publisher (for sub_event_update_connection only) + const char* tencoding; //!< topic type encoding of the connected publisher (for sub_event_update_connection only) + const char* tdesc; //!< topic type descriptor information of the connected publisher (for sub_event_update_connection only) + + const char* ttype; //!< deprecated, please use new tname + tencoding fields }; /** diff --git a/ecal/core/include/ecal/cimpl/ecal_event_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_event_cimpl.h index 6cc35b64eb..3eef1c01f5 100644 --- a/ecal/core/include/ecal/cimpl/ecal_event_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_event_cimpl.h @@ -19,7 +19,7 @@ /** * @file ecal_event_cimpl.h - * @brief eCAL event c interface + * @brief eCAL event c interface (deprecated, will be removed in future eCAL versions) **/ #ifndef ecal_event_cimpl_h_included @@ -34,49 +34,54 @@ extern "C" #endif /*__cplusplus*/ /** * @brief Open a named or unnamed event. + * @deprecated Will be removed in future eCAL versions. * * @param event_name_ Event name ("" == unnamed). * * @return Handle to opened event or NULL if failed. **/ - ECALC_API ECAL_HANDLE eCAL_Event_gOpenEvent(const char* event_name_); + ECALC_API_DEPRECATED ECAL_HANDLE eCAL_Event_gOpenEvent(const char* event_name_); /** * @brief Close an event. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Event handle. * * @return None zero if succeeded. **/ - ECALC_API int eCAL_Event_gCloseEvent(ECAL_HANDLE handle_); + ECALC_API_DEPRECATED int eCAL_Event_gCloseEvent(ECAL_HANDLE handle_); /** * @brief Set an event active. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Event handle. * * @return None zero if succeeded. **/ - ECALC_API int eCAL_Event_gSetEvent(ECAL_HANDLE handle_); + ECALC_API_DEPRECATED int eCAL_Event_gSetEvent(ECAL_HANDLE handle_); /** * @brief Wait for an event with timeout. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Event handle. * @param timeout_ Timeout in ms (-1 == infinite). * * @return None zero if succeeded. **/ - ECALC_API int eCAL_Event_gWaitForEvent(ECAL_HANDLE handle_, long timeout_); + ECALC_API_DEPRECATED int eCAL_Event_gWaitForEvent(ECAL_HANDLE handle_, long timeout_); /** * @brief Check whether an event is valid or not. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Event handle. * * @return None zero if event is valid. **/ - ECALC_API int eCAL_Event_gEventIsValid(ECAL_HANDLE handle_); + ECALC_API_DEPRECATED int eCAL_Event_gEventIsValid(ECAL_HANDLE handle_); #ifdef __cplusplus } #endif /*__cplusplus*/ diff --git a/ecal/core/include/ecal/cimpl/ecal_init_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_init_cimpl.h index 89dcacedd5..537760621e 100644 --- a/ecal/core/include/ecal/cimpl/ecal_init_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_init_cimpl.h @@ -31,7 +31,7 @@ #define eCAL_Init_Monitoring 0x08 /*!< Initialize Monitoring API */ #define eCAL_Init_Logging 0x10 /*!< Initialize Logging API */ #define eCAL_Init_TimeSync 0x20 /*!< Initialize Time API */ -#define eCAL_Init_RPC 0x40 /*!< Initialize RPC API */ +#define eCAL_Init_RPC 0x40 /*!< deprecated, will be removed in future eCAL versions */ #define eCAL_Init_ProcessReg 0x80 /*!< Initialize Process Registration API */ #define eCAL_Init_All (eCAL_Init_Publisher \ diff --git a/ecal/core/include/ecal/cimpl/ecal_log_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_log_cimpl.h index 03cccc9e32..c9291a06b3 100644 --- a/ecal/core/include/ecal/cimpl/ecal_log_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_log_cimpl.h @@ -56,25 +56,29 @@ extern "C" /** * @brief Mark the start of the user core process. + * @deprecated Will be removed in future eCAL versions. **/ - ECALC_API void eCAL_Logging_StartCoreTimer(); + ECALC_API_DEPRECATED void eCAL_Logging_StartCoreTimer(); /** * @brief Mark the stop of the user core process. + * @deprecated Will be removed in future eCAL versions. **/ - ECALC_API void eCAL_Logging_StopCoreTimer(); + ECALC_API_DEPRECATED void eCAL_Logging_StopCoreTimer(); /** * @brief Set the current measured core time in s (for user implemented measuring). + * @deprecated Will be removed in future eCAL versions. * * @param time_ The core time. **/ - ECALC_API void eCAL_Logging_SetCoreTime(double time_); + ECALC_API_DEPRECATED void eCAL_Logging_SetCoreTime(double time_); /** * @brief Returns the current measured core time in s. + * @deprecated Will be removed in future eCAL versions. **/ - ECALC_API double eCAL_Logging_GetCoreTime(); + ECALC_API_DEPRECATED double eCAL_Logging_GetCoreTime(); #ifdef __cplusplus } #endif /*__cplusplus*/ diff --git a/ecal/core/include/ecal/cimpl/ecal_process_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_process_cimpl.h index a271d36c8b..4d44ae3472 100644 --- a/ecal/core/include/ecal/cimpl/ecal_process_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_process_cimpl.h @@ -52,10 +52,11 @@ extern "C" /** * @brief Get unique host id. + * @deprecated Will be removed in future eCAL versions. * * @return The host id. **/ - ECALC_API int eCAL_Process_GetHostID(); + ECALC_API_DEPRECATED int eCAL_Process_GetHostID(); /** * @brief Get process unit name (defined with eCAL_Initialize). @@ -118,55 +119,61 @@ extern "C" /** * @brief Get CPU usage of current process. + * @deprecated Will be removed in future eCAL versions. * * @return The CPU usage in percent. **/ - ECALC_API float eCAL_Process_GetProcessCpuUsage(); + ECALC_API_DEPRECATED float eCAL_Process_GetProcessCpuUsage(); /** * @brief Get memory usage of current process. + * @deprecated Will be removed in future eCAL versions. * * @return The memory usage in bytes. **/ - ECALC_API unsigned long eCAL_Process_GetProcessMemory(); + ECALC_API_DEPRECATED unsigned long eCAL_Process_GetProcessMemory(); /** - * @deprecated Use the function eCAL_Process_GetWClock() instead + * @deprecated Will be removed in future eCAL versions. **/ - ECALC_API long long eCAL_Process_GetSClock(); + ECALC_API_DEPRECATED long long eCAL_Process_GetSClock(); /** - * @deprecated Use the function eCAL_Process_GetWBytes() instead + * @deprecated Will be removed in future eCAL versions. **/ - ECALC_API long long eCAL_Process_GetSBytes(); + ECALC_API_DEPRECATED long long eCAL_Process_GetSBytes(); /** * @brief Get the write clock of the current process. + * @deprecated Will be removed in future eCAL versions. * * @return The message write count per second. **/ - ECALC_API long long eCAL_Process_GetWClock(); + ECALC_API_DEPRECATED long long eCAL_Process_GetWClock(); /** * @brief Get the write bytes of the current process. + * @deprecated Will be removed in future eCAL versions. * * @return The message write bytes per second. **/ - ECALC_API long long eCAL_Process_GetWBytes(); + ECALC_API_DEPRECATED long long eCAL_Process_GetWBytes(); /** * @brief Get the read clock of the current process. + * @deprecated Will be removed in future eCAL versions. * * @return The message read count per second. **/ - ECALC_API long long eCAL_Process_GetRClock(); + ECALC_API_DEPRECATED long long eCAL_Process_GetRClock(); /** * @brief Get the read bytes of the current process. + * @deprecated Will be removed in future eCAL versions. * * @return The message read bytes per second. **/ - ECALC_API long long eCAL_Process_GetRBytes(); + ECALC_API_DEPRECATED long long eCAL_Process_GetRBytes(); /** * @brief Set process state info. diff --git a/ecal/core/include/ecal/cimpl/ecal_proto_dyn_json_subscriber_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_proto_dyn_json_subscriber_cimpl.h index 054f60ef6f..f83ebc67c3 100644 --- a/ecal/core/include/ecal/cimpl/ecal_proto_dyn_json_subscriber_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_proto_dyn_json_subscriber_cimpl.h @@ -19,7 +19,7 @@ /** * @file ecal_proto_dyn_json_subscriber_cimpl.h - * @brief eCAL subscriber c interface + * @brief eCAL subscriber c interface (deprecated, will be removed in future eCAL versions) **/ #ifndef ecal_proto_dyn_json_subscriber_cimpl_h_included @@ -36,25 +36,27 @@ extern "C" #endif /*__cplusplus*/ /** * @brief Create a subscriber. + * @deprecated Will be removed in future eCAL versions. * * @param topic_name_ Unique topic name. * * @return Handle to created subscriber or NULL if failed. **/ - ECALC_API ECAL_HANDLE eCAL_Proto_Dyn_JSON_Sub_Create(const char* topic_name_); + ECALC_API_DEPRECATED ECAL_HANDLE eCAL_Proto_Dyn_JSON_Sub_Create(const char* topic_name_); /** * @brief Destroy a subscriber. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Subscriber handle. * * @return None zero if succeeded. **/ - ECALC_API int eCAL_Proto_Dyn_JSON_Sub_Destroy(ECAL_HANDLE handle_); + ECALC_API_DEPRECATED int eCAL_Proto_Dyn_JSON_Sub_Destroy(ECAL_HANDLE handle_); /** * @brief Add callback function for incoming receives. - * @since eCAL 5.10.0 + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Subscriber handle. * @param callback_ The callback function to add. @@ -62,11 +64,11 @@ extern "C" * * @return None zero if succeeded. **/ - ECALC_API int eCAL_Proto_Dyn_JSON_Sub_AddReceiveCallback(ECAL_HANDLE handle_, ReceiveCallbackCT callback_, void* par_); + ECALC_API_DEPRECATED int eCAL_Proto_Dyn_JSON_Sub_AddReceiveCallback(ECAL_HANDLE handle_, ReceiveCallbackCT callback_, void* par_); /** - * @deprecated Please use eCAL_Proto_Dyn_JSON_Sub_AddReceiveCallback instead * @brief Add callback function for incoming receives. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Subscriber handle. * @param callback_ The callback function to add. @@ -78,12 +80,13 @@ extern "C" /** * @brief Remove callback function for incoming receives. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Subscriber handle. * * @return None zero if succeeded. **/ - ECALC_API int eCAL_Proto_Dyn_JSON_Sub_RemReceiveCallback(ECAL_HANDLE handle_); + ECALC_API_DEPRECATED int eCAL_Proto_Dyn_JSON_Sub_RemReceiveCallback(ECAL_HANDLE handle_); #ifdef __cplusplus } diff --git a/ecal/core/include/ecal/cimpl/ecal_publisher_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_publisher_cimpl.h index 9d92453df2..b64807ef4e 100644 --- a/ecal/core/include/ecal/cimpl/ecal_publisher_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_publisher_cimpl.h @@ -135,23 +135,25 @@ extern "C" /** * @brief Set publisher quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Publisher handle. * @param qos_ Quality of service policies. * * @return None zero if succeeded. **/ - ECALC_API int eCAL_Pub_SetQOS(ECAL_HANDLE handle_, struct SWriterQOSC qos_); + ECALC_API_DEPRECATED int eCAL_Pub_SetQOS(ECAL_HANDLE handle_, struct SWriterQOSC qos_); /** * @brief Get publisher quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Publisher handle. * @param qos_ Quality of service policies. * * @return None zero if succeeded. **/ - ECALC_API int eCAL_Pub_GetQOS(ECAL_HANDLE handle_, struct SWriterQOSC* qos_); + ECALC_API_DEPRECATED int eCAL_Pub_GetQOS(ECAL_HANDLE handle_, struct SWriterQOSC* qos_); /** * @brief Set publisher send mode for specific transport layer. @@ -166,13 +168,14 @@ extern "C" /** * @brief Set publisher maximum transmit bandwidth for the udp layer. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Publisher handle. * @param bandwidth_ Maximum bandwidth in bytes/s (-1 == unlimited). * * @return True if it succeeds, false if it fails. **/ - ECALC_API int eCAL_Pub_SetMaxBandwidthUDP(ECAL_HANDLE handle_, long bandwidth_); + ECALC_API_DEPRECATED int eCAL_Pub_SetMaxBandwidthUDP(ECAL_HANDLE handle_, long bandwidth_); /** * @brief Set publisher maximum number of used shared memory buffers. diff --git a/ecal/core/include/ecal/cimpl/ecal_qos_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_qos_cimpl.h index 01acc0c3e6..9570531401 100644 --- a/ecal/core/include/ecal/cimpl/ecal_qos_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_qos_cimpl.h @@ -19,7 +19,7 @@ /** * @file ecal_qos_cimpl.h - * @brief eCAL quality of service settings + * @brief eCAL quality of service settings (deprecated, will be removed in future eCAL versions) **/ #ifndef ecal_qos_cimpl_h_included @@ -27,6 +27,7 @@ /** * @brief eCAL QOS history kind mode. + * @deprecated Will be removed in future eCAL versions. **/ enum eQOSPolicy_HistoryKindC { @@ -36,6 +37,7 @@ enum eQOSPolicy_HistoryKindC /** * @brief eCAL QOS reliability mode. + * @deprecated Will be removed in future eCAL versions. **/ enum eQOSPolicy_ReliabilityC { @@ -45,6 +47,7 @@ enum eQOSPolicy_ReliabilityC /** * @brief eCAL data writer QOS settings. + * @deprecated Will be removed in future eCAL versions. **/ struct SWriterQOSC { @@ -55,6 +58,7 @@ struct SWriterQOSC /** * @brief eCAL data reader QOS settings. + * @deprecated Will be removed in future eCAL versions. **/ struct SReaderQOSC { diff --git a/ecal/core/include/ecal/cimpl/ecal_service_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_service_cimpl.h index 554f55b3b9..79ebd91737 100644 --- a/ecal/core/include/ecal/cimpl/ecal_service_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_service_cimpl.h @@ -25,10 +25,10 @@ #pragma once #ifdef _MSC_VER -#pragma message("WARNING: This header file is deprecated. It will be removed in future eCAL versions. Please include and / or instead") +#pragma message("WARNING: The header file cimpl/ecal_service_cimpl.h is deprecated. It will be removed in future eCAL versions. Please include and / or instead") #endif /*_MSC_VER*/ #ifdef __GNUC__ -#pragma message "WARNING: This header file is deprecated. It will be removed in future eCAL versions. Please include and / or instead" +#pragma message "WARNING: The header file cimpl/ecal_service_cimpl.h is deprecated. It will be removed in future eCAL versions. Please include and / or instead" #endif /* __GNUC__ */ #include diff --git a/ecal/core/include/ecal/cimpl/ecal_subscriber_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_subscriber_cimpl.h index 2e7efb979d..206fb87420 100644 --- a/ecal/core/include/ecal/cimpl/ecal_subscriber_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_subscriber_cimpl.h @@ -68,23 +68,25 @@ extern "C" /** * @brief Set subscriber quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Subscriber handle. * @param qos_ Quality of service policies. * * @return None zero if succeeded. **/ - ECALC_API int eCAL_Sub_SetQOS(ECAL_HANDLE handle_, struct SReaderQOSC qos_); + ECALC_API_DEPRECATED int eCAL_Sub_SetQOS(ECAL_HANDLE handle_, struct SReaderQOSC qos_); /** * @brief Get subscriber quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Subscriber handle. * @param qos_ Quality of service policies. * * @return None zero if succeeded. **/ - ECALC_API int eCAL_Sub_GetQOS(ECAL_HANDLE handle_, struct SReaderQOSC* qos_); + ECALC_API_DEPRECATED int eCAL_Sub_GetQOS(ECAL_HANDLE handle_, struct SReaderQOSC* qos_); /** * @brief Set a set of id's to prefiltering topics (see eCAL_Pub_SetID). @@ -248,6 +250,30 @@ extern "C" **/ ECALC_API int eCAL_Sub_RemEventCallback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_); + /** + * @brief Gets type name of the connected topic. + * + * @param handle_ Subscriber handle. + * @param [out] buf_ Pointer to store the subscriber type name string. + * @param buf_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_Sub_GetTypeName(ECAL_HANDLE handle_, void* buf_, int buf_len_); + + /** + * @brief Gets encoding of the connected topic. + * + * @param handle_ Subscriber handle. + * @param [out] buf_ Pointer to store the subscriber encoding string. + * @param buf_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if + * eCAL should allocate the buffer for you (see eCAL_FreeMem). + * + * @return Encoding buffer length or zero if failed. + **/ + ECALC_API int eCAL_Sub_GetEncoding(ECAL_HANDLE handle_, void* buf_, int buf_len_); + /** * @brief Gets description of the connected topic. * @@ -261,15 +287,15 @@ extern "C" ECALC_API int eCAL_Sub_GetDescription(ECAL_HANDLE handle_, void* buf_, int buf_len_); /** - * @brief Set the timeout parameter for triggering - * the timeout callback. + * @brief Set the timeout parameter for triggering the timeout callback. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Subscriber handle. * @param timeout_ The timeout in milliseconds. * * @return True if succeeded, false if not. **/ - ECALC_API int eCAL_Sub_SetTimeout(ECAL_HANDLE handle_, int timeout_); + ECALC_API_DEPRECATED int eCAL_Sub_SetTimeout(ECAL_HANDLE handle_, int timeout_); /** * @brief Dump the whole class state into a string buffer. diff --git a/ecal/core/include/ecal/cimpl/ecal_tlayer_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_tlayer_cimpl.h index 3a00bd87ce..3cf1f1cd94 100644 --- a/ecal/core/include/ecal/cimpl/ecal_tlayer_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_tlayer_cimpl.h @@ -34,7 +34,7 @@ enum eTransportLayerC tlayer_udp_mc = 1, tlayer_shm = 4, tlayer_tcp = 5, - tlayer_inproc = 42, + tlayer_inproc = 42, /*!< deprecated, whole layer will be removed in future eCAL versions */ tlayer_all = 255 }; diff --git a/ecal/core/include/ecal/cimpl/ecal_util_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_util_cimpl.h index 8e6de2a150..3393b9d7bb 100644 --- a/ecal/core/include/ecal/cimpl/ecal_util_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_util_cimpl.h @@ -77,6 +77,30 @@ extern "C" **/ 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. * @@ -130,6 +154,7 @@ extern "C" /** * @brief Gets type name of the specified topic. + * @deprecated Will be removed in future eCAL versions. Please use eCAL_Util_GetTopicTypeName and eCAL_Util_GetTopicEncoding instead. * * @param topic_name_ Topic name. * @param [out] topic_type_ Pointer to store the type name information. @@ -138,11 +163,11 @@ extern "C" * * @return Type name buffer length or zero if failed. **/ - // [[deprecated]] - ECALC_API int eCAL_Util_GetTypeName(const char* topic_name_, void* topic_type_, int topic_type_len_); + ECALC_API_DEPRECATED int eCAL_Util_GetTypeName(const char* topic_name_, void* topic_type_, int topic_type_len_); /** * @brief Gets type description of the specified topic. + * @deprecated Will be removed in future eCAL versions. Please use eCAL_Util_GetTopicDescription instead. * * @param topic_name_ Topic name. * @param [out] topic_desc_ Pointer to store the type description information. @@ -151,8 +176,7 @@ extern "C" * * @return Type description buffer length or zero if failed. **/ - // [[deprecated]] - ECALC_API int eCAL_Util_GetDescription(const char* topic_name_, void* topic_desc_, int topic_desc_len_); + ECALC_API_DEPRECATED int eCAL_Util_GetDescription(const char* topic_name_, void* topic_desc_, int topic_desc_len_); #ifdef __cplusplus } #endif /*__cplusplus*/ diff --git a/ecal/core/include/ecal/ecal_clang.h b/ecal/core/include/ecal/ecal_clang.h index 74a3a7c3f0..52f4dc4b10 100644 --- a/ecal/core/include/ecal/ecal_clang.h +++ b/ecal/core/include/ecal/ecal_clang.h @@ -19,7 +19,7 @@ /** * @file ecal_clang.h - * @brief eCAL C language interface (to wrap ecal into other languages easily) + * @brief eCAL C language interface, to wrap ecal into other languages easily (deprecated, will be removed in future eCAL versions) **/ #ifndef ECAL_CLANG_H_INCLUDED @@ -266,6 +266,7 @@ ECAL_API bool pub_set_description(ECAL_HANDLE handle_, const char* topic_desc_, /** * @brief Set publisher quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Publisher handle. * @param qos_ Quality of service policies. @@ -276,6 +277,7 @@ ECAL_API bool pub_set_qos(ECAL_HANDLE handle_, struct SWriterQOSC qos_); /** * @brief Get publisher quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Publisher handle. * @param qos_ Quality of service policies. @@ -378,6 +380,7 @@ ECAL_API bool sub_destroy(ECAL_HANDLE handle_); /** * @brief Set subscriber quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Subscriber handle. * @param qos_ Quality of service policies. @@ -388,6 +391,7 @@ ECAL_API bool sub_set_qos(ECAL_HANDLE handle_, struct SReaderQOSC qos_); /** * @brief Get subscriber quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @param handle_ Subscriber handle. * @param qos_ Quality of service policies. diff --git a/ecal/core/include/ecal/ecal_client.h b/ecal/core/include/ecal/ecal_client.h index 9c28e130cf..847a1b414b 100644 --- a/ecal/core/include/ecal/ecal_client.h +++ b/ecal/core/include/ecal/ecal_client.h @@ -120,7 +120,8 @@ namespace eCAL ECAL_API bool Call(const std::string& method_name_, const std::string& request_, int timeout_, ServiceResponseVecT* service_response_vec_); /** - * @brief Call method of this service, for specific host (deprecated). + * @brief Call method of this service, for specific host. + * @deprecated Please use the create method bool Call(const std::string& method_name_, const std::string& request_, int timeout_, ServiceResponseVecT* service_response_vec_) instead. This function will be removed in future eCAL versions. * * @param host_name_ Host name. * @param method_name_ Method name. @@ -130,7 +131,7 @@ namespace eCAL * * @return True if successful. **/ - ECAL_DEPRECATE_SINCE_5_10("Please use the create method bool Call(const std::string& method_name_, const std::string& request_, int timeout_, ServiceResponseVecT* service_response_vec_) instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_10("Please use the create method bool Call(const std::string& method_name_, const std::string& request_, int timeout_, ServiceResponseVecT* service_response_vec_) instead. This function will be removed in future eCAL versions.") ECAL_API bool Call(const std::string& host_name_, const std::string& method_name_, const std::string& request_, struct SServiceResponse& service_info_, std::string& response_); /** diff --git a/ecal/core/include/ecal/ecal_event.h b/ecal/core/include/ecal/ecal_event.h index 5ce11a9018..78b582d4b3 100644 --- a/ecal/core/include/ecal/ecal_event.h +++ b/ecal/core/include/ecal/ecal_event.h @@ -19,66 +19,80 @@ /** * @file ecal_event.h - * @brief eCAL event interface + * @brief eCAL event interface (deprecated, will be removed in future eCAL versions) **/ #pragma once #include #include +#include + #include namespace eCAL { /** * @brief Open a named or unnamed event. + * @deprecated Will be removed in future eCAL versions. * * @param [out] event_ Returned event struct. * @param event_name_ Event name ("" == unnamed). * * @return True if succeeded. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API bool gOpenEvent(eCAL::EventHandleT* event_, const std::string& event_name_ = ""); /** * @brief Close an event. + * @deprecated Will be removed in future eCAL versions. * * @param event_ Event struct. * * @return True if succeeded. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API bool gCloseEvent(const EventHandleT& event_); /** * @brief Set an event active. + * @deprecated Will be removed in future eCAL versions. * * @param event_ Event struct. * * @return True if succeeded. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API bool gSetEvent(const EventHandleT& event_); /** * @brief Wait for an event with timeout. + * @deprecated Will be removed in future eCAL versions. * * @param event_ Event struct. * @param timeout_ Timeout in ms (-1 == infinite). * * @return True if succeeded. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API bool gWaitForEvent(const EventHandleT& event_, long timeout_); /** * @brief Invalidate an event. + * @deprecated Will be removed in future eCAL versions. * * @return True if event is invalidated. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API bool gInvalidateEvent(EventHandleT* event_); /** * @brief Check whether an event is valid or not. + * @deprecated Will be removed in future eCAL versions. * * @return True if event is valid. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API bool gEventIsValid(const EventHandleT& event_); } diff --git a/ecal/core/include/ecal/ecal_eventhandle.h b/ecal/core/include/ecal/ecal_eventhandle.h index eabb76bc9e..11aa31d6c5 100644 --- a/ecal/core/include/ecal/ecal_eventhandle.h +++ b/ecal/core/include/ecal/ecal_eventhandle.h @@ -19,11 +19,13 @@ /** * @file ecal_eventhandle.h - * @brief eCAL event handle + * @brief eCAL event handle (deprecated, will be removed in future eCAL versions) **/ #pragma once +#include + #include #include @@ -31,6 +33,7 @@ namespace eCAL { /** * @brief eCAL event callback handle. + * @deprecated Will be removed in future eCAL versions. **/ struct SEventHandle { diff --git a/ecal/core/include/ecal/ecal_log.h b/ecal/core/include/ecal/ecal_log.h index bd49e7be04..f646de883b 100644 --- a/ecal/core/include/ecal/ecal_log.h +++ b/ecal/core/include/ecal/ecal_log.h @@ -26,6 +26,8 @@ #include #include +#include + #include namespace eCAL @@ -67,22 +69,30 @@ namespace eCAL /** * @brief Mark the start of the user core process. + * @deprecated Will be removed in future eCAL versions. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API void StartCoreTimer(); /** * @brief Mark the stop of the user core process. + * @deprecated Will be removed in future eCAL versions. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API void StopCoreTimer(); /** * @brief Set the current measured core time in s (for user implemented measuring). + * @deprecated Will be removed in future eCAL versions. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API void SetCoreTime(double time_); /** * @brief Returns the current measured core time in s. + * @deprecated Will be removed in future eCAL versions. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API double GetCoreTime(); } } diff --git a/ecal/core/include/ecal/ecal_monitoring.h b/ecal/core/include/ecal/ecal_monitoring.h index ed247a8bb0..11cb94e154 100644 --- a/ecal/core/include/ecal/ecal_monitoring.h +++ b/ecal/core/include/ecal/ecal_monitoring.h @@ -27,6 +27,7 @@ #include #include #include + #include namespace eCAL @@ -62,11 +63,13 @@ namespace eCAL /** * @brief Get monitoring as serialized protobuf string. + * @deprecated Will be removed in future eCAL versions. Please use GetMonitoring(std::string& mon_, unsigned int entities_) instead. * * @param [out] mon_ String to store the monitoring information. * * @return Monitoring buffer length or zero if failed. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions. Please use GetMonitoring(std::string& mon_, unsigned int entities_) instead.") ECAL_API int GetMonitoring(std::string& mon_); /** @@ -100,25 +103,27 @@ namespace eCAL ECAL_API int GetLogging(std::string& log_); /** - * @brief Publish monitoring protobuf message (deprecated). + * @brief Publish monitoring protobuf message. + * @deprecated Will be removed in future eCAL versions. * * @param state_ Switch publishing on/off. * @param name_ Monitoring topic name. * * @return Zero if succeeded. **/ - ECAL_DEPRECATE_SINCE_5_12("Function is no longer implemented. Instead use GetMonitoring") + ECAL_DEPRECATE_SINCE_5_12("Will be removed in future eCAL versions.") ECAL_API int PubMonitoring(bool state_, std::string name_ = "ecal.monitoring"); /** - * @brief Publish logging protobuf message (deprecated). + * @brief Publish logging protobuf message. + * @deprecated Will be removed in future eCAL versions. * * @param state_ Switch publishing on/off. * @param name_ Logging topic name. * * @return Zero if succeeded. **/ - ECAL_DEPRECATE_SINCE_5_12("Function is no longer implemented. Instead use GetLogging") + ECAL_DEPRECATE_SINCE_5_12("Will be removed in future eCAL versions.") ECAL_API int PubLogging(bool state_, std::string name_ = "ecal.logging"); } /** @example monitoring_rec.cpp diff --git a/ecal/core/include/ecal/ecal_process.h b/ecal/core/include/ecal/ecal_process.h index ec89a273d2..827dab9f69 100644 --- a/ecal/core/include/ecal/ecal_process.h +++ b/ecal/core/include/ecal/ecal_process.h @@ -65,10 +65,11 @@ namespace eCAL /** * @brief Get unique host id. + * @deprecated Will be removed in future eCAL versions. * * @return Host id or zero if failed. **/ - ECAL_DEPRECATE_SINCE_5_10("This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_10("Will be removed in future eCAL versions.") ECAL_API int GetHostID(); /** @@ -155,57 +156,69 @@ namespace eCAL /** * @brief Get CPU usage of current process. + * @deprecated Will be removed in future eCAL versions. * * @return The CPU usage in percent. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API float GetProcessCpuUsage(); /** * @brief Get memory usage of current process. + * @deprecated Will be removed in future eCAL versions. * * @return The memory usage in bytes. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API unsigned long GetProcessMemory(); /** - * @deprecated Use the function GetWClock() instead + * @deprecated Will be removed in future eCAL versions. **/ - ECAL_DEPRECATE_SINCE_5_4("use GetWClock() instead") + ECAL_DEPRECATE_SINCE_5_4("Will be removed in future eCAL versions.") ECAL_API long long GetSClock(); /** - * @deprecated Use the function GetWBytes() instead + * @deprecated Will be removed in future eCAL versions. **/ - ECAL_DEPRECATE_SINCE_5_4("use GetWBytes() instead") + ECAL_DEPRECATE_SINCE_5_4("Will be removed in future eCAL versions.") ECAL_API long long GetSBytes(); /** * @brief Get the write clock of the current process. + * @deprecated Will be removed in future eCAL versions. * * @return The message write count per second. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API long long GetWClock(); /** * @brief Get the write bytes of the current process. + * @deprecated Will be removed in future eCAL versions. * * @return The message write bytes per second. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API long long GetWBytes(); /** * @brief Get the read clock of the current process. + * @deprecated Will be removed in future eCAL versions. * * @return The message read count per second. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API long long GetRClock(); /** * @brief Get the read bytes of the current process. + * @deprecated Will be removed in future eCAL versions. * * @return The message read bytes per second. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API long long GetRBytes(); /** diff --git a/ecal/core/include/ecal/ecal_publisher.h b/ecal/core/include/ecal/ecal_publisher.h index 78f7876834..199016b1b8 100644 --- a/ecal/core/include/ecal/ecal_publisher.h +++ b/ecal/core/include/ecal/ecal_publisher.h @@ -82,12 +82,13 @@ namespace eCAL /** * @brief Constructor. + * @deprecated Please use the constructor CPublisher(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions. * * @param topic_name_ Unique topic name. * @param topic_type_ Type name. * @param topic_desc_ Type description (optional). **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CPublisher(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CPublisher(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions.") ECAL_API CPublisher(const std::string& topic_name_, const std::string& topic_type_, const std::string& topic_desc_ = ""); /** @@ -132,6 +133,7 @@ namespace eCAL /** * @brief Creates this object. + * @deprecated Please use the create method bool Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions. * * @param topic_name_ Unique topic name. * @param topic_type_ Type name (optional). @@ -139,7 +141,7 @@ namespace eCAL * * @return True if it succeeds, false if it fails. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the create method bool Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the create method bool Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions.") ECAL_API bool Create(const std::string& topic_name_, const std::string& topic_type_, const std::string& topic_desc_ = ""); /** @@ -173,22 +175,24 @@ namespace eCAL /** * @brief Setup topic type name. + * @deprecated Please use the method bool SetDataTypeInformation(const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions. * * @param topic_type_name_ Topic type name. * * @return True if it succeeds, false if it fails. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method bool SetDataTypeInformation(const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6") + ECAL_DEPRECATE_SINCE_5_13("Please use the method bool SetDataTypeInformation(const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions.") ECAL_API bool SetTypeName(const std::string& topic_type_name_); /** * @brief Setup topic description. + * @deprecated Please use the method bool SetDataTypeInformation(const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions. * * @param topic_desc_ Description string. * * @return True if it succeeds, false if it fails. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method bool SetDataTypeInformation(const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6") + ECAL_DEPRECATE_SINCE_5_13("Please use the method bool SetDataTypeInformation(const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions.") ECAL_API bool SetDescription(const std::string& topic_desc_); /** @@ -241,18 +245,22 @@ namespace eCAL /** * @brief Set publisher quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @param qos_ Quality of service policies. * * @return True if it succeeds, false if it fails. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API bool SetQOS(const QOS::SWriterQOS& qos_); /** * @brief Get current publisher quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @return Quality of service attributes. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API QOS::SWriterQOS GetQOS(); /** @@ -267,11 +275,13 @@ namespace eCAL /** * @brief Set publisher maximum transmit bandwidth for the udp layer. + * @deprecated Will be removed in future eCAL versions. * * @param bandwidth_ Maximum bandwidth in bytes/s (-1 == unlimited). * * @return True if it succeeds, false if it fails. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API bool SetMaxBandwidthUDP(long bandwidth_); /** @@ -402,9 +412,8 @@ namespace eCAL /** * @brief Send a message to all subscribers synchronized with acknowledge timeout (see also ShmSetAcknowledgeTimeout). + * @deprecated Please use the method size_t Send(CPayloadWriter& payload_, long long time_, long long acknowledge_timeout_ms_) const instead. This function will be removed in future eCAL versions. * - * This synchronized mode is currently implemented for local interprocess communication (shm-ecal layer) only. - * * @param buf_ Pointer to content buffer. * @param len_ Length of buffer. * @param time_ Send time (-1 = use eCAL system time in us). @@ -412,7 +421,7 @@ namespace eCAL * * @return Number of bytes sent. **/ - ECAL_DEPRECATE_SINCE_5_12("Please use the method size_t Send(CPayloadWriter& payload_, long long time_, long long acknowledge_timeout_ms_) const instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_12("Please use the method size_t Send(CPayloadWriter& payload_, long long time_, long long acknowledge_timeout_ms_) const instead. This function will be removed in future eCAL versions.") ECAL_API size_t SendSynchronized(const void* const buf_, size_t len_, long long time_, long long acknowledge_timeout_ms_) const { return Send(buf_, len_, time_, acknowledge_timeout_ms_); @@ -507,18 +516,20 @@ namespace eCAL /** * @brief Gets type of the connected topic. + * @deprecated Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @return The type name. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the SDataTypeInformation variable. This function will be removed in future eCAL versions.") ECAL_API std::string GetTypeName() const; /** * @brief Gets description of the connected topic. + * @deprecated Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the descriptor from the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @return The description. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the descriptor from the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the descriptor from the SDataTypeInformation variable. This function will be removed in future eCAL versions.") ECAL_API std::string GetDescription() const; /** diff --git a/ecal/core/include/ecal/ecal_qos.h b/ecal/core/include/ecal/ecal_qos.h index 520d4212df..78c8218f64 100644 --- a/ecal/core/include/ecal/ecal_qos.h +++ b/ecal/core/include/ecal/ecal_qos.h @@ -19,7 +19,7 @@ /** * @file ecal_qos.h - * @brief eCAL quality of service settings + * @brief eCAL quality of service settings (deprecated, will be removed in future eCAL versions) **/ #pragma once @@ -32,6 +32,7 @@ namespace eCAL { /** * @brief eCAL QOS history kind mode. + * @deprecated Will be removed in future eCAL versions. **/ enum eQOSPolicy_HistoryKind { @@ -41,6 +42,7 @@ namespace eCAL /** * @brief eCAL QOS reliability mode. + * @deprecated Will be removed in future eCAL versions. **/ enum eQOSPolicy_Reliability { @@ -50,6 +52,7 @@ namespace eCAL /** * @brief eCAL data writer QOS settings. + * @deprecated Will be removed in future eCAL versions. **/ struct ECAL_API SWriterQOS { @@ -66,6 +69,7 @@ namespace eCAL /** * @brief eCAL data reader QOS settings. + * @deprecated Will be removed in future eCAL versions. **/ struct ECAL_API SReaderQOS { diff --git a/ecal/core/include/ecal/ecal_service.h b/ecal/core/include/ecal/ecal_service.h index e909310c4a..850b683d32 100644 --- a/ecal/core/include/ecal/ecal_service.h +++ b/ecal/core/include/ecal/ecal_service.h @@ -25,10 +25,10 @@ #pragma once #ifdef _MSC_VER -#pragma message("WARNING: This header file is deprecated. It will be removed in future eCAL versions. Please include and / or instead") +#pragma message("WARNING: The header file ecal_service.h is deprecated. It will be removed in future eCAL versions. Please include and / or instead") #endif /*_MSC_VER*/ #ifdef __GNUC__ -#pragma message "WARNING: This header file is deprecated. It will be removed in future eCAL versions. Please include and / or instead" +#pragma message "WARNING: The header file ecal_service.h is deprecated. It will be removed in future eCAL versions. Please include and / or instead" #endif /* __GNUC__ */ #include diff --git a/ecal/core/include/ecal/ecal_subscriber.h b/ecal/core/include/ecal/ecal_subscriber.h index ba6d7f6664..9eff791399 100644 --- a/ecal/core/include/ecal/ecal_subscriber.h +++ b/ecal/core/include/ecal/ecal_subscriber.h @@ -92,12 +92,13 @@ namespace eCAL /** * @brief Constructor. + * @deprecated Please use the constructor CSubscriber(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions.. * * @param topic_name_ Unique topic name. * @param topic_type_ Type name (optional for type checking). * @param topic_desc_ Type description (optional for description checking). **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CSubscriber(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CSubscriber(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions.") ECAL_API CSubscriber(const std::string& topic_name_, const std::string& topic_type_, const std::string& topic_desc_ = ""); /** @@ -142,6 +143,7 @@ namespace eCAL /** * @brief Creates this object. + * @deprecated Please use the create method bool Create(const std::string& topic_name_, const STopicInformation& topic_info_) instead. This function will be removed in future eCAL versions. * * @param topic_name_ Unique topic name. * @param topic_type_ Type name (optional for type checking). @@ -149,7 +151,7 @@ namespace eCAL * * @return true if it succeeds, false if it fails. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the create method bool Create(const std::string& topic_name_, const STopicInformation& topic_info_) instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the create method bool Create(const std::string& topic_name_, const STopicInformation& topic_info_) instead. This function will be removed in future eCAL versions.") ECAL_API bool Create(const std::string& topic_name_, const std::string& topic_type_, const std::string& topic_desc_ = ""); /** @@ -182,18 +184,22 @@ namespace eCAL /** * @brief Set subscriber quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @param qos_ Quality of service policies. * * @return True if it succeeds, false if it fails. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API bool SetQOS(const QOS::SReaderQOS& qos_); /** * @brief Get current subscriber quality of service attributes. + * @deprecated Will be removed in future eCAL versions. * * @return Quality of service attributes. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API QOS::SReaderQOS GetQOS(); /** @@ -228,6 +234,7 @@ namespace eCAL /** * @brief Receive a message from the publisher. + * @deprecated Please use the method bool ReceiveBuffer(std::string& buf_, long long* time_ = nullptr, int rcv_timeout_ = 0) instead. This function will be removed in future eCAL versions. * * @param [out] buf_ Standard string for copying message content. * @param [out] time_ Time from publisher in us (default = nullptr). @@ -235,7 +242,7 @@ namespace eCAL * * @return Length of received buffer. **/ - ECAL_DEPRECATE_SINCE_5_10("Please use the method bool ReceiveBuffer(std::string& buf_, long long* time_ = nullptr, int rcv_timeout_ = 0) instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_10("Please use the method bool ReceiveBuffer(std::string& buf_, long long* time_ = nullptr, int rcv_timeout_ = 0) instead. This function will be removed in future eCAL versions.") ECAL_API size_t Receive(std::string& buf_, long long* time_ = nullptr, int rcv_timeout_ = 0) const; /** @@ -307,18 +314,20 @@ namespace eCAL /** * @brief Gets type of the connected topic. + * @deprecated Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @return The type name. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the SDataTypeInformation variable. This function will be removed in future eCAL versions.") ECAL_API std::string GetTypeName() const; /** * @brief Gets description of the connected topic. + * @deprecated Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the descriptor from the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @return The description. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the descriptor from the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the descriptor from the SDataTypeInformation variable. This function will be removed in future eCAL versions.") ECAL_API std::string GetDescription() const; /** @@ -329,13 +338,14 @@ namespace eCAL ECAL_API SDataTypeInformation GetDataTypeInformation() const; /** - * @brief Set the timeout parameter for triggering - * the timeout callback. + * @brief Set the timeout parameter for triggering the timeout callback. + * @deprecated Will be removed in future eCAL versions. * * @param timeout_ The timeout in milliseconds. * * @return True if succeeded, false if not. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") ECAL_API bool SetTimeout(int timeout_); /** diff --git a/ecal/core/include/ecal/ecal_timed_cb.h b/ecal/core/include/ecal/ecal_timed_cb.h index 82b95736a9..dd16eb7a1f 100644 --- a/ecal/core/include/ecal/ecal_timed_cb.h +++ b/ecal/core/include/ecal/ecal_timed_cb.h @@ -19,7 +19,7 @@ /** * @file ecal_timed_cb.h - * @brief eCAL timer callback class (for internal use only !!) + * @brief eCAL timer callback class (deprecated, will be removed in future eCAL versions) **/ #pragma once @@ -30,6 +30,8 @@ #include #include +#include + #include "ecal_process.h" namespace eCAL @@ -38,11 +40,13 @@ namespace eCAL /** * @brief Timer callback function type. + * @deprecated Will be removed in future eCAL versions. **/ typedef std::function TimerCallbackT; /** * @brief eCAL timer callback class. + * @deprecated Will be removed in future eCAL versions. * * The CTimedCB class is used to realize simple time triggered callbacks. **/ @@ -51,16 +55,20 @@ namespace eCAL public: /** * @brief Constructor. + * @deprecated Will be removed in future eCAL versions. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") CTimedCB() : m_stop(false), m_running(false) {} /** * @brief Constructor. + * @deprecated Will be removed in future eCAL versions. * * @param timeout_ Timer callback loop time in ms. * @param callback_ The callback function. * @param delay_ Timer callback delay for first call in ms. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") CTimedCB(int timeout_, TimerCallbackT callback_, int delay_ = 0) : m_stop(false), m_running(false) { Start(timeout_, callback_, delay_); } /** @@ -75,6 +83,7 @@ namespace eCAL /** * @brief Start the timer. + * @deprecated Will be removed in future eCAL versions. * * @param timeout_ Timer callback loop time in ms. * @param callback_ The callback function. @@ -82,6 +91,7 @@ namespace eCAL * * @return True if timer could be started. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") bool Start(const int timeout_, TimerCallbackT callback_, const int delay_ = 0) { assert(m_running == false); @@ -95,9 +105,11 @@ namespace eCAL /** * @brief Stop the timer. + * @deprecated Will be removed in future eCAL versions. * * @return True if timer could be stopped. **/ + ECAL_DEPRECATE_SINCE_5_13("Will be removed in future eCAL versions.") bool Stop() { if (!m_running) return(false); diff --git a/ecal/core/include/ecal/ecal_tlayer.h b/ecal/core/include/ecal/ecal_tlayer.h index f746561de3..8c0ed69435 100644 --- a/ecal/core/include/ecal/ecal_tlayer.h +++ b/ecal/core/include/ecal/ecal_tlayer.h @@ -39,7 +39,7 @@ namespace eCAL tlayer_udp_mc = 1, tlayer_shm = 4, tlayer_tcp = 5, - tlayer_inproc = 42, + tlayer_inproc = 42, //!< deprecated, whole layer will be removed in future eCAL versions tlayer_all = 255 }; @@ -68,7 +68,7 @@ namespace eCAL } eSendMode sm_udp_mc; //!< udp multicast eSendMode sm_shm; //!< shared memory - eSendMode sm_inproc; //!< inner process (inner process memory forwarding only) + eSendMode sm_inproc; //!< deprecated, whole layer will be removed in future eCAL versions */ eSendMode sm_tcp; //!< tcp }; } diff --git a/ecal/core/include/ecal/ecal_util.h b/ecal/core/include/ecal/ecal_util.h index af6b8312e4..bbd004e2fb 100644 --- a/ecal/core/include/ecal/ecal_util.h +++ b/ecal/core/include/ecal/ecal_util.h @@ -24,7 +24,6 @@ #pragma once -#include #include #include #include @@ -44,10 +43,11 @@ namespace eCAL * @brief Retrieve eCAL home path (for starting eCAL applications). * Windows: $ECAL_HOME/eCAL * Linux: $HOME/.ecal + * @deprecated Please use the method std::string GeteCALConfigPath() instead. This function will be removed in future eCAL versions. * * @return eCAL home path. **/ - ECAL_DEPRECATE_SINCE_5_10("Please use the method std::string GeteCALConfigPath() instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_10("Please use the method std::string GeteCALConfigPath() instead. This function will be removed in future eCAL versions.") ECAL_API std::string GeteCALHomePath(); /** @@ -88,11 +88,11 @@ namespace eCAL /** * @brief Retrieve full eCAL default ini file name. * - * @deprecated Use GeteCALActiveIniFile() instead + * @deprecated Please use the method std::string GeteCALActiveIniFile() instead. This function will be removed in future eCAL versions. * * @return eCAL default ini file name. **/ - ECAL_DEPRECATE_SINCE_5_10("Please use the method std::string GeteCALActiveIniFile() instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_10("Please use the method std::string GeteCALActiveIniFile() instead. This function will be removed in future eCAL versions.") ECAL_API std::string GeteCALDefaultIniFile(); /** @@ -161,44 +161,48 @@ namespace eCAL /** * @brief Gets type name of the specified topic. + * @deprecated Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @param topic_name_ Topic name. * @param topic_type_ String to store type name. * * @return True if succeeded. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the SDataTypeInformation variable. This function will be removed in future eCAL versions.") ECAL_API bool GetTopicTypeName(const std::string& topic_name_, std::string& topic_type_); /** * @brief Gets type name of the specified topic. + * @deprecated Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @param topic_name_ Topic name. * * @return Topic type name. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the SDataTypeInformation variable. This function will be removed in future eCAL versions.") ECAL_API std::string GetTopicTypeName(const std::string& topic_name_); /** * @brief Gets description of the specified topic. + * @deprecated Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the descriptor from the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @param topic_name_ Topic name. * @param topic_desc_ String to store description. * * @return True if succeeded. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the descriptor from the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the descriptor from the STopicInformation variable. This function will be removed in future eCAL versions.") ECAL_API bool GetTopicDescription(const std::string& topic_name_, std::string& topic_desc_); /** * @brief Gets description of the specified topic. + * @deprecated Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the descriptor from the STopicInformation variable. This function will be removed in future eCAL versions. * * @param topic_name_ Topic name. * * @return Topic description. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the descriptor from the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the descriptor from the STopicInformation variable. This function will be removed in future eCAL versions.") ECAL_API std::string GetTopicDescription(const std::string& topic_name_); /** @@ -252,52 +256,48 @@ namespace eCAL /** * @brief Gets type name of the specified topic. + * @deprecated Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the SDataTypeInformation variable. This function will be removed in future eCAL versions. * - * This function is deprecated with eCAL 5.10. Please use GetTopicDataTypeInformation. - * * @param topic_name_ Topic name. * @param topic_type_ String to store type name. * * @return True if succeeded. **/ - ECAL_DEPRECATE_SINCE_5_10("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_10("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the SDataTypeInformation variable. This function will be removed in future eCAL versions.") ECAL_API bool GetTypeName(const std::string& topic_name_, std::string& topic_type_); /** * @brief Gets type name of the specified topic. - * - * This function is deprecated with eCAL 5.10. Please use GetTopicDataTypeInformation. + * @deprecated Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @param topic_name_ Topic name. * * @return Topic type name. **/ - ECAL_DEPRECATE_SINCE_5_10("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_10("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the SDataTypeInformation variable. This function will be removed in future eCAL versions.") ECAL_API std::string GetTypeName(const std::string& topic_name_); /** * @brief Gets description of the specified topic. - * - * This function is deprecated with eCAL 5.10. Please use GetTopicDataTypeInformation. + * @deprecated Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the descriptor from the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @param topic_name_ Topic name. * @param topic_desc_ String to store description. * * @return True if succeeded. **/ - ECAL_DEPRECATE_SINCE_5_10("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_10("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the descriptor from the SDataTypeInformation variable. This function will be removed in future eCAL versions.") ECAL_API bool GetDescription(const std::string& topic_name_, std::string& topic_desc_); /** * @brief Gets description of the specified topic. - * - * This function is deprecated with eCAL 5.10. Please use GetTopicDataTypeInformation. + * @deprecated Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the descriptor from the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @param topic_name_ Topic name. * * @return Topic description. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the type information from the members encoding and type of the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method bool GetTopicDataTypeInformation(const std::string& topic_name_, SDataTypeInformation& topic_info_) instead. You can extract the descriptor from the SDataTypeInformation variable. This function will be removed in future eCAL versions.") ECAL_API std::string GetDescription(const std::string& topic_name_); /** diff --git a/ecal/core/include/ecal/msg/capnproto/dynamic.h b/ecal/core/include/ecal/msg/capnproto/dynamic.h index c856afda15..671653cd24 100644 --- a/ecal/core/include/ecal/msg/capnproto/dynamic.h +++ b/ecal/core/include/ecal/msg/capnproto/dynamic.h @@ -168,10 +168,11 @@ namespace eCAL /** * @brief Get type name of the capnp message. + * @deprecated Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the STopicInformation variable. This function will be removed in future eCAL versions. * * @return Type name. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the STopicInformation variable. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the STopicInformation variable. This function will be removed in future eCAL versions.") std::string GetTypeName() const { return (""); diff --git a/ecal/core/include/ecal/msg/capnproto/subscriber.h b/ecal/core/include/ecal/msg/capnproto/subscriber.h index 02cb9edac5..3f8c678373 100644 --- a/ecal/core/include/ecal/msg/capnproto/subscriber.h +++ b/ecal/core/include/ecal/msg/capnproto/subscriber.h @@ -249,10 +249,11 @@ namespace eCAL /** * @brief Get type name of the capnp message. + * @deprecated Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @return Type name. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in future eCAL versions.") std::string GetTypeName() const { return eCAL::capnproto::TypeAsString(); diff --git a/ecal/core/include/ecal/msg/protobuf/client.h b/ecal/core/include/ecal/msg/protobuf/client.h index 16da3b4402..33a56c4f4a 100644 --- a/ecal/core/include/ecal/msg/protobuf/client.h +++ b/ecal/core/include/ecal/msg/protobuf/client.h @@ -169,7 +169,7 @@ namespace eCAL * * @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.") + 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 future eCAL versions.") 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; diff --git a/ecal/core/include/ecal/msg/protobuf/publisher.h b/ecal/core/include/ecal/msg/protobuf/publisher.h index 7ba254e485..0252b69be7 100644 --- a/ecal/core/include/ecal/msg/protobuf/publisher.h +++ b/ecal/core/include/ecal/msg/protobuf/publisher.h @@ -174,10 +174,11 @@ namespace eCAL /** * @brief Get type name of the protobuf message. + * @deprecated Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @return Type name. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the SDataTypeInformation variable. This function will be removed in future eCAL versions.") std::string GetTypeName() const { SDataTypeInformation topic_info{ GetDataTypeInformation() }; @@ -187,10 +188,11 @@ namespace eCAL private: /** * @brief Get file descriptor string of the protobuf message. + * @deprecated Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the description from the SDataTypeInformation variable. This function will be removed in future eCAL versions. * * @return Description string. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the description from the SDataTypeInformation variable. This function will be removed in future eCAL versions.") std::string GetDescription() const { return GetDataTypeInformation().descriptor; diff --git a/ecal/core/include/ecal/msg/publisher.h b/ecal/core/include/ecal/msg/publisher.h index 1d19f89fee..2fd6319263 100644 --- a/ecal/core/include/ecal/msg/publisher.h +++ b/ecal/core/include/ecal/msg/publisher.h @@ -57,13 +57,13 @@ namespace eCAL /** * @brief Constructor, that automatically intializes the Publisher. - * This function will be deprecated with eCAL 5.13, please use one of other constructors instead. + * @deprecated Please use the constructor CMsgPublisher(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions. * * @param topic_name_ Unique topic name. * @param topic_type_ Type name. * @param topic_desc_ Type description (optional for description checking). **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CMsgPublisher(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6. ") + ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CMsgPublisher(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions.") CMsgPublisher(const std::string& topic_name_, const std::string& topic_type_, const std::string& topic_desc_ = "") : CPublisher(topic_name_, topic_type_, topic_desc_) { } @@ -115,6 +115,7 @@ namespace eCAL /** * @brief Creates this object. + * @deprecated Please use the method Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions. * * @param topic_name_ Unique topic name. * @param topic_type_ Type name (optional for type checking). @@ -122,7 +123,7 @@ namespace eCAL * * @return True if it succeeds, false if it fails. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6. ") + ECAL_DEPRECATE_SINCE_5_13("Please use the method Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions.") bool Create(const std::string& topic_name_, const std::string& topic_type_ = "", const std::string& topic_desc_ = "") { return(CPublisher::Create(topic_name_, topic_type_, topic_desc_)); @@ -208,14 +209,14 @@ namespace eCAL } protected: - ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in future eCAL versions.") virtual std::string GetTypeName() const { SDataTypeInformation topic_info{ GetDataTypeInformation() }; return Util::CombinedTopicEncodingAndType(topic_info.encoding, topic_info.name); }; - ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in future eCAL versions.") virtual std::string GetDescription() const { return GetDataTypeInformation().descriptor; diff --git a/ecal/core/include/ecal/msg/string/publisher.h b/ecal/core/include/ecal/msg/string/publisher.h index 4ae18b2854..d514ecee3e 100644 --- a/ecal/core/include/ecal/msg/string/publisher.h +++ b/ecal/core/include/ecal/msg/string/publisher.h @@ -66,12 +66,13 @@ namespace eCAL /** * @brief Constructor. + * @deprecated Please use eCAL::string::CPublisher(const std::string& topic_name_) instead. This function will be removed in future eCAL versions. * * @param topic_name_ Unique topic name. * @param topic_type_ Type name (optional). * @param topic_desc_ Type description (optional). **/ - ECAL_DEPRECATE_SINCE_5_13("Plase use eCAL::string::CPublisher(const std::string& topic_name_) instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use eCAL::string::CPublisher(const std::string& topic_name_) instead. This function will be removed in future eCAL versions.") CPublisher(const std::string& topic_name_, const std::string& topic_type_, const std::string& topic_desc_) : CMsgPublisher(topic_name_, topic_type_, topic_desc_) { } diff --git a/ecal/core/include/ecal/msg/subscriber.h b/ecal/core/include/ecal/msg/subscriber.h index 0d342e0630..317f50145b 100644 --- a/ecal/core/include/ecal/msg/subscriber.h +++ b/ecal/core/include/ecal/msg/subscriber.h @@ -56,12 +56,13 @@ namespace eCAL /** * @brief Constructor. + * @deprecated Please use the constructor CMsgSubscriber(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions. * * @param topic_name_ Unique topic name. * @param topic_type_ Type name (optional for type checking). * @param topic_desc_ Type description (optional for description checking). **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CMsgSubscriber(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6. ") + ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CMsgSubscriber(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions.") CMsgSubscriber(const std::string& topic_name_, const std::string& topic_type_ = "", const std::string& topic_desc_ = "") : CSubscriber(topic_name_, topic_type_, topic_desc_) { } @@ -129,6 +130,7 @@ namespace eCAL /** * @brief Creates this object. + * @deprecated Please use the method CMsgSubscriber(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions. * * @param topic_name_ Unique topic name. * @param topic_type_ Type name (optional for type checking). @@ -136,7 +138,7 @@ namespace eCAL * * @return true if it succeeds, false if it fails. **/ - ECAL_DEPRECATE_SINCE_5_13("Please use the method CMsgSubscriber(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6. ") + ECAL_DEPRECATE_SINCE_5_13("Please use the method CMsgSubscriber(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in future eCAL versions.") bool Create(const std::string& topic_name_, const std::string& topic_type_ = "", const std::string& topic_desc_ = "") { return(CSubscriber::Create(topic_name_, topic_type_, topic_desc_)); @@ -231,14 +233,14 @@ namespace eCAL } protected: - ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in future eCAL versions.") virtual std::string GetTypeName() const { SDataTypeInformation topic_info{ GetDataTypeInformation() }; return Util::CombinedTopicEncodingAndType(topic_info.encoding, topic_info.name); }; - ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in eCAL6.") + ECAL_DEPRECATE_SINCE_5_13("Please use SDataTypeInformation GetDataTypeInformation() instead. This function will be removed in future eCAL versions.") virtual std::string GetDescription() const { return GetDataTypeInformation().descriptor; diff --git a/ecal/core/src/ecal_clang.cpp b/ecal/core/src/ecal_clang.cpp index 6ed6a2eddb..220ff9ffa9 100644 --- a/ecal/core/src/ecal_clang.cpp +++ b/ecal/core/src/ecal_clang.cpp @@ -397,12 +397,16 @@ static void g_pub_event_callback(const char* topic_name_, const struct eCAL::SPu { const std::lock_guard lock(g_pub_event_callback_mtx); SPubEventCallbackDataC data; - data.type = data_->type; - data.time = data_->time; - data.clock = data_->clock; - data.tid = data_->tid.c_str(); - data.ttype = data_->ttype.c_str(); - data.tdesc = data_->tdesc.c_str(); + data.type = data_->type; + data.time = data_->time; + data.clock = data_->clock; + data.tid = data_->tid.c_str(); + data.tname = data_->tdatatype.name.c_str(); + data.tencoding = data_->tdatatype.encoding.c_str(); + data.tdesc = data_->tdesc.c_str(); + + auto ttype = eCAL::Util::CombinedTopicEncodingAndType(data_->tdatatype.encoding, data_->tdatatype.name); + data.ttype = ttype.c_str(); callback_(topic_name_, &data, par_); } @@ -588,12 +592,16 @@ static void g_sub_event_callback(const char* topic_name_, const struct eCAL::SSu { const std::lock_guard lock(g_sub_event_callback_mtx); SSubEventCallbackDataC data; - data.type = data_->type; - data.time = data_->time; - data.clock = data_->clock; - data.tid = data_->tid.c_str(); - data.ttype = data_->ttype.c_str(); - data.tdesc = data_->tdesc.c_str(); + data.type = data_->type; + data.time = data_->time; + data.clock = data_->clock; + data.tid = data_->tid.c_str(); + data.tname = data_->tdatatype.name.c_str(); + data.tencoding = data_->tdatatype.encoding.c_str(); + data.tdesc = data_->tdesc.c_str(); + + auto ttype = eCAL::Util::CombinedTopicEncodingAndType(data_->tdatatype.encoding, data_->tdatatype.name); + data.ttype = ttype.c_str(); callback_(topic_name_, &data, par_); } diff --git a/ecal/core/src/ecal_util.cpp b/ecal/core/src/ecal_util.cpp index b116ee8ece..5a4730f306 100644 --- a/ecal/core/src/ecal_util.cpp +++ b/ecal/core/src/ecal_util.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "ecal_def.h" #include "ecal_event_internal.h" diff --git a/ecal/core/src/ecalc.cpp b/ecal/core/src/ecalc.cpp index 1c211acf03..fa94cc5443 100644 --- a/ecal/core/src/ecalc.cpp +++ b/ecal/core/src/ecalc.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -152,12 +153,12 @@ extern "C" ECALC_API int eCAL_Util_GetTopicTypeName(const char* topic_name_, void* topic_type_, int topic_type_len_) { - if(!topic_name_) return(0); - if(!topic_type_) return(0); - std::string topic_type; - if(eCAL::Util::GetTopicTypeName(topic_name_, topic_type)) + if(topic_name_ == nullptr) return(0); + if(topic_type_ == nullptr) return(0); + eCAL::SDataTypeInformation topic_info; + if(eCAL::Util::GetTopicDataTypeInformation(topic_name_, topic_info)) { - return(CopyBuffer(topic_type_, topic_type_len_, topic_type)); + return(CopyBuffer(topic_type_, topic_type_len_, topic_info.name)); } return(0); } @@ -168,14 +169,26 @@ extern "C" return(eCAL_Util_GetTopicTypeName(topic_name_, topic_type_, topic_type_len_)); } + ECALC_API int eCAL_Util_GetTopicEncoding(const char* topic_name_, void* topic_encoding_, int topic_encoding_len_) + { + if (topic_name_ == nullptr) return(0); + if (topic_encoding_ == nullptr) return(0); + eCAL::SDataTypeInformation topic_info; + if (eCAL::Util::GetTopicDataTypeInformation(topic_name_, topic_info)) + { + return(CopyBuffer(topic_encoding_, topic_encoding_len_, topic_info.encoding)); + } + return(0); + } + ECALC_API int eCAL_Util_GetTopicDescription(const char* topic_name_, void* topic_desc_, int topic_desc_len_) { - if(!topic_name_) return(0); - if(!topic_desc_) return(0); - std::string topic_desc; - if(eCAL::Util::GetTopicDescription(topic_name_, topic_desc)) + if(topic_name_ == nullptr) return(0); + if(topic_desc_ == nullptr) return(0); + eCAL::SDataTypeInformation topic_info; + if (eCAL::Util::GetTopicDataTypeInformation(topic_name_, topic_info)) { - return(CopyBuffer(topic_desc_, topic_desc_len_, topic_desc)); + return(CopyBuffer(topic_desc_, topic_desc_len_, topic_info.descriptor)); } return(0); } @@ -526,12 +539,16 @@ static void g_pub_event_callback(const char* topic_name_, const struct eCAL::SPu { const std::lock_guard lock(g_pub_callback_mtx); SPubEventCallbackDataC data; - data.type = data_->type; - data.time = data_->time; - data.clock = data_->clock; - data.tid = data_->tid.c_str(); - data.ttype = data_->ttype.c_str(); - data.tdesc = data_->tdesc.c_str(); + data.type = data_->type; + data.time = data_->time; + data.clock = data_->clock; + data.tid = data_->tid.c_str(); + data.tname = data_->tdatatype.name.c_str(); + data.tencoding = data_->tdatatype.encoding.c_str(); + data.tdesc = data_->tdesc.c_str(); + + auto ttype = eCAL::Util::CombinedTopicEncodingAndType(data_->tdatatype.encoding, data_->tdatatype.name); + data.ttype = ttype.c_str(); callback_(topic_name_, &data, par_); } @@ -747,12 +764,16 @@ static void g_sub_event_callback(const char* topic_name_, const struct eCAL::SSu { const std::lock_guard lock(g_sub_callback_mtx); SSubEventCallbackDataC data; - data.type = data_->type; - data.time = data_->time; - data.clock = data_->clock; - data.tid = data_->tid.c_str(); - data.ttype = data_->ttype.c_str(); - data.tdesc = data_->tdesc.c_str(); + data.type = data_->type; + data.time = data_->time; + data.clock = data_->clock; + data.tid = data_->tid.c_str(); + data.tname = data_->tdatatype.name.c_str(); + data.tencoding = data_->tdatatype.encoding.c_str(); + data.tdesc = data_->tdesc.c_str(); + + auto ttype = eCAL::Util::CombinedTopicEncodingAndType(data_->tdatatype.encoding, data_->tdatatype.name); + data.ttype = ttype.c_str(); callback_(topic_name_, &data, par_); } @@ -934,13 +955,45 @@ extern "C" return(0); } + ECALC_API int eCAL_Sub_GetTypeName(ECAL_HANDLE handle_, void* buf_, int buf_len_) + { + if (handle_ == nullptr) return(0); + auto* sub = static_cast(handle_); + const eCAL::SDataTypeInformation datatype_info = sub->GetDataTypeInformation(); + int buffer_len = CopyBuffer(buf_, buf_len_, datatype_info.name); + if (buffer_len != static_cast(datatype_info.name.size())) + { + return(0); + } + else + { + return(buffer_len); + } + } + + ECALC_API int eCAL_Sub_GetEncoding(ECAL_HANDLE handle_, void* buf_, int buf_len_) + { + if (handle_ == nullptr) return(0); + auto* sub = static_cast(handle_); + const eCAL::SDataTypeInformation datatype_info = sub->GetDataTypeInformation(); + int buffer_len = CopyBuffer(buf_, buf_len_, datatype_info.encoding); + if (buffer_len != static_cast(datatype_info.encoding.size())) + { + return(0); + } + else + { + return(buffer_len); + } + } + ECALC_API int eCAL_Sub_GetDescription(ECAL_HANDLE handle_, void* buf_, int buf_len_) { - if(handle_ == NULL) return(0); - eCAL::CSubscriber* sub = static_cast(handle_); - const std::string desc = sub->GetDescription(); - int buffer_len = CopyBuffer(buf_, buf_len_, desc); - if (buffer_len != static_cast(desc.size())) + if (handle_ == nullptr) return(0); + auto* sub = static_cast(handle_); + const eCAL::SDataTypeInformation datatype_info = sub->GetDataTypeInformation(); + int buffer_len = CopyBuffer(buf_, buf_len_, datatype_info.descriptor); + if (buffer_len != static_cast(datatype_info.descriptor.size())) { return(0); } diff --git a/ecal/core/src/pubsub/ecal_subgate.cpp b/ecal/core/src/pubsub/ecal_subgate.cpp index d3eb5baaa5..031cd0f93d 100644 --- a/ecal/core/src/pubsub/ecal_subgate.cpp +++ b/ecal/core/src/pubsub/ecal_subgate.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index efa5e400b9..54c5f882e7 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -65,8 +65,6 @@ add_subdirectory(cpp/measurement/measurement_write) endif(HAS_HDF5) # misc -add_subdirectory(cpp/misc/event_rec) -add_subdirectory(cpp/misc/event_snd) add_subdirectory(cpp/misc/process) add_subdirectory(cpp/misc/time) add_subdirectory(cpp/misc/timer) diff --git a/samples/cpp/misc/event_rec/CMakeLists.txt b/samples/cpp/misc/event_rec/CMakeLists.txt deleted file mode 100644 index 4febc526c8..0000000000 --- a/samples/cpp/misc/event_rec/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -# ========================= eCAL LICENSE ================================= -# -# Copyright (C) 2016 - 2019 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 ================================= - -cmake_minimum_required(VERSION 3.10) - -set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) - -project(event_rec) - -find_package(eCAL REQUIRED) - -set(event_rec_src - src/event_rec.cpp -) - -ecal_add_sample(${PROJECT_NAME} ${event_rec_src}) - -target_link_libraries(${PROJECT_NAME} eCAL::core) - -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) - -ecal_install_sample(${PROJECT_NAME}) - -set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER samples/cpp/misc/event) diff --git a/samples/cpp/misc/event_rec/src/event_rec.cpp b/samples/cpp/misc/event_rec/src/event_rec.cpp deleted file mode 100644 index 435c0f67a2..0000000000 --- a/samples/cpp/misc/event_rec/src/event_rec.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 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 ================================= -*/ - -#include - -#include -#include -#include - -int main(int /*argc*/, char** /*argv*/) -{ - // global parameter - const std::string event_name = "my_event"; - - // create named event - eCAL::EventHandleT event_handle; - eCAL::gOpenEvent(&event_handle, event_name); - - // timer - auto start_time(std::chrono::steady_clock::now()); - int clock(0); - int msgs(0); - - // send updates - for(;;) - { - // fire event - if(gWaitForEvent(event_handle, -1)) - { - // collect data - clock++; - msgs++; - - // check timer and print results every second - if(clock%10000 == 0) - { - std::chrono::duration diff_time = std::chrono::steady_clock::now() - start_time; - if(diff_time >= std::chrono::seconds(1)) - { - start_time = std::chrono::steady_clock::now(); - std::stringstream out; - out << "Events/s: " << int(msgs / diff_time.count()) << std::endl; - std::cout << out.str() << std::endl; - msgs = 0; - } - } - } - } -} diff --git a/samples/cpp/misc/event_snd/CMakeLists.txt b/samples/cpp/misc/event_snd/CMakeLists.txt deleted file mode 100644 index a3679328c6..0000000000 --- a/samples/cpp/misc/event_snd/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -# ========================= eCAL LICENSE ================================= -# -# Copyright (C) 2016 - 2019 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 ================================= - -cmake_minimum_required(VERSION 3.10) - -set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) - -project(event_snd) - -find_package(eCAL REQUIRED) - -set(event_rec_snd - src/event_snd.cpp -) - -ecal_add_sample(${PROJECT_NAME} ${event_rec_snd}) - -target_link_libraries(${PROJECT_NAME} eCAL::core) - -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) - -ecal_install_sample(${PROJECT_NAME}) - -set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER samples/cpp/misc/event) diff --git a/samples/cpp/misc/event_snd/src/event_snd.cpp b/samples/cpp/misc/event_snd/src/event_snd.cpp deleted file mode 100644 index 6825b9cdd8..0000000000 --- a/samples/cpp/misc/event_snd/src/event_snd.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 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 ================================= -*/ - -#include - -#include -#include -#include - -int main(int /*argc*/, char** /*argv*/) -{ - // global parameter - const std::string event_name = "my_event"; - - // create named event - eCAL::EventHandleT event_handle; - eCAL::gOpenEvent(&event_handle, event_name); - - // timer - auto start_time(std::chrono::steady_clock::now()); - int clock(0); - int msgs(0); - - // send updates - for(;;) - { - // fire event - gSetEvent(event_handle); - - // collect data - clock++; - msgs++; - - // check timer and print results every second - if(clock%10011 == 0) - { - std::chrono::duration diff_time = std::chrono::steady_clock::now() - start_time; - if(diff_time >= std::chrono::seconds(1)) - { - start_time = std::chrono::steady_clock::now(); - std::stringstream out; - out << "Events/s: " << int(msgs / diff_time.count()) << std::endl; - std::cout << out.str() << std::endl; - msgs = 0; - } - } - } -} diff --git a/testing/ecal/event_test/src/event_test.cpp b/testing/ecal/event_test/src/event_test.cpp index 6e02acc94f..d832257dab 100644 --- a/testing/ecal/event_test/src/event_test.cpp +++ b/testing/ecal/event_test/src/event_test.cpp @@ -18,6 +18,7 @@ */ #include +#include #include