From 90d9daab7e975255a4860acd5f9bfb2297ebaca3 Mon Sep 17 00:00:00 2001 From: KerstinKeller Date: Thu, 16 Jan 2025 13:50:03 +0100 Subject: [PATCH] [core] Split C and C++ implementations (#1904) C++ implementation and C wrapper are no longer located in the same folder. At the same time, a lot of shared enums are converted to `enum class` for C++. --- CMakeLists.txt | 8 +- app/mon/mon_cli/src/ecal_mon_cli.cpp | 2 +- app/mon/mon_gui/src/ecalmon.cpp | 4 +- app/mon/mon_gui/src/plugin/plugin_manager.cpp | 6 +- app/mon/mon_gui/src/plugin/plugin_wrapper.cpp | 12 +- .../src/widgets/log_widget/log_widget.cpp | 26 ++-- .../mon_gui/src/widgets/models/log_model.cpp | 24 ++-- .../models/log_sort_filter_proxy_model.cpp | 8 +- .../models/log_sort_filter_proxy_model.h | 8 +- .../src/plugin_widget.cpp | 4 +- .../protobuf_reflection/src/plugin_widget.cpp | 4 +- .../signals_plotting/src/plugin_widget.cpp | 4 +- app/mon/mon_tui/src/main.cpp | 2 +- app/mon/mon_tui/src/model/log.hpp | 18 +-- app/play/play_core/src/ecal_play.cpp | 8 +- app/play/play_core/src/play_thread.cpp | 8 +- app/rec/rec_client_cli/src/ecal_rec_cli.cpp | 12 +- app/rec/rec_gui/src/qecalrec.cpp | 4 +- .../src/ecal_rec_server_cli.cpp | 4 +- .../rec_server_core/ecalstate_helpers.h | 4 +- .../rec_server_core/src/ecalstate_helpers.cpp | 12 +- .../rec_rpc_tests/src/external_ecal_rec.cpp | 6 +- app/sys/sys_cli/src/commands/list.cpp | 38 +++--- app/sys/sys_cli/src/ecalsys_cli.cpp | 6 +- .../include/sys_client_core/proto_helpers.h | 10 +- .../include/sys_client_core/task.h | 6 +- app/sys/sys_client_core/src/proto_helpers.cpp | 24 ++-- .../include/ecalsys/task/ecal_sys_task.h | 8 +- .../include/ecalsys/task/task_state.h | 76 +++++------ .../sys_core/src/config/config_manager.cpp | 20 +-- app/sys/sys_core/src/ecal_sys_monitor.cpp | 16 +-- app/sys/sys_core/src/proto_helpers.cpp | 48 +++---- app/sys/sys_core/src/task/ecal_sys_task.cpp | 8 +- app/sys/sys_core/src/task/task_group.cpp | 4 +- .../start_task_list_thread.cpp | 6 +- .../group_edit_widget/group_edit_widget.cpp | 6 +- .../severity_picker_delegate.cpp | 10 +- .../import_from_cloud_widget.cpp | 6 +- .../severity_model/severity_level_model.cpp | 16 +-- .../severity_model/severity_level_model.h | 8 +- .../widgets/severity_model/severity_model.cpp | 16 +-- .../widgets/severity_model/severity_model.h | 8 +- .../src/widgets/taskwidget/task_widget.cpp | 38 +++--- .../group_state_min_task_state_tree_item.cpp | 6 +- .../src/widgets/treemodels/task_tree_item.cpp | 24 ++-- app/util/stop/src/ecal_stop.cpp | 4 +- contrib/mma/src/mma_application.cpp | 4 +- ecal/core/CMakeLists.txt | 89 +------------ ecal/core/include/ecal/config/logging.h | 4 +- ecal/core/include/ecal/ecal_callback.h | 96 ++++++++++++- ecal/core/include/ecal/ecal_callback_v5.h | 10 +- ecal/core/include/ecal/ecal_client_v5.h | 6 +- ecal/core/include/ecal/ecal_log.h | 4 +- ecal/core/include/ecal/ecal_log_level.h | 43 +++--- ecal/core/include/ecal/ecal_os.h | 22 +-- ecal/core/include/ecal/ecal_process.h | 6 +- ecal/core/include/ecal/ecal_process_mode.h | 20 ++- .../core/include/ecal/ecal_process_severity.h | 57 ++++---- ecal/core/include/ecal/ecal_publisher_v5.h | 6 +- ecal/core/include/ecal/ecal_server_v5.h | 6 +- ecal/core/include/ecal/ecal_service_info.h | 18 ++- ecal/core/include/ecal/ecal_subscriber_v5.h | 4 +- ecal/core/include/ecal/types/logging.h | 4 +- .../core/src/config/configuration_to_yaml.cpp | 42 +++--- .../core/src/config/default_configuration.cpp | 20 +-- ecal/core/src/ecal_global_accessors.cpp | 6 +- ecal/core/src/ecal_global_accessors.h | 6 +- ecal/core/src/ecal_process.cpp | 10 +- ecal/core/src/io/shm/ecal_memfile_pool.cpp | 16 +-- ecal/core/src/io/shm/ecal_memfile_sync.cpp | 28 ++-- .../attributes/ecal_log_provider_attributes.h | 4 +- ecal/core/src/logging/ecal_log.cpp | 2 +- ecal/core/src/logging/ecal_log_provider.cpp | 30 ++--- ecal/core/src/logging/ecal_log_provider.h | 4 +- .../src/monitoring/ecal_monitoring_impl.cpp | 2 +- ecal/core/src/pubsub/ecal_publisher_impl.cpp | 68 +++++----- ecal/core/src/pubsub/ecal_publisher_impl.h | 8 +- ecal/core/src/pubsub/ecal_publisher_v5.cpp | 8 +- ecal/core/src/pubsub/ecal_subgate.cpp | 4 +- ecal/core/src/pubsub/ecal_subscriber_impl.cpp | 60 ++++----- ecal/core/src/pubsub/ecal_subscriber_impl.h | 8 +- ecal/core/src/pubsub/ecal_subscriber_v5.cpp | 6 +- .../src/readwrite/shm/ecal_writer_shm.cpp | 8 +- .../readwrite/tcp/ecal_tcp_pubsub_logger.h | 14 +- .../src/readwrite/udp/ecal_writer_udp.cpp | 4 +- .../ecal_registration_provider.cpp | 4 +- .../ecal_registration_sample_applier.cpp | 4 +- ...ecal_registration_sample_applier_gates.cpp | 4 +- .../serialization/ecal_serialize_logging.cpp | 4 +- ecal/core/src/service/ecal_service_client.cpp | 2 +- .../src/service/ecal_service_client_impl.cpp | 60 ++++----- .../src/service/ecal_service_client_impl.h | 2 +- .../src/service/ecal_service_client_v5.cpp | 6 +- .../service/ecal_service_client_v5_impl.cpp | 82 ++++++------ .../src/service/ecal_service_client_v5_impl.h | 8 +- .../src/service/ecal_service_server_impl.cpp | 54 ++++---- .../src/service/ecal_service_server_impl.h | 2 +- .../src/service/ecal_service_server_v5.cpp | 6 +- .../service/ecal_service_server_v5_impl.cpp | 46 +++---- .../src/service/ecal_service_server_v5_impl.h | 8 +- .../ecal_service_singleton_manager.cpp | 14 +- ecal/core/src/time/ecal_timegate.cpp | 6 +- ecal/samples/CMakeLists.txt | 19 --- .../counter_snd/src/counter_snd.cpp | 4 +- .../performance_snd/src/performance_snd.cpp | 4 +- ecal/samples/cpp/misc/process/src/process.cpp | 6 +- ecal/samples/cpp/misc/timer/src/timer.cpp | 2 +- .../minimal_client/src/minimal_client.cpp | 10 +- ecal/tests/CMakeLists.txt | 5 - .../src/clientserver_test.cpp | 16 +-- .../src/clientserver_test.cpp | 26 ++-- .../tests/cpp/config_test/src/config_test.cpp | 4 +- .../cpp/logging_test/src/logging_test.cpp | 66 ++++----- .../src/logging_generate.cpp | 4 +- lang/c/CMakeLists.txt | 33 +++++ lang/c/core/CMakeLists.txt | 126 ++++++++++++++++++ .../include/ecal/cimpl/ecal_callback_cimpl.h | 0 .../include/ecal/cimpl/ecal_client_cimpl.h | 4 +- .../core/include/ecal/cimpl/ecal_core_cimpl.h | 6 +- .../core/include/ecal/cimpl/ecal_init_cimpl.h | 0 .../core/include/ecal/cimpl/ecal_log_cimpl.h | 23 +++- .../ecal/cimpl/ecal_monitoring_cimpl.h | 4 +- .../include/ecal/cimpl/ecal_process_cimpl.h | 44 +++++- .../include/ecal/cimpl/ecal_publisher_cimpl.h | 4 +- .../include/ecal/cimpl/ecal_server_cimpl.h | 4 +- .../ecal/cimpl/ecal_service_info_cimpl.h | 0 .../ecal/cimpl/ecal_subscriber_cimpl.h | 4 +- .../core/include/ecal/cimpl/ecal_time_cimpl.h | 4 +- .../include/ecal/cimpl/ecal_timer_cimpl.h | 4 +- .../include/ecal/cimpl/ecal_tlayer_cimpl.h | 0 .../core/include/ecal/cimpl/ecal_util_cimpl.h | 4 +- {ecal => lang/c}/core/include/ecal/ecalc.h | 5 +- lang/c/core/include/ecal/ecalc_export.h | 48 +++++++ .../c}/core/include/ecal/ecalc_types.h | 0 .../c/core/src}/ecal_client_cimpl.cpp | 50 ++++++- .../c/core/src}/ecal_common_cimpl.cpp | 0 .../c/core/src}/ecal_common_cimpl.h | 0 .../c/core/src}/ecal_core_cimpl.cpp | 0 .../c/core/src}/ecal_log_cimpl.cpp | 5 +- .../c/core/src}/ecal_monitoring_cimpl.cpp | 0 .../c/core/src}/ecal_process_cimpl.cpp | 7 +- .../c/core/src}/ecal_publisher_cimpl.cpp | 31 ++++- .../c/core/src}/ecal_server_cimpl.cpp | 32 ++++- .../c/core/src}/ecal_subscriber_cimpl.cpp | 32 ++++- .../c/core/src}/ecal_time_cimpl.cpp | 0 .../c/core/src}/ecal_timer_cimpl.cpp | 0 .../c/core/src}/ecal_util_cimpl.cpp | 0 lang/c/core/src/win32/dll/dllmain.cpp | 21 +++ lang/c/core/src/win32/dll/ecal.rc | Bin 0 -> 5714 bytes lang/c/core/src/win32/dll/resource.h | 15 +++ lang/c/samples/CMakeLists.txt | 30 +++++ .../pubsub/string/minimal_rec/CMakeLists.txt | 0 .../string/minimal_rec/src/minimal_rec.c | 0 .../string/minimal_rec_cb/CMakeLists.txt | 0 .../minimal_rec_cb/src/minimal_rec_cb.c | 0 .../pubsub/string/minimal_snd/CMakeLists.txt | 0 .../string/minimal_snd/src/minimal_snd.c | 0 .../services/minimal_client_c/CMakeLists.txt | 0 .../minimal_client_c/src/minimal_client_c.c | 0 .../services/minimal_server_c/CMakeLists.txt | 0 .../minimal_server_c/src/minimal_server_c.c | 0 lang/c/tests/CMakeLists.txt | 22 +++ .../c/tests}/core_test/CMakeLists.txt | 0 .../c/tests}/core_test/src/core_test.cpp | 0 .../csharp/Continental.eCAL.Core/ecal_clr.cpp | 4 +- lang/python/core/CMakeLists.txt | 9 +- lang/python/core/src/ecal_clang.cpp | 71 ++++++++-- lang/python/core/src/ecal_wrap.cxx | 6 +- pyproject.toml | 1 + .../src/ecalplayer_client.cpp | 6 +- .../src/ecalplayer_gui_client.cpp | 6 +- .../ecalsys_client/src/ecalsys_client.cpp | 6 +- .../src/ecalrecorder_client.cpp | 6 +- .../src/EcalrecGuiClient.cpp | 6 +- .../src/rec_server_service_gui.cpp | 6 +- .../addressbook_rec/src/addressbook_rec.cpp | 4 +- .../src/addressbook_rec_cb.cpp | 4 +- .../src/addressbook_rec_dynamic.cpp | 4 +- .../addressbook_snd/src/addressbook_snd.cpp | 4 +- .../pubsub/monster_rec/monster_rec.cpp | 4 +- .../pubsub/monster_snd/monster_snd.cpp | 4 +- .../src/person_events_rec.cpp | 34 ++--- .../src/person_events_snd.cpp | 26 ++-- .../person_loopback/src/person_loopback.cpp | 4 +- .../pubsub/person_rec/src/person_rec.cpp | 4 +- .../pubsub/person_snd/src/person_snd.cpp | 4 +- .../person_snd_tcp/src/person_snd_tcp.cpp | 4 +- .../person_snd_udp/src/person_snd_udp.cpp | 4 +- .../proto_dyn_snd/src/proto_dyn_snd.cpp | 4 +- .../services/math_client/src/math_client.cpp | 18 +-- .../services/math_server/src/math_server.cpp | 10 +- .../services/ping_client/src/ping_client.cpp | 6 +- .../ping_client_dyn/src/ping_client_dyn.cpp | 6 +- .../src/clientserver_test_proto.cpp | 12 +- 194 files changed, 1596 insertions(+), 1088 deletions(-) create mode 100644 lang/c/CMakeLists.txt create mode 100644 lang/c/core/CMakeLists.txt rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_callback_cimpl.h (100%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_client_cimpl.h (98%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_core_cimpl.h (96%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_init_cimpl.h (100%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_log_cimpl.h (77%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_monitoring_cimpl.h (95%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_process_cimpl.h (79%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_publisher_cimpl.h (98%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_server_cimpl.h (97%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_service_info_cimpl.h (100%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_subscriber_cimpl.h (99%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_time_cimpl.h (97%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_timer_cimpl.h (96%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_tlayer_cimpl.h (100%) rename {ecal => lang/c}/core/include/ecal/cimpl/ecal_util_cimpl.h (94%) rename {ecal => lang/c}/core/include/ecal/ecalc.h (93%) create mode 100644 lang/c/core/include/ecal/ecalc_export.h rename {ecal => lang/c}/core/include/ecal/ecalc_types.h (100%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_client_cimpl.cpp (78%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_common_cimpl.cpp (100%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_common_cimpl.h (100%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_core_cimpl.cpp (100%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_log_cimpl.cpp (85%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_monitoring_cimpl.cpp (100%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_process_cimpl.cpp (89%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_publisher_cimpl.cpp (77%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_server_cimpl.cpp (81%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_subscriber_cimpl.cpp (84%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_time_cimpl.cpp (100%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_timer_cimpl.cpp (100%) rename {ecal/core/src/cimpl => lang/c/core/src}/ecal_util_cimpl.cpp (100%) create mode 100644 lang/c/core/src/win32/dll/dllmain.cpp create mode 100644 lang/c/core/src/win32/dll/ecal.rc create mode 100644 lang/c/core/src/win32/dll/resource.h create mode 100644 lang/c/samples/CMakeLists.txt rename {ecal/samples/c => lang/c/samples}/pubsub/string/minimal_rec/CMakeLists.txt (100%) rename {ecal/samples/c => lang/c/samples}/pubsub/string/minimal_rec/src/minimal_rec.c (100%) rename {ecal/samples/c => lang/c/samples}/pubsub/string/minimal_rec_cb/CMakeLists.txt (100%) rename {ecal/samples/c => lang/c/samples}/pubsub/string/minimal_rec_cb/src/minimal_rec_cb.c (100%) rename {ecal/samples/c => lang/c/samples}/pubsub/string/minimal_snd/CMakeLists.txt (100%) rename {ecal/samples/c => lang/c/samples}/pubsub/string/minimal_snd/src/minimal_snd.c (100%) rename {ecal/samples/c => lang/c/samples}/services/minimal_client_c/CMakeLists.txt (100%) rename {ecal/samples/c => lang/c/samples}/services/minimal_client_c/src/minimal_client_c.c (100%) rename {ecal/samples/c => lang/c/samples}/services/minimal_server_c/CMakeLists.txt (100%) rename {ecal/samples/c => lang/c/samples}/services/minimal_server_c/src/minimal_server_c.c (100%) create mode 100644 lang/c/tests/CMakeLists.txt rename {ecal/tests/c => lang/c/tests}/core_test/CMakeLists.txt (100%) rename {ecal/tests/c => lang/c/tests}/core_test/src/core_test.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f09b8fa7f3..04a46a6fac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,7 +148,7 @@ else() ) endif() -set(ECAL_CSHARP_BUILD_SAMPLES ${BUILD_SAMPLES}) + # there is a CMake issue with testing threading availibility via TEST_RUN @@ -324,9 +324,15 @@ endif() # ecal core csharp binding # -------------------------------------------------------- if(BUILD_CSHARP_BINDING AND WIN32) + set(ECAL_CSHARP_BUILD_SAMPLES ${BUILD_SAMPLES}) + set(ECAL_CSHARP_BUILD_TESTS ${BUILD_ECAL_TESTS}) add_subdirectory(lang/csharp) endif() +set(ECAL_C_BUILD_SAMPLES ${BUILD_SAMPLES}) +set(ECAL_C_BUILD_TESTS ${BUILD_ECAL_TESTS}) +add_subdirectory(lang/c) + # -------------------------------------------------------- # console applications # -------------------------------------------------------- diff --git a/app/mon/mon_cli/src/ecal_mon_cli.cpp b/app/mon/mon_cli/src/ecal_mon_cli.cpp index 5191cfb3ce..6298c276b2 100644 --- a/app/mon/mon_cli/src/ecal_mon_cli.cpp +++ b/app/mon/mon_cli/src/ecal_mon_cli.cpp @@ -214,7 +214,7 @@ int main(int argc, char** argv) eCAL::Initialize(config, "eCALMon CLI", eCAL::Init::All); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Running"); switch (cmd_option) { diff --git a/app/mon/mon_gui/src/ecalmon.cpp b/app/mon/mon_gui/src/ecalmon.cpp index 58dd172136..5af235ec4a 100644 --- a/app/mon/mon_gui/src/ecalmon.cpp +++ b/app/mon/mon_gui/src/ecalmon.cpp @@ -74,7 +74,7 @@ Ecalmon::Ecalmon(QWidget *parent) auto config = eCAL::Init::Configuration(); config.logging.receiver.enable = true; eCAL::Initialize(config, "eCALMon", eCAL::Init::Default | eCAL::Init::Monitoring); - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Running"); ui_.setupUi(this); @@ -372,7 +372,7 @@ void Ecalmon::updateMonitor() #ifndef NDEBUG qDebug().nospace() << "[" << metaObject()->className() << "Error getting Monitoring Information"; #endif // NDEBUG - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_error, "Error getting eCAL Monitoring information"); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_error, "Error getting eCAL Monitoring information"); } } diff --git a/app/mon/mon_gui/src/plugin/plugin_manager.cpp b/app/mon/mon_gui/src/plugin/plugin_manager.cpp index 0e5b065ff1..dc5c069c8b 100644 --- a/app/mon/mon_gui/src/plugin/plugin_manager.cpp +++ b/app/mon/mon_gui/src/plugin/plugin_manager.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -135,14 +135,14 @@ void PluginManager::AddFoundPlugins(const QVector& library_paths) plugins_.insert(iid, ActivePlugin{ plugin, false }); else { if (plugin_iter->wrapper.getPluginData().path != file_path) - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_warning, + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_warning, "Ambiguous plugin iid " + iid.toStdString() + " of " + meta_data.name.toStdString() + " " + meta_data.version.toStdString() + ". Plugin " + file_path.toStdString() + " was not loaded."); } } catch (const std::runtime_error &e) { - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_warning, + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_warning, std::string(e.what()) + " Plugin " + file_path.toStdString() + " was not loaded."); } } diff --git a/app/mon/mon_gui/src/plugin/plugin_wrapper.cpp b/app/mon/mon_gui/src/plugin/plugin_wrapper.cpp index 2355e856f0..5af76f7042 100644 --- a/app/mon/mon_gui/src/plugin/plugin_wrapper.cpp +++ b/app/mon/mon_gui/src/plugin/plugin_wrapper.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -104,25 +104,25 @@ bool PluginWrapper::load() eCAL::mon::PluginInterface* plugin = qobject_cast(instance); if (plugin) { - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_info, "Plugin " + plugin_data_.meta_data.name.toStdString() + " " + plugin_data_.meta_data.version.toStdString() + " has been loaded."); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, "Plugin " + plugin_data_.meta_data.name.toStdString() + " " + plugin_data_.meta_data.version.toStdString() + " has been loaded."); instance_ = std::shared_ptr(plugin, [this](eCAL::mon::PluginInterface* p) { - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_info, "Plugin " + plugin_data_.meta_data.name.toStdString() + " " + plugin_data_.meta_data.version.toStdString() + " has been unloaded."); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, "Plugin " + plugin_data_.meta_data.name.toStdString() + " " + plugin_data_.meta_data.version.toStdString() + " has been unloaded."); delete dynamic_cast(p); }); return true; } else { - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_warning, "Plugin " + plugin_data_.path.toStdString() + " is not suitable for eCAL Monitor"); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_warning, "Plugin " + plugin_data_.path.toStdString() + " is not suitable for eCAL Monitor"); loader.unload(); } } else { - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_warning, "Unable to load plugin " + plugin_data_.path.toStdString() + "."); - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_warning, loader.errorString().toStdString()); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_warning, "Unable to load plugin " + plugin_data_.path.toStdString() + "."); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_warning, loader.errorString().toStdString()); } } else diff --git a/app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp b/app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp index f2ee799640..fb9c8c15b1 100644 --- a/app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp +++ b/app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -211,30 +211,30 @@ void LogWidget::getEcalLogs() void LogWidget::updateLogLevelFilter() { - int log_level_filter = eCAL_Logging_eLogLevel::log_level_none; + int log_level_filter = eCAL::Logging::eLogLevel::log_level_none; if (ui_.debug_checkbox->isChecked()) { - log_level_filter |= (eCAL_Logging_eLogLevel::log_level_debug1 | eCAL_Logging_eLogLevel::log_level_debug2 | eCAL_Logging_eLogLevel::log_level_debug3 | eCAL_Logging_eLogLevel::log_level_debug4); + log_level_filter |= (eCAL::Logging::eLogLevel::log_level_debug1 | eCAL::Logging::eLogLevel::log_level_debug2 | eCAL::Logging::eLogLevel::log_level_debug3 | eCAL::Logging::eLogLevel::log_level_debug4); } if (ui_.info_checkbox->isChecked()) { - log_level_filter |= eCAL_Logging_eLogLevel::log_level_info; + log_level_filter |= eCAL::Logging::eLogLevel::log_level_info; } if (ui_.warning_checkbox->isChecked()) { - log_level_filter |= eCAL_Logging_eLogLevel::log_level_warning; + log_level_filter |= eCAL::Logging::eLogLevel::log_level_warning; } if (ui_.error_checkbox->isChecked()) { - log_level_filter |= eCAL_Logging_eLogLevel::log_level_error; + log_level_filter |= eCAL::Logging::eLogLevel::log_level_error; } if (ui_.fatal_checkbox->isChecked()) { - log_level_filter |= eCAL_Logging_eLogLevel::log_level_fatal; + log_level_filter |= eCAL::Logging::eLogLevel::log_level_fatal; } - log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter); + log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter); } void LogWidget::setPaused(bool paused) @@ -402,11 +402,11 @@ void LogWidget::setLogLevelFilter(int log_level) ui_.error_checkbox ->blockSignals(true); ui_.fatal_checkbox ->blockSignals(true); - ui_.debug_checkbox ->setChecked(log_level & (eCAL_Logging_eLogLevel::log_level_debug1 | eCAL_Logging_eLogLevel::log_level_debug2 | eCAL_Logging_eLogLevel::log_level_debug3 | eCAL_Logging_eLogLevel::log_level_debug4)); - ui_.info_checkbox ->setChecked(log_level & eCAL_Logging_eLogLevel::log_level_info); - ui_.warning_checkbox->setChecked(log_level & eCAL_Logging_eLogLevel::log_level_warning); - ui_.error_checkbox ->setChecked(log_level & eCAL_Logging_eLogLevel::log_level_error); - ui_.fatal_checkbox ->setChecked(log_level & eCAL_Logging_eLogLevel::log_level_fatal); + ui_.debug_checkbox ->setChecked(log_level & (eCAL::Logging::eLogLevel::log_level_debug1 | eCAL::Logging::eLogLevel::log_level_debug2 | eCAL::Logging::eLogLevel::log_level_debug3 | eCAL::Logging::eLogLevel::log_level_debug4)); + ui_.info_checkbox ->setChecked(log_level & eCAL::Logging::eLogLevel::log_level_info); + ui_.warning_checkbox->setChecked(log_level & eCAL::Logging::eLogLevel::log_level_warning); + ui_.error_checkbox ->setChecked(log_level & eCAL::Logging::eLogLevel::log_level_error); + ui_.fatal_checkbox ->setChecked(log_level & eCAL::Logging::eLogLevel::log_level_fatal); updateLogLevelFilter(); diff --git a/app/mon/mon_gui/src/widgets/models/log_model.cpp b/app/mon/mon_gui/src/widgets/models/log_model.cpp index f6e47596d1..cce9284b91 100644 --- a/app/mon/mon_gui/src/widgets/models/log_model.cpp +++ b/app/mon/mon_gui/src/widgets/models/log_model.cpp @@ -115,21 +115,21 @@ QString LogModel::logLevelToString(int log_level) { switch (log_level) { - case eCAL_Logging_eLogLevel::log_level_debug1: + case eCAL::Logging::eLogLevel::log_level_debug1: return "Debug 1"; - case eCAL_Logging_eLogLevel::log_level_debug2: + case eCAL::Logging::eLogLevel::log_level_debug2: return "Debug 2"; - case eCAL_Logging_eLogLevel::log_level_debug3: + case eCAL::Logging::eLogLevel::log_level_debug3: return "Debug 3"; - case eCAL_Logging_eLogLevel::log_level_debug4: + case eCAL::Logging::eLogLevel::log_level_debug4: return "Debug 4"; - case eCAL_Logging_eLogLevel::log_level_info: + case eCAL::Logging::eLogLevel::log_level_info: return "Info"; - case eCAL_Logging_eLogLevel::log_level_warning: + case eCAL::Logging::eLogLevel::log_level_warning: return "Warning"; - case eCAL_Logging_eLogLevel::log_level_error: + case eCAL::Logging::eLogLevel::log_level_error: return "Error"; - case eCAL_Logging_eLogLevel::log_level_fatal: + case eCAL::Logging::eLogLevel::log_level_fatal: return "Fatal"; default: return "Unknown"; @@ -140,13 +140,13 @@ QVariant LogModel::logLevelColor(int log_level) { switch (log_level) { - case eCAL_Logging_eLogLevel::log_level_info: + case eCAL::Logging::eLogLevel::log_level_info: return QColor(91, 155, 213); - case eCAL_Logging_eLogLevel::log_level_warning: + case eCAL::Logging::eLogLevel::log_level_warning: return QColor(255, 192, 0); - case eCAL_Logging_eLogLevel::log_level_error: + case eCAL::Logging::eLogLevel::log_level_error: return QColor(255, 100, 10); - case eCAL_Logging_eLogLevel::log_level_fatal: + case eCAL::Logging::eLogLevel::log_level_fatal: return QColor(192, 0, 0); default: return QVariant(); // Invalid QVariant // Default color for "Debug x" diff --git a/app/mon/mon_gui/src/widgets/models/log_sort_filter_proxy_model.cpp b/app/mon/mon_gui/src/widgets/models/log_sort_filter_proxy_model.cpp index 259461b6b9..00fbc36ab2 100644 --- a/app/mon/mon_gui/src/widgets/models/log_sort_filter_proxy_model.cpp +++ b/app/mon/mon_gui/src/widgets/models/log_sort_filter_proxy_model.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ #include "item_data_roles.h" LogSortFilterProxyModel::LogSortFilterProxyModel(QObject* parent) - : QMulticolumnSortFilterProxyModel(parent), log_level_filter_(log_level_none) + : QMulticolumnSortFilterProxyModel(parent), log_level_filter_(eCAL::Logging::eLogLevel::log_level_none) { setRecursiveFilteringEnabled(true); } @@ -44,13 +44,13 @@ bool LogSortFilterProxyModel::filterDirectAcceptsRow(int source_row, const QMode return false; } -void LogSortFilterProxyModel::setLogLevelFilter(eCAL_Logging_eLogLevel log_levels) +void LogSortFilterProxyModel::setLogLevelFilter(eCAL::Logging::eLogLevel log_levels) { log_level_filter_ = log_levels; invalidateFilter(); } -eCAL_Logging_eLogLevel LogSortFilterProxyModel::logLevelFilter() const +eCAL::Logging::eLogLevel LogSortFilterProxyModel::logLevelFilter() const { return log_level_filter_; } \ No newline at end of file diff --git a/app/mon/mon_gui/src/widgets/models/log_sort_filter_proxy_model.h b/app/mon/mon_gui/src/widgets/models/log_sort_filter_proxy_model.h index 37d91bd5df..573f69459b 100644 --- a/app/mon/mon_gui/src/widgets/models/log_sort_filter_proxy_model.h +++ b/app/mon/mon_gui/src/widgets/models/log_sort_filter_proxy_model.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,12 +29,12 @@ class LogSortFilterProxyModel : LogSortFilterProxyModel(QObject* parent = 0); ~LogSortFilterProxyModel(); - void setLogLevelFilter(eCAL_Logging_eLogLevel log_levels); + void setLogLevelFilter(eCAL::Logging::eLogLevel log_levels); - eCAL_Logging_eLogLevel logLevelFilter() const; + eCAL::Logging::eLogLevel logLevelFilter() const; private: - eCAL_Logging_eLogLevel log_level_filter_; + eCAL::Logging::eLogLevel log_level_filter_; bool filterDirectAcceptsRow(int source_row, const QModelIndex &source_parent) const override; }; diff --git a/app/mon/mon_plugins/capnproto_reflection/src/plugin_widget.cpp b/app/mon/mon_plugins/capnproto_reflection/src/plugin_widget.cpp index f028405537..177748f36f 100644 --- a/app/mon/mon_plugins/capnproto_reflection/src/plugin_widget.cpp +++ b/app/mon/mon_plugins/capnproto_reflection/src/plugin_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -208,7 +208,7 @@ void PluginWidget::updateTree() // tree view and replace it with a dummy error-item. We also log an eCAL // error message. - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_error, "Error when receiving data on topic \"" + topic_name_.toStdString() + "\": " + last_error_string_.toStdString()); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_error, "Error when receiving data on topic \"" + topic_name_.toStdString() + "\": " + last_error_string_.toStdString()); tree_model_->removeAllChildren(); currently_showing_error_item_ = true; diff --git a/app/mon/mon_plugins/protobuf_reflection/src/plugin_widget.cpp b/app/mon/mon_plugins/protobuf_reflection/src/plugin_widget.cpp index d0051340e7..73d4a5e38d 100644 --- a/app/mon/mon_plugins/protobuf_reflection/src/plugin_widget.cpp +++ b/app/mon/mon_plugins/protobuf_reflection/src/plugin_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -206,7 +206,7 @@ void PluginWidget::updateTree() // tree view and replace it with a dummy error-item. We also log an eCAL // error message. - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_error, "Error when receiving data on topic \"" + topic_name_.toStdString() + "\": " + last_error_string_.toStdString()); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_error, "Error when receiving data on topic \"" + topic_name_.toStdString() + "\": " + last_error_string_.toStdString()); tree_model_->removeAllChildren(); currently_showing_error_item_ = true; diff --git a/app/mon/mon_plugins/signals_plotting/src/plugin_widget.cpp b/app/mon/mon_plugins/signals_plotting/src/plugin_widget.cpp index 2b6ddd7159..3fb8769429 100644 --- a/app/mon/mon_plugins/signals_plotting/src/plugin_widget.cpp +++ b/app/mon/mon_plugins/signals_plotting/src/plugin_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -323,7 +323,7 @@ void PluginWidget::updateTree() void PluginWidget::showErrorMessage() { - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_error, "Error when receiving data on topic \"" + topic_name_.toStdString() + "\": " + last_error_string_.toStdString()); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_error, "Error when receiving data on topic \"" + topic_name_.toStdString() + "\": " + last_error_string_.toStdString()); tree_model_->removeAllChildren(); tree_view_->setVisible(false); diff --git a/app/mon/mon_tui/src/main.cpp b/app/mon/mon_tui/src/main.cpp index 33e4c348a9..b6cc95a127 100644 --- a/app/mon/mon_tui/src/main.cpp +++ b/app/mon/mon_tui/src/main.cpp @@ -37,7 +37,7 @@ int main(int argc, char** argv) auto status = eCAL::Initialize(config, "eCALMon TUI", eCAL::Init::Default | eCAL::Init::Monitoring); if (status == -1) std::cerr << "Failed to init" << std::endl; - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Running"); TUI::Start(args); diff --git a/app/mon/mon_tui/src/model/log.hpp b/app/mon/mon_tui/src/model/log.hpp index 48a8a8fbd8..0bdebdec77 100644 --- a/app/mon/mon_tui/src/model/log.hpp +++ b/app/mon/mon_tui/src/model/log.hpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,21 +73,21 @@ class LogModel { switch (val) { - case eCAL_Logging_eLogLevel::log_level_debug1: + case eCAL::Logging::eLogLevel::log_level_debug1: return LogEntry::Level::DEBUG1; - case eCAL_Logging_eLogLevel::log_level_debug2: + case eCAL::Logging::eLogLevel::log_level_debug2: return LogEntry::Level::DEBUG2; - case eCAL_Logging_eLogLevel::log_level_debug3: + case eCAL::Logging::eLogLevel::log_level_debug3: return LogEntry::Level::DEBUG3; - case eCAL_Logging_eLogLevel::log_level_debug4: + case eCAL::Logging::eLogLevel::log_level_debug4: return LogEntry::Level::DEBUG4; - case eCAL_Logging_eLogLevel::log_level_warning: + case eCAL::Logging::eLogLevel::log_level_warning: return LogEntry::Level::WARNING; - case eCAL_Logging_eLogLevel::log_level_error: + case eCAL::Logging::eLogLevel::log_level_error: return LogEntry::Level::ERROR; - case eCAL_Logging_eLogLevel::log_level_fatal: + case eCAL::Logging::eLogLevel::log_level_fatal: return LogEntry::Level::FATAL; - case eCAL_Logging_eLogLevel::log_level_info: + case eCAL::Logging::eLogLevel::log_level_info: default: return LogEntry::Level::INFO; } diff --git a/app/play/play_core/src/ecal_play.cpp b/app/play/play_core/src/ecal_play.cpp index 5c905e2a0c..7dfb4dfb9e 100644 --- a/app/play/play_core/src/ecal_play.cpp +++ b/app/play/play_core/src/ecal_play.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ EcalPlay::EcalPlay() play_thread_ = std::make_unique(); play_thread_->Start(); - eCAL::Process::SetState(eCAL_Process_eSeverity::proc_sev_warning, eCAL_Process_eSeverity_Level::proc_sev_level1, "No measurement loaded"); + eCAL::Process::SetState(eCAL::Process::eSeverity::warning, eCAL::Process::eSeverityLevel::level1, "No measurement loaded"); } EcalPlay::~EcalPlay() @@ -114,14 +114,14 @@ bool EcalPlay::LoadMeasurement(const std::string& path) LoadScenarios(meas_dir + "/doc", meas_dir + "/doc/scenario.txt"); LogMeasurementSummary(); - eCAL::Process::SetState(eCAL_Process_eSeverity::proc_sev_healthy, eCAL_Process_eSeverity_Level::proc_sev_level1, "Measurement loaded"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Measurement loaded"); return true; } else { EcalPlayLogger::Instance()->error("Failed loading measurement from: " + meas_dir); - eCAL::Process::SetState(eCAL_Process_eSeverity::proc_sev_warning, eCAL_Process_eSeverity_Level::proc_sev_level1, "Failed loading measurement"); + eCAL::Process::SetState(eCAL::Process::eSeverity::warning, eCAL::Process::eSeverityLevel::level1, "Failed loading measurement"); return false; } } diff --git a/app/play/play_core/src/play_thread.cpp b/app/play/play_core/src/play_thread.cpp index 6e4de55d9a..cb99277677 100644 --- a/app/play/play_core/src/play_thread.cpp +++ b/app/play/play_core/src/play_thread.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -273,7 +273,7 @@ void PlayThread::Run() if (!command.playing_) { EcalPlayLogger::Instance()->info("Playback finished"); - eCAL::Process::SetState(eCAL_Process_eSeverity::proc_sev_healthy, eCAL_Process_eSeverity_Level::proc_sev_level1, "Playback finished"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Playback finished"); } } } @@ -355,7 +355,7 @@ void PlayThread::SetPlaying_Private(bool playing) command_.sim_time_local_timestamp_ = now; EcalPlayLogger::Instance()->info("Playback pause"); - eCAL::Process::SetState(eCAL_Process_eSeverity::proc_sev_healthy, eCAL_Process_eSeverity_Level::proc_sev_level1, "Paused"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Paused"); } else if (!command_.playing_ && playing) { @@ -365,7 +365,7 @@ void PlayThread::SetPlaying_Private(bool playing) command_.sim_time_local_timestamp_ = std::chrono::steady_clock::now(); EcalPlayLogger::Instance()->info("Playback start"); - eCAL::Process::SetState(eCAL_Process_eSeverity::proc_sev_healthy, eCAL_Process_eSeverity_Level::proc_sev_level1, "Playing"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Playing"); } command_.playing_ = playing; diff --git a/app/rec/rec_client_cli/src/ecal_rec_cli.cpp b/app/rec/rec_client_cli/src/ecal_rec_cli.cpp index 1fb19770f3..7cf453aaee 100644 --- a/app/rec/rec_client_cli/src/ecal_rec_cli.cpp +++ b/app/rec/rec_client_cli/src/ecal_rec_cli.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -427,7 +427,7 @@ void UpdateEcalState() if (!rec_status.initialized_) { - eCAL::Process::SetState(eCAL_Process_eSeverity::proc_sev_warning, eCAL_Process_eSeverity_Level::proc_sev_level1 + eCAL::Process::SetState(eCAL::Process::eSeverity::warning, eCAL::Process::eSeverityLevel::level1 , "Not initialized"); } else @@ -467,13 +467,13 @@ void UpdateEcalState() } } - eCAL_Process_eSeverity severity(eCAL_Process_eSeverity::proc_sev_healthy); + eCAL::Process::eSeverity severity(eCAL::Process::eSeverity::healthy); std::string state_string; // General error if (!rec_status.info_.first) { - severity = eCAL_Process_eSeverity::proc_sev_critical; + severity = eCAL::Process::eSeverity::critical; state_string = "[" + rec_status.info_.second + "] "; } @@ -488,7 +488,7 @@ void UpdateEcalState() } if (rec_status.subscribed_topics_.empty()) - severity = std::max(severity, eCAL_Process_eSeverity::proc_sev_warning); + severity = std::max(severity, eCAL::Process::eSeverity::warning); state_string += "(" + std::to_string(rec_status.subscribed_topics_.size()) + " Topics) "; @@ -504,7 +504,7 @@ void UpdateEcalState() state_string += ", " + std::to_string(flushing_jobs_.size()) + " job" + (flushing_jobs_.size() > 1 ? "s" : "") + " uploading"; } - eCAL::Process::SetState(severity, eCAL_Process_eSeverity_Level::proc_sev_level1, state_string.c_str()); + eCAL::Process::SetState(severity, eCAL::Process::eSeverityLevel::level1, state_string.c_str()); } } diff --git a/app/rec/rec_gui/src/qecalrec.cpp b/app/rec/rec_gui/src/qecalrec.cpp index 1e77e17e7d..49926096f4 100644 --- a/app/rec/rec_gui/src/qecalrec.cpp +++ b/app/rec/rec_gui/src/qecalrec.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,7 @@ Date: $HOST{TIME %F %R} auto status = this->status(); auto config = this->enabledRecClients(); auto ecalstate = eCAL::rec_server::GetProcessSeverity(status, config); - eCAL::Process::SetState(ecalstate.first, eCAL_Process_eSeverity_Level::proc_sev_level1, ecalstate.second.c_str()); + eCAL::Process::SetState(ecalstate.first, eCAL::Process::eSeverityLevel::level1, ecalstate.second.c_str()); }); ecal_state_update_timer_->start(ecal_state_update_time_ms_); diff --git a/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp b/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp index 099da95d24..13f15cea6c 100644 --- a/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp +++ b/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -331,7 +331,7 @@ int main(int argc, char** argv) if (remote_control_arg.isSet()) // Remote-control-mode { eCAL::Initialize("eCALRec-Remote", eCAL::Init::All); - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Running"); remote_rec_server_service = std::make_shared>(); } diff --git a/app/rec/rec_server_core/include/rec_server_core/ecalstate_helpers.h b/app/rec/rec_server_core/include/rec_server_core/ecalstate_helpers.h index 403cddb084..23069b5bcb 100644 --- a/app/rec/rec_server_core/include/rec_server_core/ecalstate_helpers.h +++ b/app/rec/rec_server_core/include/rec_server_core/ecalstate_helpers.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,6 @@ namespace eCAL { namespace rec_server { - std::pair GetProcessSeverity(const eCAL::rec_server::RecServerStatus& rec_server_status, const std::map& rec_server_config); + std::pair GetProcessSeverity(const eCAL::rec_server::RecServerStatus& rec_server_status, const std::map& rec_server_config); } } \ No newline at end of file diff --git a/app/rec/rec_server_core/src/ecalstate_helpers.cpp b/app/rec/rec_server_core/src/ecalstate_helpers.cpp index c4cdfd80bc..8ac5859030 100644 --- a/app/rec/rec_server_core/src/ecalstate_helpers.cpp +++ b/app/rec/rec_server_core/src/ecalstate_helpers.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,14 +25,14 @@ namespace eCAL { namespace rec_server { - std::pair GetProcessSeverity(const eCAL::rec_server::RecServerStatus& rec_server_status, const std::map& enabled_rec_clients) + std::pair GetProcessSeverity(const eCAL::rec_server::RecServerStatus& rec_server_status, const std::map& enabled_rec_clients) { - eCAL_Process_eSeverity severity(eCAL_Process_eSeverity::proc_sev_healthy); + eCAL::Process::eSeverity severity(eCAL::Process::eSeverity::healthy); std::string state_string; if(!rec_server_status.activated_) { - severity = std::max(severity, eCAL_Process_eSeverity::proc_sev_warning); + severity = std::max(severity, eCAL::Process::eSeverity::warning); state_string = "Not activated"; } else @@ -77,7 +77,7 @@ namespace eCAL if ((not_connected_hosts > 0) || (not_connected_addons > 0)) { - severity = std::max(severity, eCAL_Process_eSeverity::proc_sev_critical); + severity = std::max(severity, eCAL::Process::eSeverity::critical); state_string += ", Failed connecting to "; if (not_connected_hosts > 0) { @@ -92,7 +92,7 @@ namespace eCAL } else if (connected_hosts == 0) { - severity = std::max(severity, eCAL_Process_eSeverity::proc_sev_warning); + severity = std::max(severity, eCAL::Process::eSeverity::warning); state_string += ", No clients"; } else diff --git a/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp b/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp index 0c28c4a9ee..52eeba693a 100644 --- a/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp +++ b/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,12 +46,12 @@ ExternalEcalRecInstance::ExternalEcalRecInstance(bool gui) if (gui) { std::cout << "Starting " << "\"" << ECAL_REC_GUI_PATH << "\"" << std::endl; - pid = eCAL::Process::StartProcess(ECAL_REC_GUI_PATH, "", "", false, eCAL_Process_eStartMode::proc_smode_minimized, false); + pid = eCAL::Process::StartProcess(ECAL_REC_GUI_PATH, "", "", false, eCAL::Process::eStartMode::minimized, false); } else { std::cout << "Starting " << "\"" << ECAL_REC_CLI_PATH << "\"" << std::endl; - pid = eCAL::Process::StartProcess(ECAL_REC_CLI_PATH, "--interactive-dont-exit --no-default", "", false, eCAL_Process_eStartMode::proc_smode_hidden, false); + pid = eCAL::Process::StartProcess(ECAL_REC_CLI_PATH, "--interactive-dont-exit --no-default", "", false, eCAL::Process::eStartMode::hidden, false); } if (pid != 0) diff --git a/app/sys/sys_cli/src/commands/list.cpp b/app/sys/sys_cli/src/commands/list.cpp index 8fc98c9c8f..04814a62ed 100644 --- a/app/sys/sys_cli/src/commands/list.cpp +++ b/app/sys/sys_cli/src/commands/list.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -256,7 +256,7 @@ namespace eCAL size_t longest_state = header_data[6].size(); std::vector> string_data; - std::vector serverity_data; + std::vector serverity_data; string_data .reserve(task_list.size()); serverity_data.reserve(task_list.size()); @@ -284,16 +284,16 @@ namespace eCAL switch (monitoring_state.severity) { - case eCAL_Process_eSeverity::proc_sev_healthy: + case eCAL::Process::eSeverity::healthy: state_ss << termcolor::on_green << state << termcolor::reset; break; - case eCAL_Process_eSeverity::proc_sev_warning: + case eCAL::Process::eSeverity::warning: state_ss << termcolor::on_yellow << state << termcolor::reset; break; - case eCAL_Process_eSeverity::proc_sev_critical: + case eCAL::Process::eSeverity::critical: state_ss << termcolor::on_red << state << termcolor::reset; break; - case eCAL_Process_eSeverity::proc_sev_failed: + case eCAL::Process::eSeverity::failed: state_ss << termcolor::on_magenta << state << termcolor::reset; break; default: @@ -353,16 +353,16 @@ namespace eCAL switch (serverity_data[i]) { - case eCAL_Process_eSeverity::proc_sev_healthy: + case eCAL::Process::eSeverity::healthy: std::cout << termcolor::on_green; break; - case eCAL_Process_eSeverity::proc_sev_warning: + case eCAL::Process::eSeverity::warning: std::cout << termcolor::on_yellow; break; - case eCAL_Process_eSeverity::proc_sev_critical: + case eCAL::Process::eSeverity::critical: std::cout << termcolor::on_red; break; - case eCAL_Process_eSeverity::proc_sev_failed: + case eCAL::Process::eSeverity::failed: std::cout << termcolor::on_magenta; break; default: @@ -382,16 +382,16 @@ namespace eCAL std::string visibility_string; switch (task->GetVisibility()) { - case eCAL_Process_eStartMode::proc_smode_hidden: + case eCAL::Process::eStartMode::hidden: visibility_string = "hidden"; break; - case eCAL_Process_eStartMode::proc_smode_minimized: + case eCAL::Process::eStartMode::minimized: visibility_string = "minimized"; break; - case eCAL_Process_eStartMode::proc_smode_maximized: + case eCAL::Process::eStartMode::maximized: visibility_string = "maximized"; break; - case eCAL_Process_eStartMode::proc_smode_normal: + case eCAL::Process::eStartMode::normal: visibility_string = "normal"; break; default: @@ -424,23 +424,23 @@ namespace eCAL switch (task_state.severity) { - case eCAL_Process_eSeverity::proc_sev_healthy: + case eCAL::Process::eSeverity::healthy: std::cout << termcolor::on_green; break; - case eCAL_Process_eSeverity::proc_sev_warning: + case eCAL::Process::eSeverity::warning: std::cout << termcolor::on_yellow; break; - case eCAL_Process_eSeverity::proc_sev_critical: + case eCAL::Process::eSeverity::critical: std::cout << termcolor::on_red; break; - case eCAL_Process_eSeverity::proc_sev_failed: + case eCAL::Process::eSeverity::failed: std::cout << termcolor::on_magenta; break; default: break; } - std::cout << "State: " << (task_state.severity == eCAL_Process_eSeverity::proc_sev_unknown ? state : state + " " + level) << std::endl; + std::cout << "State: " << (task_state.severity == eCAL::Process::eSeverity::unknown ? state : state + " " + level) << std::endl; std::cout << termcolor::reset; std::cout << "Info: " << task_state.info << std::endl; diff --git a/app/sys/sys_cli/src/ecalsys_cli.cpp b/app/sys/sys_cli/src/ecalsys_cli.cpp index 8df947597f..24531699c1 100644 --- a/app/sys/sys_cli/src/ecalsys_cli.cpp +++ b/app/sys/sys_cli/src/ecalsys_cli.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -238,14 +238,14 @@ int main(int argc, char** argv) if (remote_control_arg.isSet()) // Remote-control-mode { eCAL::Initialize("eCALSys-Remote", eCAL::Init::All); - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Running"); remote_ecalsys_service = std::make_shared>(); } else // Non-remote control mode { eCAL::Initialize("eCALSys", eCAL::Init::All); - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Running"); ecalsys_instance = std::make_shared(); diff --git a/app/sys/sys_client_core/include/sys_client_core/proto_helpers.h b/app/sys/sys_client_core/include/sys_client_core/proto_helpers.h index 77676cd38b..dd508ed891 100644 --- a/app/sys/sys_client_core/include/sys_client_core/proto_helpers.h +++ b/app/sys/sys_client_core/include/sys_client_core/proto_helpers.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ namespace eCAL void FromProtobuf(const eCAL::pb::sys_client::Task& task_pb, eCAL::sys_client::Task& task); void FromProtobuf(const eCAL::pb::sys_client::Runner& runner_pb, eCAL::sys_client::Runner& runner); - void FromProtobuf(const eCAL::pb::sys_client::WindowMode& window_mode_pb, eCAL_Process_eStartMode& window_mode); + void FromProtobuf(const eCAL::pb::sys_client::WindowMode& window_mode_pb, eCAL::Process::eStartMode& window_mode); void FromProtobuf(const eCAL::pb::sys_client::StartTaskParameters& start_task_param_pb, StartTaskParameters& start_task_param); void FromProtobuf(const eCAL::pb::sys_client::StartTaskRequest& start_task_list_pb, std::vector& start_task_list); void FromProtobuf(const eCAL::pb::sys_client::StopTaskParameters& stop_task_param_pb, StopTaskParameters& stop_task_param); @@ -58,7 +58,7 @@ namespace eCAL eCAL::sys_client::Task FromProtobuf(const eCAL::pb::sys_client::Task& task_pb); eCAL::sys_client::Runner FromProtobuf(const eCAL::pb::sys_client::Runner& runner_pb); - eCAL_Process_eStartMode FromProtobuf(const eCAL::pb::sys_client::WindowMode& window_mode_pb); + eCAL::Process::eStartMode FromProtobuf(const eCAL::pb::sys_client::WindowMode& window_mode_pb); StartTaskParameters FromProtobuf(const eCAL::pb::sys_client::StartTaskParameters& start_task_param_pb); std::vector FromProtobuf(const eCAL::pb::sys_client::StartTaskRequest& start_task_list_pb); StopTaskParameters FromProtobuf(const eCAL::pb::sys_client::StopTaskParameters& stop_task_param_pb); @@ -73,7 +73,7 @@ namespace eCAL void ToProtobuf(eCAL::pb::sys_client::Task& task_pb, const eCAL::sys_client::Task& task); void ToProtobuf(eCAL::pb::sys_client::Runner& runner_pb, const eCAL::sys_client::Runner& runner); - void ToProtobuf(eCAL::pb::sys_client::WindowMode& window_mode_pb, const eCAL_Process_eStartMode window_mode); + void ToProtobuf(eCAL::pb::sys_client::WindowMode& window_mode_pb, const eCAL::Process::eStartMode window_mode); void ToProtobuf(eCAL::pb::sys_client::StartTaskParameters& start_task_param_pb, const StartTaskParameters& start_task_param); void ToProtobuf(eCAL::pb::sys_client::StartTaskRequest& start_task_list_pb, const std::vector& start_task_list); void ToProtobuf(eCAL::pb::sys_client::StopTaskParameters& stop_task_param_pb, const StopTaskParameters& stop_task_param); @@ -84,7 +84,7 @@ namespace eCAL eCAL::pb::sys_client::Task ToProtobuf(const eCAL::sys_client::Task& task); eCAL::pb::sys_client::Runner ToProtobuf(const eCAL::sys_client::Runner& runner); - eCAL::pb::sys_client::WindowMode ToProtobuf(const eCAL_Process_eStartMode window_mode); + eCAL::pb::sys_client::WindowMode ToProtobuf(const eCAL::Process::eStartMode window_mode); eCAL::pb::sys_client::StartTaskParameters ToProtobuf(const StartTaskParameters& start_task_param); eCAL::pb::sys_client::StartTaskRequest ToProtobuf(const std::vector& start_task_list); eCAL::pb::sys_client::StopTaskParameters ToProtobuf(const StopTaskParameters& stop_task_param); diff --git a/app/sys/sys_client_core/include/sys_client_core/task.h b/app/sys/sys_client_core/include/sys_client_core/task.h index 6a80db254c..f8c5158686 100644 --- a/app/sys/sys_client_core/include/sys_client_core/task.h +++ b/app/sys/sys_client_core/include/sys_client_core/task.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,12 +42,12 @@ namespace eCAL struct StartTaskParameters { StartTaskParameters() - : window_mode (eCAL_Process_eStartMode::proc_smode_normal) + : window_mode (eCAL::Process::eStartMode::normal) , create_console(false) {} Task task; - eCAL_Process_eStartMode window_mode; + eCAL::Process::eStartMode window_mode; bool create_console; }; diff --git a/app/sys/sys_client_core/src/proto_helpers.cpp b/app/sys/sys_client_core/src/proto_helpers.cpp index 1e13ac793a..655bb9e977 100644 --- a/app/sys/sys_client_core/src/proto_helpers.cpp +++ b/app/sys/sys_client_core/src/proto_helpers.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ namespace eCAL runner.default_task_dir = runner_pb.default_task_dir(); } - void FromProtobuf(const eCAL::pb::sys_client::WindowMode& window_mode_pb, eCAL_Process_eStartMode& window_mode) + void FromProtobuf(const eCAL::pb::sys_client::WindowMode& window_mode_pb, eCAL::Process::eStartMode& window_mode) { window_mode = FromProtobuf(window_mode_pb); } @@ -132,18 +132,18 @@ namespace eCAL return runner; } - eCAL_Process_eStartMode FromProtobuf(const eCAL::pb::sys_client::WindowMode& window_mode_pb) + eCAL::Process::eStartMode FromProtobuf(const eCAL::pb::sys_client::WindowMode& window_mode_pb) { switch (window_mode_pb) { case eCAL::pb::sys_client::WindowMode::hidden: - return eCAL_Process_eStartMode::proc_smode_hidden; + return eCAL::Process::eStartMode::hidden; case eCAL::pb::sys_client::WindowMode::minimized: - return eCAL_Process_eStartMode::proc_smode_minimized; + return eCAL::Process::eStartMode::minimized; case eCAL::pb::sys_client::WindowMode::maximized: - return eCAL_Process_eStartMode::proc_smode_maximized; + return eCAL::Process::eStartMode::maximized; default: - return eCAL_Process_eStartMode::proc_smode_normal; + return eCAL::Process::eStartMode::normal; } } @@ -216,7 +216,7 @@ namespace eCAL runner_pb.set_default_task_dir(runner.default_task_dir); } - void ToProtobuf(eCAL::pb::sys_client::WindowMode& window_mode_pb, const eCAL_Process_eStartMode window_mode) + void ToProtobuf(eCAL::pb::sys_client::WindowMode& window_mode_pb, const eCAL::Process::eStartMode window_mode) { window_mode_pb = ToProtobuf(window_mode); } @@ -298,15 +298,15 @@ namespace eCAL return output; } - eCAL::pb::sys_client::WindowMode ToProtobuf(const eCAL_Process_eStartMode window_mode) + eCAL::pb::sys_client::WindowMode ToProtobuf(const eCAL::Process::eStartMode window_mode) { switch (window_mode) { - case eCAL_Process_eStartMode::proc_smode_hidden: + case eCAL::Process::eStartMode::hidden: return eCAL::pb::sys_client::WindowMode::hidden; - case eCAL_Process_eStartMode::proc_smode_minimized: + case eCAL::Process::eStartMode::minimized: return eCAL::pb::sys_client::WindowMode::minimized; - case eCAL_Process_eStartMode::proc_smode_maximized: + case eCAL::Process::eStartMode::maximized: return eCAL::pb::sys_client::WindowMode::maximized; default: return eCAL::pb::sys_client::WindowMode::normal; diff --git a/app/sys/sys_core/include/ecalsys/task/ecal_sys_task.h b/app/sys/sys_core/include/ecalsys/task/ecal_sys_task.h index 6b6cd82489..02339e21e6 100644 --- a/app/sys/sys_core/include/ecalsys/task/ecal_sys_task.h +++ b/app/sys/sys_core/include/ecalsys/task/ecal_sys_task.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,7 +85,7 @@ class EcalSysTask std::chrono::nanoseconds GetTimeoutAfterStart(); /** @return The configured startup-visibility when starting this Task on a Windows host.*/ - eCAL_Process_eStartMode GetVisibility(); + eCAL::Process::eStartMode GetVisibility(); /** @return The configured arguments that will be given to the task when being started.*/ std::string GetCommandLineArguments(); @@ -125,7 +125,7 @@ class EcalSysTask void SetTimeoutAfterStart (std::chrono::nanoseconds timeout); /** @brief Sets the visibility when starting the task on a Windows machine. */ - void SetVisibility (eCAL_Process_eStartMode visibility); + void SetVisibility (eCAL::Process::eStartMode visibility); /** @brief Sets the arguments that will be given to the task when being started. */ void SetCommandLineArguments (std::string command_line_args); @@ -290,7 +290,7 @@ class EcalSysTask std::string m_working_directory; /**< The working directory when starting the process */ unsigned int m_launch_order; /**< The order in which tasks will start when started simultaneously. */ std::chrono::nanoseconds m_timeout_after_start; /**< After being started, the task may wait a certain amount of time and thus delay the start of other tasks that are started at the same time but have a higher launch order number.*/ - eCAL_Process_eStartMode m_visibility; /**< The visibility when starting this task on a Windows system */ + eCAL::Process::eStartMode m_visibility; /**< The visibility when starting this task on a Windows system */ bool m_monitoring_enabled; /**< When true, this task will be monitored by the monitoring thread and the task state will be set accordingly. This is a requirement for the restart-by-severity functionality.*/ bool m_restart_by_severity_enabled; /**< When true, the task will be killed and restarted if it's severity reaches a certain state. */ diff --git a/app/sys/sys_core/include/ecalsys/task/task_state.h b/app/sys/sys_core/include/ecalsys/task/task_state.h index 367980088d..0e0f2efeb8 100644 --- a/app/sys/sys_core/include/ecalsys/task/task_state.h +++ b/app/sys/sys_core/include/ecalsys/task/task_state.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,16 +28,16 @@ class TaskState { public: - eCAL_Process_eSeverity severity; /**< The severity (Unknown, Healthy, Warning, Critical, Failed) */ - eCAL_Process_eSeverity_Level severity_level; /**< The severity Level (Level 1 - 5) */ + eCAL::Process::eSeverity severity; /**< The severity (Unknown, Healthy, Warning, Critical, Failed) */ + eCAL::Process::eSeverityLevel severity_level; /**< The severity Level (Level 1 - 5) */ std::string info; /**< A human readable status message */ /** * @brief Creates a new State (Unknown Level1) without info message. */ TaskState() - : severity(eCAL_Process_eSeverity::proc_sev_unknown) - , severity_level(eCAL_Process_eSeverity_Level::proc_sev_level1) + : severity(eCAL::Process::eSeverity::unknown) + , severity_level(eCAL::Process::eSeverityLevel::level1) , info("") {} @@ -46,7 +46,7 @@ class TaskState * @param severity The severity of the new state * @param severity_level The severity level of the new state */ - TaskState(eCAL_Process_eSeverity severity, eCAL_Process_eSeverity_Level severity_level) + TaskState(eCAL::Process::eSeverity severity, eCAL::Process::eSeverityLevel severity_level) : severity(severity) , severity_level(severity_level) , info("") @@ -94,53 +94,53 @@ class TaskState if (severity_string_lower == "unknown") { - severity = eCAL_Process_eSeverity::proc_sev_unknown; + severity = eCAL::Process::eSeverity::unknown; } else if (severity_string_lower == "healthy") { - severity = eCAL_Process_eSeverity::proc_sev_healthy; + severity = eCAL::Process::eSeverity::healthy; } else if (severity_string_lower == "warning") { - severity = eCAL_Process_eSeverity::proc_sev_warning; + severity = eCAL::Process::eSeverity::warning; } else if (severity_string_lower == "critical") { - severity = eCAL_Process_eSeverity::proc_sev_critical; + severity = eCAL::Process::eSeverity::critical; } else if (severity_string_lower == "failed") { - severity = eCAL_Process_eSeverity::proc_sev_failed; + severity = eCAL::Process::eSeverity::failed; } else { - severity = eCAL_Process_eSeverity::proc_sev_unknown; + severity = eCAL::Process::eSeverity::unknown; failure = true; } if (severity_level_string_lower == "level1" || severity_level_string_lower == "level 1") { - severity_level = eCAL_Process_eSeverity_Level::proc_sev_level1; + severity_level = eCAL::Process::eSeverityLevel::level1; } else if (severity_level_string_lower == "level2" || severity_level_string_lower == "level 2") { - severity_level = eCAL_Process_eSeverity_Level::proc_sev_level2; + severity_level = eCAL::Process::eSeverityLevel::level2; } else if (severity_level_string_lower == "level3" || severity_level_string_lower == "level 3") { - severity_level = eCAL_Process_eSeverity_Level::proc_sev_level3; + severity_level = eCAL::Process::eSeverityLevel::level3; } else if (severity_level_string_lower == "level4" || severity_level_string_lower == "level 4") { - severity_level = eCAL_Process_eSeverity_Level::proc_sev_level4; + severity_level = eCAL::Process::eSeverityLevel::level4; } else if (severity_level_string_lower == "level5" || severity_level_string_lower == "level 5") { - severity_level = eCAL_Process_eSeverity_Level::proc_sev_level5; + severity_level = eCAL::Process::eSeverityLevel::level5; } else { - severity_level = eCAL_Process_eSeverity_Level::proc_sev_level1; + severity_level = eCAL::Process::eSeverityLevel::level1; failure = true; } @@ -157,19 +157,19 @@ class TaskState { switch (severity_level) { - case eCAL_Process_eSeverity_Level::proc_sev_level1: + case eCAL::Process::eSeverityLevel::level1: severity_level_string = "Level1"; break; - case eCAL_Process_eSeverity_Level::proc_sev_level2: + case eCAL::Process::eSeverityLevel::level2: severity_level_string = "Level2"; break; - case eCAL_Process_eSeverity_Level::proc_sev_level3: + case eCAL::Process::eSeverityLevel::level3: severity_level_string = "Level3"; break; - case eCAL_Process_eSeverity_Level::proc_sev_level4: + case eCAL::Process::eSeverityLevel::level4: severity_level_string = "Level4"; break; - case eCAL_Process_eSeverity_Level::proc_sev_level5: + case eCAL::Process::eSeverityLevel::level5: severity_level_string = "Level5"; break; default: @@ -178,19 +178,19 @@ class TaskState switch (severity) { - case eCAL_Process_eSeverity::proc_sev_unknown: + case eCAL::Process::eSeverity::unknown: severity_string = "Unknown"; break; - case eCAL_Process_eSeverity::proc_sev_healthy: + case eCAL::Process::eSeverity::healthy: severity_string = "Healthy"; break; - case eCAL_Process_eSeverity::proc_sev_warning: + case eCAL::Process::eSeverity::warning: severity_string = "Warning"; break; - case eCAL_Process_eSeverity::proc_sev_critical: + case eCAL::Process::eSeverity::critical: severity_string = "Critical"; break; - case eCAL_Process_eSeverity::proc_sev_failed: + case eCAL::Process::eSeverity::failed: severity_string = "Failed"; break; default: @@ -215,17 +215,17 @@ class TaskState void FromInt(int combined_severity) { // We want to directly cast the severities. That will lead to funny bugs if someone eventually decides to change the ranges. - static_assert((int)eCAL_Process_eSeverity::proc_sev_unknown == 0, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); - static_assert((int)eCAL_Process_eSeverity::proc_sev_failed == 4, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); - static_assert((int)eCAL_Process_eSeverity_Level::proc_sev_level1 == 1, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); - static_assert((int)eCAL_Process_eSeverity_Level::proc_sev_level5 == 5, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); + static_assert((int)eCAL::Process::eSeverity::unknown == 0, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); + static_assert((int)eCAL::Process::eSeverity::failed == 4, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); + static_assert((int)eCAL::Process::eSeverityLevel::level1 == 1, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); + static_assert((int)eCAL::Process::eSeverityLevel::level5 == 5, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); // limit the interger to the desired range combined_severity = std::max(std::min(combined_severity, 24), 0); // calculate the interger severity / -level - severity = (eCAL_Process_eSeverity) (combined_severity / 5); - severity_level = (eCAL_Process_eSeverity_Level)(combined_severity % 5 + 1); + severity = (eCAL::Process::eSeverity) (combined_severity / 5); + severity_level = (eCAL::Process::eSeverityLevel)(combined_severity % 5 + 1); } /** @@ -245,10 +245,10 @@ class TaskState int ToInt() const { // We want to directly cast the severities. That will lead to funny bugs if someone eventually decides to change the ranges. - static_assert((int)eCAL_Process_eSeverity::proc_sev_unknown == 0, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); - static_assert((int)eCAL_Process_eSeverity::proc_sev_failed == 4, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); - static_assert((int)eCAL_Process_eSeverity_Level::proc_sev_level1 == 1, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); - static_assert((int)eCAL_Process_eSeverity_Level::proc_sev_level5 == 5, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); + static_assert((int)eCAL::Process::eSeverity::unknown == 0, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); + static_assert((int)eCAL::Process::eSeverity::failed == 4, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); + static_assert((int)eCAL::Process::eSeverityLevel::level1 == 1, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); + static_assert((int)eCAL::Process::eSeverityLevel::level5 == 5, "Somebody shifted the severity values! We expect severities to have a rage 0-4 and severity levels to have a range of 1-5!"); return ((int)severity * 5) + ((int)severity_level - 1); } diff --git a/app/sys/sys_core/src/config/config_manager.cpp b/app/sys/sys_core/src/config/config_manager.cpp index 2e99b7c2fb..da2515ef9a 100644 --- a/app/sys/sys_core/src/config/config_manager.cpp +++ b/app/sys/sys_core/src/config/config_manager.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -101,15 +101,15 @@ bool ConfigManager::LoadConfig(EcalSys& ecalsys, const std::string& path, bool a restart_at_severity.FromInt(restart_below_severity.ToInt() + 1); // parse the start visibility - eCAL_Process_eStartMode visibility = eCAL_Process_eStartMode::proc_smode_normal; + eCAL::Process::eStartMode visibility = eCAL::Process::eStartMode::normal; if (EcalUtils::String::Icompare(task_config.start_stop_.visibility_, "Normal") == true) - visibility = proc_smode_normal; + visibility = eCAL::Process::eStartMode::normal; if (EcalUtils::String::Icompare(task_config.start_stop_.visibility_, "Hidden") == true) - visibility = proc_smode_hidden; + visibility = eCAL::Process::eStartMode::hidden; if (EcalUtils::String::Icompare(task_config.start_stop_.visibility_, "Minimized") == true) - visibility = proc_smode_minimized; + visibility = eCAL::Process::eStartMode::minimized; if (EcalUtils::String::Icompare(task_config.start_stop_.visibility_, "Maximized") == true) - visibility = proc_smode_maximized; + visibility = eCAL::Process::eStartMode::maximized; // Find the correct runner (if the runner was the EXE / BAT runner that we removed earlier we will get a nullpointer, which is exactly what we want, here) std::shared_ptr runner(nullptr); @@ -339,16 +339,16 @@ bool ConfigManager::SaveConfig(EcalSys& ecalsys, const std::string& path, Config std::string visibility_string; switch (task->GetVisibility()) { - case proc_smode_normal: + case eCAL::Process::eStartMode::normal: visibility_string = "normal"; break; - case proc_smode_hidden: + case eCAL::Process::eStartMode::hidden: visibility_string = "hidden"; break; - case proc_smode_minimized: + case eCAL::Process::eStartMode::minimized: visibility_string = "minimized"; break; - case proc_smode_maximized: + case eCAL::Process::eStartMode::maximized: visibility_string = "maximized"; break; default: diff --git a/app/sys/sys_core/src/ecal_sys_monitor.cpp b/app/sys/sys_core/src/ecal_sys_monitor.cpp index 6455eb9aa4..142093336c 100644 --- a/app/sys/sys_core/src/ecal_sys_monitor.cpp +++ b/app/sys/sys_core/src/ecal_sys_monitor.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -133,8 +133,8 @@ void EcalSysMonitor::UpdateTaskStates(const std::list lock(m_monitoring_mutex); TaskState task_state; - task_state.severity = eCAL_Process_eSeverity::proc_sev_unknown; - task_state.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level1; + task_state.severity = eCAL::Process::eSeverity::unknown; + task_state.severity_level = eCAL::Process::eSeverityLevel::level1; bool task_mapping_found = false; if (!(task->IsMonitoringEnabled())) @@ -176,8 +176,8 @@ void EcalSysMonitor::UpdateTaskStates(const std::listIsMonitoringEnabled() && task->FoundInMonitorOnce() && !is_starting_or_stopping) { task_state.info = "Externally closed"; - task_state.severity = eCAL_Process_eSeverity::proc_sev_failed; - task_state.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level5; + task_state.severity = eCAL::Process::eSeverity::failed; + task_state.severity_level = eCAL::Process::eSeverityLevel::level5; } else { @@ -187,8 +187,8 @@ void EcalSysMonitor::UpdateTaskStates(const std::listGetMonitoringTaskState(); TaskState restart_state = task->GetRestartAtSeverity(); - if (current_state.severity != eCAL_Process_eSeverity::proc_sev_unknown + if (current_state.severity != eCAL::Process::eSeverity::unknown && current_state >= restart_state) { if (!is_starting_or_stopping) diff --git a/app/sys/sys_core/src/proto_helpers.cpp b/app/sys/sys_core/src/proto_helpers.cpp index a22cfc937a..dabd6db574 100644 --- a/app/sys/sys_core/src/proto_helpers.cpp +++ b/app/sys/sys_core/src/proto_helpers.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,44 +36,44 @@ namespace eCAL switch (task_state_pb.severity()) { case eCAL::pb::sys::eProcessSeverity::proc_sev_unknown: - task_state.severity = eCAL_Process_eSeverity::proc_sev_unknown; + task_state.severity = eCAL::Process::eSeverity::unknown; break; case eCAL::pb::sys::eProcessSeverity::proc_sev_healthy: - task_state.severity = eCAL_Process_eSeverity::proc_sev_healthy; + task_state.severity = eCAL::Process::eSeverity::healthy; break; case eCAL::pb::sys::eProcessSeverity::proc_sev_warning: - task_state.severity = eCAL_Process_eSeverity::proc_sev_warning; + task_state.severity = eCAL::Process::eSeverity::warning; break; case eCAL::pb::sys::eProcessSeverity::proc_sev_critical: - task_state.severity = eCAL_Process_eSeverity::proc_sev_critical; + task_state.severity = eCAL::Process::eSeverity::critical; break; case eCAL::pb::sys::eProcessSeverity::proc_sev_failed: - task_state.severity = eCAL_Process_eSeverity::proc_sev_failed; + task_state.severity = eCAL::Process::eSeverity::failed; break; default: - task_state.severity = eCAL_Process_eSeverity::proc_sev_unknown; + task_state.severity = eCAL::Process::eSeverity::unknown; break; } switch (task_state_pb.severity_level()) { case eCAL::pb::sys::eProcessSeverityLevel::proc_sev_level1: - task_state.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level1; + task_state.severity_level = eCAL::Process::eSeverityLevel::level1; break; case eCAL::pb::sys::eProcessSeverityLevel::proc_sev_level2: - task_state.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level2; + task_state.severity_level = eCAL::Process::eSeverityLevel::level2; break; case eCAL::pb::sys::eProcessSeverityLevel::proc_sev_level3: - task_state.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level3; + task_state.severity_level = eCAL::Process::eSeverityLevel::level3; break; case eCAL::pb::sys::eProcessSeverityLevel::proc_sev_level4: - task_state.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level4; + task_state.severity_level = eCAL::Process::eSeverityLevel::level4; break; case eCAL::pb::sys::eProcessSeverityLevel::proc_sev_level5: - task_state.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level5; + task_state.severity_level = eCAL::Process::eSeverityLevel::level5; break; default: - task_state.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level1; + task_state.severity_level = eCAL::Process::eSeverityLevel::level1; break; } @@ -102,7 +102,7 @@ namespace eCAL task->SetMonitoringTaskState(FromProtobuf(task_pb.state())); auto restart_at_severity = FromProtobuf(task_pb.restart_by_severity()); - if (restart_at_severity.severity != eCAL_Process_eSeverity::proc_sev_unknown) + if (restart_at_severity.severity != eCAL::Process::eSeverity::unknown) { task->SetRestartBySeverityEnabled(true); task->SetRestartAtSeverity(restart_at_severity); @@ -186,19 +186,19 @@ namespace eCAL { switch (task_state.severity) { - case eCAL_Process_eSeverity::proc_sev_unknown: + case eCAL::Process::eSeverity::unknown: task_state_pb.set_severity(eCAL::pb::sys::eProcessSeverity::proc_sev_unknown); break; - case eCAL_Process_eSeverity::proc_sev_healthy: + case eCAL::Process::eSeverity::healthy: task_state_pb.set_severity(eCAL::pb::sys::eProcessSeverity::proc_sev_healthy); break; - case eCAL_Process_eSeverity::proc_sev_warning: + case eCAL::Process::eSeverity::warning: task_state_pb.set_severity(eCAL::pb::sys::eProcessSeverity::proc_sev_warning); break; - case eCAL_Process_eSeverity::proc_sev_critical: + case eCAL::Process::eSeverity::critical: task_state_pb.set_severity(eCAL::pb::sys::eProcessSeverity::proc_sev_critical); break; - case eCAL_Process_eSeverity::proc_sev_failed: + case eCAL::Process::eSeverity::failed: task_state_pb.set_severity(eCAL::pb::sys::eProcessSeverity::proc_sev_failed); break; default: @@ -208,19 +208,19 @@ namespace eCAL switch (task_state.severity_level) { - case eCAL_Process_eSeverity_Level::proc_sev_level1: + case eCAL::Process::eSeverityLevel::level1: task_state_pb.set_severity_level(eCAL::pb::sys::eProcessSeverityLevel::proc_sev_level1); break; - case eCAL_Process_eSeverity_Level::proc_sev_level2: + case eCAL::Process::eSeverityLevel::level2: task_state_pb.set_severity_level(eCAL::pb::sys::eProcessSeverityLevel::proc_sev_level2); break; - case eCAL_Process_eSeverity_Level::proc_sev_level3: + case eCAL::Process::eSeverityLevel::level3: task_state_pb.set_severity_level(eCAL::pb::sys::eProcessSeverityLevel::proc_sev_level3); break; - case eCAL_Process_eSeverity_Level::proc_sev_level4: + case eCAL::Process::eSeverityLevel::level4: task_state_pb.set_severity_level(eCAL::pb::sys::eProcessSeverityLevel::proc_sev_level4); break; - case eCAL_Process_eSeverity_Level::proc_sev_level5: + case eCAL::Process::eSeverityLevel::level5: task_state_pb.set_severity_level(eCAL::pb::sys::eProcessSeverityLevel::proc_sev_level5); break; default: diff --git a/app/sys/sys_core/src/task/ecal_sys_task.cpp b/app/sys/sys_core/src/task/ecal_sys_task.cpp index fcc4f1a969..997dff384d 100644 --- a/app/sys/sys_core/src/task/ecal_sys_task.cpp +++ b/app/sys/sys_core/src/task/ecal_sys_task.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ EcalSysTask::EcalSysTask() , m_working_directory ("") , m_launch_order (0) , m_timeout_after_start (std::chrono::nanoseconds(0)) - , m_visibility (eCAL_Process_eStartMode::proc_smode_normal) + , m_visibility (eCAL::Process::eStartMode::normal) , m_monitoring_enabled (true) , m_restart_by_severity_enabled(false) @@ -105,7 +105,7 @@ std::chrono::nanoseconds EcalSysTask::GetTimeoutAfterStart() return m_timeout_after_start; } -eCAL_Process_eStartMode EcalSysTask::GetVisibility() +eCAL::Process::eStartMode EcalSysTask::GetVisibility() { std::lock_guard task_lock(mutex); return m_visibility; @@ -190,7 +190,7 @@ void EcalSysTask::SetTimeoutAfterStart(std::chrono::nanoseconds timeout) m_config_modified_since_start = true; } -void EcalSysTask::SetVisibility(eCAL_Process_eStartMode visibility) +void EcalSysTask::SetVisibility(eCAL::Process::eStartMode visibility) { std::lock_guard task_lock(mutex); m_visibility = visibility; diff --git a/app/sys/sys_core/src/task/task_group.cpp b/app/sys/sys_core/src/task/task_group.cpp index b9e5e5f7f8..9c994f107a 100644 --- a/app/sys/sys_core/src/task/task_group.cpp +++ b/app/sys/sys_core/src/task/task_group.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -114,7 +114,7 @@ bool TaskGroup::GroupState::Evaluate() { // If current state is worse than the minimal state TaskState current_state = minimal_state.first->GetMonitoringTaskState(); - if (current_state.severity == eCAL_Process_eSeverity::proc_sev_unknown || current_state > minimal_state.second) + if (current_state.severity == eCAL::Process::eSeverity::unknown || current_state > minimal_state.second) { return false; } diff --git a/app/sys/sys_core/src/taskaction_threads/start_task_list_thread.cpp b/app/sys/sys_core/src/taskaction_threads/start_task_list_thread.cpp index b2af65d3bc..d3f969a499 100644 --- a/app/sys/sys_core/src/taskaction_threads/start_task_list_thread.cpp +++ b/app/sys/sys_core/src/taskaction_threads/start_task_list_thread.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,8 +71,8 @@ void StartTaskListThread::Run() TaskState task_state; task_state.info = ""; - task_state.severity = eCAL_Process_eSeverity::proc_sev_unknown; - task_state.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level1; + task_state.severity = eCAL::Process::eSeverity::unknown; + task_state.severity_level = eCAL::Process::eSeverityLevel::level1; task->SetMonitoringTaskState(task_state); task->ResetConfigModifiedSinceStart(); diff --git a/app/sys/sys_gui/src/widgets/group_edit_widget/group_edit_widget.cpp b/app/sys/sys_gui/src/widgets/group_edit_widget/group_edit_widget.cpp index 5a6741d64e..63a8bf4aaf 100644 --- a/app/sys/sys_gui/src/widgets/group_edit_widget/group_edit_widget.cpp +++ b/app/sys/sys_gui/src/widgets/group_edit_widget/group_edit_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -642,8 +642,8 @@ void GroupEditWidget::stateAddTaskButtonClicked() { TaskTreeItem* task_tree_item = static_cast(tree_item); TaskState minimal_task_state; - minimal_task_state.severity = eCAL_Process_eSeverity::proc_sev_healthy; - minimal_task_state.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level1; + minimal_task_state.severity = eCAL::Process::eSeverity::healthy; + minimal_task_state.severity_level = eCAL::Process::eSeverityLevel::level1; std::pair, TaskState> min_state(task_tree_item->getTask(), minimal_task_state); auto minimal_states_list = group_state_->GetMinimalStatesList(); diff --git a/app/sys/sys_gui/src/widgets/group_edit_widget/severity_picker_delegate.cpp b/app/sys/sys_gui/src/widgets/group_edit_widget/severity_picker_delegate.cpp index 369ad2108b..db1ff2c4eb 100644 --- a/app/sys/sys_gui/src/widgets/group_edit_widget/severity_picker_delegate.cpp +++ b/app/sys/sys_gui/src/widgets/group_edit_widget/severity_picker_delegate.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,13 +65,13 @@ void SeverityPickerDelegate::setEditorData(QWidget *editor, const QModelIndex &i if (index.column() == (int)GroupStateMinTaskStateTreeModel::Columns::SEVERITY) { - eCAL_Process_eSeverity severity = (eCAL_Process_eSeverity)(current_int); + eCAL::Process::eSeverity severity = (eCAL::Process::eSeverity)(current_int); SeverityModel* severity_model = static_cast(combobox->model()); combobox->setCurrentIndex(severity_model->getRow(severity)); } else if (index.column() == (int)GroupStateMinTaskStateTreeModel::Columns::SEVERITY_LEVEL) { - eCAL_Process_eSeverity_Level severity_level = (eCAL_Process_eSeverity_Level)(current_int); + eCAL::Process::eSeverityLevel severity_level = (eCAL::Process::eSeverityLevel)(current_int); SeverityLevelModel* severity_level_model = static_cast(combobox->model()); combobox->setCurrentIndex(severity_level_model->getRow(severity_level)); } @@ -86,13 +86,13 @@ void SeverityPickerDelegate::setModelData(QWidget *editor, QAbstractItemModel *m if (index.column() == (int)GroupStateMinTaskStateTreeModel::Columns::SEVERITY) { SeverityModel* severity_model = static_cast(combobox->model()); - eCAL_Process_eSeverity severity = severity_model->getSeverity(combobox->currentIndex()); + eCAL::Process::eSeverity severity = severity_model->getSeverity(combobox->currentIndex()); model->setData(index, (int)severity, Qt::EditRole); } else if (index.column() == (int)GroupStateMinTaskStateTreeModel::Columns::SEVERITY_LEVEL) { SeverityLevelModel* severity_level_model = static_cast(combobox->model()); - eCAL_Process_eSeverity_Level severity_level = severity_level_model->getSeverityLevel(combobox->currentIndex()); + eCAL::Process::eSeverityLevel severity_level = severity_level_model->getSeverityLevel(combobox->currentIndex()); model->setData(index, (int)severity_level, Qt::EditRole); } } diff --git a/app/sys/sys_gui/src/widgets/import_from_cloud_widget/import_from_cloud_widget.cpp b/app/sys/sys_gui/src/widgets/import_from_cloud_widget/import_from_cloud_widget.cpp index 74ed19420d..023cd6aae2 100644 --- a/app/sys/sys_gui/src/widgets/import_from_cloud_widget/import_from_cloud_widget.cpp +++ b/app/sys/sys_gui/src/widgets/import_from_cloud_widget/import_from_cloud_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -224,8 +224,8 @@ void ImportFromCloudWidget::reload() for (auto& task : task_list_) { TaskState restart_at_severity; - restart_at_severity.severity = eCAL_Process_eSeverity::proc_sev_failed; - restart_at_severity.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level1; + restart_at_severity.severity = eCAL::Process::eSeverity::failed; + restart_at_severity.severity_level = eCAL::Process::eSeverityLevel::level1; task->SetRestartAtSeverity(restart_at_severity); } diff --git a/app/sys/sys_gui/src/widgets/severity_model/severity_level_model.cpp b/app/sys/sys_gui/src/widgets/severity_model/severity_level_model.cpp index 4f321e1610..846c41f1d4 100644 --- a/app/sys/sys_gui/src/widgets/severity_model/severity_level_model.cpp +++ b/app/sys/sys_gui/src/widgets/severity_model/severity_level_model.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,11 +22,11 @@ SeverityLevelModel::SeverityLevelModel(QObject *parent) : QAbstractListModel(parent) { - rows.push_back(std::make_pair(QString("Level 1"), eCAL_Process_eSeverity_Level::proc_sev_level1)); - rows.push_back(std::make_pair(QString("Level 2"), eCAL_Process_eSeverity_Level::proc_sev_level2)); - rows.push_back(std::make_pair(QString("Level 3"), eCAL_Process_eSeverity_Level::proc_sev_level3)); - rows.push_back(std::make_pair(QString("Level 4"), eCAL_Process_eSeverity_Level::proc_sev_level4)); - rows.push_back(std::make_pair(QString("Level 5"), eCAL_Process_eSeverity_Level::proc_sev_level5)); + rows.push_back(std::make_pair(QString("Level 1"), eCAL::Process::eSeverityLevel::level1)); + rows.push_back(std::make_pair(QString("Level 2"), eCAL::Process::eSeverityLevel::level2)); + rows.push_back(std::make_pair(QString("Level 3"), eCAL::Process::eSeverityLevel::level3)); + rows.push_back(std::make_pair(QString("Level 4"), eCAL::Process::eSeverityLevel::level4)); + rows.push_back(std::make_pair(QString("Level 5"), eCAL::Process::eSeverityLevel::level5)); } SeverityLevelModel::~SeverityLevelModel() @@ -51,12 +51,12 @@ QString SeverityLevelModel::getString(int row) const return rows[row].first; } -eCAL_Process_eSeverity_Level SeverityLevelModel::getSeverityLevel(int row) const +eCAL::Process::eSeverityLevel SeverityLevelModel::getSeverityLevel(int row) const { return rows[row].second; } -int SeverityLevelModel::getRow(eCAL_Process_eSeverity_Level level) const +int SeverityLevelModel::getRow(eCAL::Process::eSeverityLevel level) const { for (int i = 0; i < (int)rows.size(); i++) { diff --git a/app/sys/sys_gui/src/widgets/severity_model/severity_level_model.h b/app/sys/sys_gui/src/widgets/severity_model/severity_level_model.h index 5919b0f547..a761d6d464 100644 --- a/app/sys/sys_gui/src/widgets/severity_model/severity_level_model.h +++ b/app/sys/sys_gui/src/widgets/severity_model/severity_level_model.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,10 +37,10 @@ class SeverityLevelModel : public QAbstractListModel QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QString getString(int row) const; - eCAL_Process_eSeverity_Level getSeverityLevel(int row) const; + eCAL::Process::eSeverityLevel getSeverityLevel(int row) const; - int getRow(eCAL_Process_eSeverity_Level level) const; + int getRow(eCAL::Process::eSeverityLevel level) const; private: - std::vector> rows; + std::vector> rows; }; \ No newline at end of file diff --git a/app/sys/sys_gui/src/widgets/severity_model/severity_model.cpp b/app/sys/sys_gui/src/widgets/severity_model/severity_model.cpp index 6073bd152d..2814adbd02 100644 --- a/app/sys/sys_gui/src/widgets/severity_model/severity_model.cpp +++ b/app/sys/sys_gui/src/widgets/severity_model/severity_model.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,12 +24,12 @@ SeverityModel::SeverityModel(QObject *parent, bool include_unknown_severity) { if (include_unknown_severity) { - rows.push_back(std::make_pair(QString("Unknown"), eCAL_Process_eSeverity::proc_sev_unknown)); + rows.push_back(std::make_pair(QString("Unknown"), eCAL::Process::eSeverity::unknown)); } - rows.push_back(std::make_pair(QString("Healthy"), eCAL_Process_eSeverity::proc_sev_healthy)); - rows.push_back(std::make_pair(QString("Warning"), eCAL_Process_eSeverity::proc_sev_warning)); - rows.push_back(std::make_pair(QString("Critical"), eCAL_Process_eSeverity::proc_sev_critical)); - rows.push_back(std::make_pair(QString("Failed"), eCAL_Process_eSeverity::proc_sev_failed)); + rows.push_back(std::make_pair(QString("Healthy"), eCAL::Process::eSeverity::healthy)); + rows.push_back(std::make_pair(QString("Warning"), eCAL::Process::eSeverity::warning)); + rows.push_back(std::make_pair(QString("Critical"), eCAL::Process::eSeverity::critical)); + rows.push_back(std::make_pair(QString("Failed"), eCAL::Process::eSeverity::failed)); } SeverityModel::~SeverityModel() @@ -54,12 +54,12 @@ QString SeverityModel::getString(int row) const return rows[row].first; } -eCAL_Process_eSeverity SeverityModel::getSeverity(int row) const +eCAL::Process::eSeverity SeverityModel::getSeverity(int row) const { return rows[row].second; } -int SeverityModel::getRow(eCAL_Process_eSeverity severity) const +int SeverityModel::getRow(eCAL::Process::eSeverity severity) const { for (int i = 0; i < (int)rows.size(); i++) { diff --git a/app/sys/sys_gui/src/widgets/severity_model/severity_model.h b/app/sys/sys_gui/src/widgets/severity_model/severity_model.h index 4fce77a5a0..26f3a4efde 100644 --- a/app/sys/sys_gui/src/widgets/severity_model/severity_model.h +++ b/app/sys/sys_gui/src/widgets/severity_model/severity_model.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,10 +37,10 @@ class SeverityModel : public QAbstractListModel QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QString getString(int row) const; - eCAL_Process_eSeverity getSeverity(int row) const; + eCAL::Process::eSeverity getSeverity(int row) const; - int getRow(eCAL_Process_eSeverity severity) const; + int getRow(eCAL::Process::eSeverity severity) const; private: - std::vector> rows; + std::vector> rows; }; \ No newline at end of file diff --git a/app/sys/sys_gui/src/widgets/taskwidget/task_widget.cpp b/app/sys/sys_gui/src/widgets/taskwidget/task_widget.cpp index fbc4ed96fa..db9fbdad14 100644 --- a/app/sys/sys_gui/src/widgets/taskwidget/task_widget.cpp +++ b/app/sys/sys_gui/src/widgets/taskwidget/task_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -269,14 +269,14 @@ void TaskWidget::autoSizeColumns() std::shared_ptr example_runner(new EcalSysRunner()); example_runner->SetName ("RunTask (new)___"); example_task->SetRunner (example_runner); - example_task->SetVisibility (eCAL_Process_eStartMode::proc_smode_maximized); + example_task->SetVisibility (eCAL::Process::eStartMode::maximized); example_task->SetTimeoutAfterStart (std::chrono::milliseconds(99999)); example_task->SetMonitoringEnabled (false); example_task->SetRestartBySeverityEnabled (false); - example_task->SetRestartAtSeverity (TaskState(eCAL_Process_eSeverity::proc_sev_warning, eCAL_Process_eSeverity_Level::proc_sev_level5)); + example_task->SetRestartAtSeverity (TaskState(eCAL::Process::eSeverity::warning, eCAL::Process::eSeverityLevel::level5)); example_task->SetPids (std::vector{9999999}); example_task->SetHostStartedOn ("CARPC00___"); - example_task->SetMonitoringTaskState (TaskState(eCAL_Process_eSeverity::proc_sev_warning, eCAL_Process_eSeverity_Level::proc_sev_level5)); + example_task->SetMonitoringTaskState (TaskState(eCAL::Process::eSeverity::warning, eCAL::Process::eSeverityLevel::level5)); // We don't want to resize all Columns, as e.g. for the Algo Path we really can't know how much text will be in there. static const std::vector columns_to_resize = @@ -747,8 +747,8 @@ void TaskWidget::addTask() new_task->SetTarget(eCAL::Process::GetHostName()); TaskState min_acceptable_severity; - min_acceptable_severity.severity = eCAL_Process_eSeverity::proc_sev_failed; - min_acceptable_severity.severity_level = eCAL_Process_eSeverity_Level::proc_sev_level1; + min_acceptable_severity.severity = eCAL::Process::eSeverity::failed; + min_acceptable_severity.severity_level = eCAL::Process::eSeverityLevel::level1; new_task->SetRestartAtSeverity(min_acceptable_severity); // Add Task to the actual model @@ -1399,16 +1399,16 @@ void TaskWidget::updateEditAreaVisibility(std::vectorGetVisibility()) { - case eCAL_Process_eStartMode::proc_smode_hidden: + case eCAL::Process::eStartMode::hidden: visibility_string = "Hidden"; break; - case eCAL_Process_eStartMode::proc_smode_normal: + case eCAL::Process::eStartMode::normal: visibility_string = "Normal"; break; - case eCAL_Process_eStartMode::proc_smode_minimized: + case eCAL::Process::eStartMode::minimized: visibility_string = "Minimized"; break; - case eCAL_Process_eStartMode::proc_smode_maximized: + case eCAL::Process::eStartMode::maximized: visibility_string = "Maximized"; break; default: @@ -1531,7 +1531,7 @@ void TaskWidget::updateEditAreaRestartAtSeverity(std::vectorblockSignals(true); if (task_list.size() == 0) { - ui_.restart_by_severity_combobox->setCurrentIndex(severity_model_->getRow(eCAL_Process_eSeverity::proc_sev_failed)); + ui_.restart_by_severity_combobox->setCurrentIndex(severity_model_->getRow(eCAL::Process::eSeverity::failed)); } else { @@ -1553,7 +1553,7 @@ void TaskWidget::updateEditAreaRestartAtSeverityLevel(std::vectorblockSignals(true); if (task_list.size() == 0) { - ui_.restart_by_severity_level_combobox->setCurrentIndex(severity_level_model_->getRow(eCAL_Process_eSeverity_Level::proc_sev_level1)); + ui_.restart_by_severity_level_combobox->setCurrentIndex(severity_level_model_->getRow(eCAL::Process::eSeverityLevel::level1)); } else { @@ -2106,22 +2106,22 @@ void TaskWidget::visibilityTextChanged() if (selected_tasks.size() != 0) { std::string text = ui_.visibility_combobox->currentText().toStdString(); - eCAL_Process_eStartMode visibility = eCAL_Process_eStartMode::proc_smode_normal; + eCAL::Process::eStartMode visibility = eCAL::Process::eStartMode::normal; if (text == "Normal") { - visibility = eCAL_Process_eStartMode::proc_smode_normal; + visibility = eCAL::Process::eStartMode::normal; } else if (text == "Maximized") { - visibility = eCAL_Process_eStartMode::proc_smode_maximized; + visibility = eCAL::Process::eStartMode::maximized; } else if (text == "Minimized") { - visibility = eCAL_Process_eStartMode::proc_smode_minimized; + visibility = eCAL::Process::eStartMode::minimized; } else if (text == "Hidden") { - visibility = eCAL_Process_eStartMode::proc_smode_hidden; + visibility = eCAL::Process::eStartMode::hidden; } std::vector> modified_tasks; @@ -2276,7 +2276,7 @@ void TaskWidget::restartBySeverityIndexChanged(int index) auto selected_tasks = getSelectedTasks(); if (selected_tasks.size() != 0) { - eCAL_Process_eSeverity selected_severity = severity_model_->getSeverity(index); + eCAL::Process::eSeverity selected_severity = severity_model_->getSeverity(index); std::vector> modified_tasks; for (auto& task : selected_tasks) @@ -2302,7 +2302,7 @@ void TaskWidget::restartBySeverityLevelIndexChanged(int index) auto selected_tasks = getSelectedTasks(); if (selected_tasks.size() != 0) { - eCAL_Process_eSeverity_Level selected_severity_level = severity_level_model_->getSeverityLevel(index); + eCAL::Process::eSeverityLevel selected_severity_level = severity_level_model_->getSeverityLevel(index); std::vector> modified_tasks; for (auto& task : selected_tasks) diff --git a/app/sys/sys_gui/src/widgets/treemodels/group_state_min_task_state_tree_item.cpp b/app/sys/sys_gui/src/widgets/treemodels/group_state_min_task_state_tree_item.cpp index 50b854e781..9c3bfd8b08 100644 --- a/app/sys/sys_gui/src/widgets/treemodels/group_state_min_task_state_tree_item.cpp +++ b/app/sys/sys_gui/src/widgets/treemodels/group_state_min_task_state_tree_item.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,12 +157,12 @@ bool GroupStateMinTaskStateTreeItem::setData(int column, const QVariant& data, Q { if (column == (int)Columns::SEVERITY) { - min_task_state_.second.severity = (eCAL_Process_eSeverity)(data.toInt()); + min_task_state_.second.severity = (eCAL::Process::eSeverity)(data.toInt()); return true; } else if (column == (int)Columns::SEVERITY_LEVEL) { - min_task_state_.second.severity_level = (eCAL_Process_eSeverity_Level)(data.toInt()); + min_task_state_.second.severity_level = (eCAL::Process::eSeverityLevel)(data.toInt()); return true; } } diff --git a/app/sys/sys_gui/src/widgets/treemodels/task_tree_item.cpp b/app/sys/sys_gui/src/widgets/treemodels/task_tree_item.cpp index 2ee4ab6fec..c0bcf4aabd 100644 --- a/app/sys/sys_gui/src/widgets/treemodels/task_tree_item.cpp +++ b/app/sys/sys_gui/src/widgets/treemodels/task_tree_item.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,11 +89,11 @@ QVariant TaskTreeItem::data(Columns column, Qt::ItemDataRole role) const { switch (task_->GetVisibility()) { - case eCAL_Process_eStartMode::proc_smode_hidden: + case eCAL::Process::eStartMode::hidden: return "Hidden"; - case eCAL_Process_eStartMode::proc_smode_maximized: + case eCAL::Process::eStartMode::maximized: return "Maximized"; - case eCAL_Process_eStartMode::proc_smode_minimized: + case eCAL::Process::eStartMode::minimized: return "Minimized"; default: return "Normal"; @@ -121,8 +121,8 @@ QVariant TaskTreeItem::data(Columns column, Qt::ItemDataRole role) const TaskState restart_at_severity = task_->GetRestartAtSeverity(); restart_at_severity.ToString(state, level); return QString(state.c_str()) + - (restart_at_severity.severity != eCAL_Process_eSeverity::proc_sev_unknown ? - " (Lv " + QString::number(restart_at_severity.severity_level) + ")" : + (restart_at_severity.severity != eCAL::Process::eSeverity::unknown ? + " (Lv " + QString::number(static_cast(restart_at_severity.severity_level)) + ")" : ""); } else if (column == Columns::CURRENT_PID) @@ -144,8 +144,8 @@ QVariant TaskTreeItem::data(Columns column, Qt::ItemDataRole role) const std::string state, level; task_->GetMonitoringTaskState().ToString(state, level); return QString(state.c_str()) + - (task_->GetMonitoringTaskState().severity != eCAL_Process_eSeverity::proc_sev_unknown ? - " (Lv " + QString::number(task_->GetMonitoringTaskState().severity_level) + ")" : + (task_->GetMonitoringTaskState().severity != eCAL::Process::eSeverity::unknown ? + " (Lv " + QString::number(static_cast(task_->GetMonitoringTaskState().severity_level)) + ")" : ""); } else if (column == Columns::INFO) @@ -201,13 +201,13 @@ QVariant TaskTreeItem::data(Columns column, Qt::ItemDataRole role) const switch (state.severity) { - case eCAL_Process_eSeverity::proc_sev_healthy: + case eCAL::Process::eSeverity::healthy: return QColor(80, 225, 120); - case eCAL_Process_eSeverity::proc_sev_warning: + case eCAL::Process::eSeverity::warning: return QColor(240, 240, 50); - case eCAL_Process_eSeverity::proc_sev_critical: + case eCAL::Process::eSeverity::critical: return QColor(250, 130, 0); - case eCAL_Process_eSeverity::proc_sev_failed: + case eCAL::Process::eSeverity::failed: return QColor(240, 20, 20); default: return QVariant(); // Invalid QVariant diff --git a/app/util/stop/src/ecal_stop.cpp b/app/util/stop/src/ecal_stop.cpp index 3928fb5311..97f93c4208 100644 --- a/app/util/stop/src/ecal_stop.cpp +++ b/app/util/stop/src/ecal_stop.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ int main() eCAL::Initialize("eCALStop", eCAL::Init::All); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Running"); // some nice info show while collection std::cout << "Collecting local process informations." << std::endl; diff --git a/contrib/mma/src/mma_application.cpp b/contrib/mma/src/mma_application.cpp index 87cb5d923a..518449f737 100644 --- a/contrib/mma/src/mma_application.cpp +++ b/contrib/mma/src/mma_application.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -147,7 +147,7 @@ int main(int argc, char** argv) Logger::getLogger()->ResumeLogging(); } - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "Running"); // create mma agent std::cout << std::endl << "Initializing machine monitoring agent ..." << std::endl; diff --git a/ecal/core/CMakeLists.txt b/ecal/core/CMakeLists.txt index 407b4702a5..87ab462e2b 100644 --- a/ecal/core/CMakeLists.txt +++ b/ecal/core/CMakeLists.txt @@ -472,36 +472,6 @@ set (ecal_builder_src src/registration/udp/config/builder/udp_attribute_builder.cpp ) - -###################################### -# c interface -###################################### -set(ecal_c_src - src/cimpl/ecal_client_cimpl.cpp - src/cimpl/ecal_common_cimpl.cpp - src/cimpl/ecal_common_cimpl.h - src/cimpl/ecal_core_cimpl.cpp - src/cimpl/ecal_log_cimpl.cpp - src/cimpl/ecal_monitoring_cimpl.cpp - src/cimpl/ecal_process_cimpl.cpp - src/cimpl/ecal_publisher_cimpl.cpp - src/cimpl/ecal_server_cimpl.cpp - src/cimpl/ecal_subscriber_cimpl.cpp - src/cimpl/ecal_time_cimpl.cpp - src/cimpl/ecal_timer_cimpl.cpp - src/cimpl/ecal_util_cimpl.cpp -) - -###################################### -# windows dll -###################################### -if(WIN32) - set(ecal_c_win_src - src/win32/dll/dllmain.cpp - src/win32/dll/ecal.rc - ) -endif() - ###################################### # public header ###################################### @@ -548,25 +518,6 @@ set(ecal_header_cmn include/ecal/ecal_util.h ) -set(ecal_header_cimpl - include/ecal/cimpl/ecal_callback_cimpl.h - include/ecal/cimpl/ecal_client_cimpl.h - include/ecal/cimpl/ecal_core_cimpl.h - include/ecal/cimpl/ecal_init_cimpl.h - include/ecal/cimpl/ecal_log_cimpl.h - include/ecal/cimpl/ecal_monitoring_cimpl.h - include/ecal/cimpl/ecal_process_cimpl.h - include/ecal/cimpl/ecal_publisher_cimpl.h - include/ecal/cimpl/ecal_server_cimpl.h - include/ecal/cimpl/ecal_service_info_cimpl.h - include/ecal/cimpl/ecal_subscriber_cimpl.h - include/ecal/cimpl/ecal_time_cimpl.h - include/ecal/cimpl/ecal_timer_cimpl.h - include/ecal/cimpl/ecal_util_cimpl.h - include/ecal/ecalc.h - include/ecal/ecalc_types.h -) - set(ecal_header_msg include/ecal/msg/dynamic.h include/ecal/msg/publisher.h @@ -614,32 +565,7 @@ if(UNIX) set_source_files_properties(src/util/convert_utf.cpp PROPERTIES COMPILE_FLAGS -Wno-implicit-fallthrough) endif() -set(ecal_c_sources - ${ecal_c_src} - ${ecal_c_win_src} - ${ecal_header_cimpl} -) - -ecal_add_ecal_shared_library(${PROJECT_NAME}_c - ${ecal_c_sources} -) - add_library(eCAL::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) -add_library(eCAL::${PROJECT_NAME}_c ALIAS ${PROJECT_NAME}_c) - -target_link_libraries(${PROJECT_NAME}_c ${PROJECT_NAME}) - -target_compile_definitions(${PROJECT_NAME}_c - INTERFACE - ECAL_C_DLL # This is deprecated - ECAL_CORE_C_IMPORTS - PUBLIC - ASIO_STANDALONE - ASIO_DISABLE_VISIBILITY - PRIVATE - ECAL_CORE_C_EXPORTS - ECAL_NO_DEPRECATION_WARNINGS -) target_compile_definitions(${PROJECT_NAME} PUBLIC @@ -655,13 +581,6 @@ target_compile_definitions(${PROJECT_NAME} ECAL_CORE_IMPORTS ) -set_target_properties(${PROJECT_NAME}_c - PROPERTIES - CXX_VISIBILITY_PRESET hidden - C_VISIBILITY_PRESET hidden - VISIBILITY_INLINES_HIDDEN ON -) - set_target_properties(${PROJECT_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden @@ -669,7 +588,6 @@ set_target_properties(${PROJECT_NAME} VISIBILITY_INLINES_HIDDEN ON ) - set(ECAL_CORE_FEATURES ECAL_CORE_CONFIGURATION ECAL_CORE_COMMAND_LINE @@ -689,9 +607,7 @@ set(ECAL_CORE_FEATURES foreach(CORE_FEATURE ${ECAL_CORE_FEATURES}) if(${CORE_FEATURE}) target_compile_definitions(${PROJECT_NAME} - PRIVATE ${CORE_FEATURE}) - target_compile_definitions(${PROJECT_NAME}_c - PRIVATE ${CORE_FEATURE}) + PUBLIC ${CORE_FEATURE}) endif() endforeach() @@ -757,9 +673,7 @@ target_link_libraries(${PROJECT_NAME} ) set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER core) -set_property(TARGET ${PROJECT_NAME}_c PROPERTY FOLDER core) -ecal_install_ecal_shared_library(${PROJECT_NAME}_c) ecal_install_ecal_shared_library(${PROJECT_NAME}) install(DIRECTORY @@ -774,7 +688,6 @@ install(DIRECTORY if(NOT ${CMAKE_VERSION} VERSION_LESS "3.8.0") source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${ecal_sources} - ${ecal_c_sources} ) endif() diff --git a/ecal/core/include/ecal/config/logging.h b/ecal/core/include/ecal/config/logging.h index e42a1edeb9..2ca1724100 100644 --- a/ecal/core/include/ecal/config/logging.h +++ b/ecal/core/include/ecal/config/logging.h @@ -1,6 +1,6 @@ /* =========================== LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ namespace eCAL struct Sink { bool enable; //!< Enable sink - eCAL_Logging_Filter filter_log; //!< Log messages logged (all, info, warning, error, fatal, debug1, debug2, debug3, debug4) + Filter filter_log; //!< Log messages logged (all, info, warning, error, fatal, debug1, debug2, debug3, debug4) }; namespace File diff --git a/ecal/core/include/ecal/ecal_callback.h b/ecal/core/include/ecal/ecal_callback.h index 920002276e..a00ec21811 100644 --- a/ecal/core/include/ecal/ecal_callback.h +++ b/ecal/core/include/ecal/ecal_callback.h @@ -25,7 +25,6 @@ #pragma once #include -#include #include #include @@ -45,6 +44,93 @@ namespace eCAL long long clock = 0; //!< publisher send clock }; + /** + * @brief eCAL subscriber event callback type. +**/ + enum class eSubscriberEvent + { + none = 0, + connected = 1, + disconnected = 2, + dropped = 3, + corrupted = 5, + update_connection = 6, + }; + + inline std::string to_string(eSubscriberEvent event_) { + switch (event_) { + case eSubscriberEvent::none: return "NONE"; + case eSubscriberEvent::connected: return "CONNECTED"; + case eSubscriberEvent::disconnected: return "DISCONNECTED"; + case eSubscriberEvent::dropped : return "DROPPED"; + case eSubscriberEvent::corrupted: return "CORRUPTED"; + case eSubscriberEvent::update_connection : return "UPDATED_CONNECTION"; + default: return "Unknown"; + } + } + + /** + * @brief eCAL publisher event callback type. + **/ + enum class ePublisherEvent + { + none = 0, + connected = 1, + disconnected = 2, + dropped = 3, + update_connection = 4, + }; + + inline std::string to_string(ePublisherEvent event_) { + switch (event_) { + case ePublisherEvent::none: return "NONE"; + case ePublisherEvent::connected: return "CONNECTED"; + case ePublisherEvent::disconnected: return "DISCONNECTED"; + case ePublisherEvent::dropped: return "DROPPED"; + case ePublisherEvent::update_connection: return "UPDATED_CONNECTION"; + default: return "Unknown"; + } + } + + /** + * @brief eCAL service client event callback type. + **/ + enum class eClientEvent + { + none = 0, + connected = 1, + disconnected = 2, + timeout = 3, + }; + + inline std::string to_string(eClientEvent event_) { + switch (event_) { + case eClientEvent::none: return "NONE"; + case eClientEvent::connected: return "CONNECTED"; + case eClientEvent::disconnected: return "DISCONNECTED"; + default: return "Unknown"; + } + } + + /** + * @brief eCAL service server event callback type. + **/ + enum class eServerEvent + { + none = 0, + connected = 1, + disconnected = 2, + }; + + inline std::string to_string(eServerEvent event_) { + switch (event_) { + case eServerEvent::none: return "NONE"; + case eServerEvent::connected: return "CONNECTED"; + case eServerEvent::disconnected: return "DISCONNECTED"; + default: return "Unknown"; + } + } + /** * @brief Timer callback function type. **/ @@ -67,7 +153,7 @@ namespace eCAL **/ struct SPubEventCallbackData { - eCAL_Publisher_Event type{ pub_event_none }; //!< publisher event type + ePublisherEvent type{ ePublisherEvent::none }; //!< publisher event type long long time{ 0 }; //!< publisher event time in µs long long clock{ 0 }; //!< publisher event clock SDataTypeInformation tdatatype; //!< datatype description of the connected subscriber (for pub_event_update_connection only) @@ -86,7 +172,7 @@ namespace eCAL **/ struct SSubEventCallbackData { - eCAL_Subscriber_Event type{ sub_event_none }; //!< subscriber event type + eSubscriberEvent type{ eSubscriberEvent::none }; //!< subscriber event type long long time{ 0 }; //!< subscriber event time in µs long long clock{ 0 }; //!< subscriber event clock SDataTypeInformation tdatatype; //!< topic information of the connected subscriber (for sub_event_update_connection only) @@ -105,7 +191,7 @@ namespace eCAL **/ struct SClientEventCallbackData { - eCAL_Client_Event type = client_event_none; //!< event type + eClientEvent type{ eClientEvent::none }; //!< event type long long time = 0; //!< event time in µs }; @@ -122,7 +208,7 @@ namespace eCAL **/ struct SServerEventCallbackData { - eCAL_Server_Event type = server_event_none; //!< event type + eServerEvent type{ eServerEvent::none }; //!< event type long long time = 0; //!< event time in µs }; diff --git a/ecal/core/include/ecal/ecal_callback_v5.h b/ecal/core/include/ecal/ecal_callback_v5.h index c4d5b31dcb..3c6d5254c6 100644 --- a/ecal/core/include/ecal/ecal_callback_v5.h +++ b/ecal/core/include/ecal/ecal_callback_v5.h @@ -25,7 +25,7 @@ #pragma once #include -#include +#include #include #include @@ -40,7 +40,7 @@ namespace eCAL **/ struct SPubEventCallbackData { - eCAL_Publisher_Event type{ pub_event_none }; //!< publisher event type + ePublisherEvent type = ePublisherEvent::none; //!< publisher event type long long time{ 0 }; //!< publisher event time in µs long long clock{ 0 }; //!< publisher event clock std::string tid; //!< topic id of the of the connected subscriber (for pub_event_update_connection only) @@ -52,7 +52,7 @@ namespace eCAL **/ struct SSubEventCallbackData { - eCAL_Subscriber_Event type{ sub_event_none }; //!< subscriber event type + eSubscriberEvent type = eSubscriberEvent::none; //!< subscriber event type long long time{ 0 }; //!< subscriber event time in µs long long clock{ 0 }; //!< subscriber event clock std::string tid; //!< topic id of the of the connected publisher (for sub_event_update_connection only) @@ -83,7 +83,7 @@ namespace eCAL **/ struct SClientEventCallbackData { - eCAL_Client_Event type = client_event_none; //!< event type + eClientEvent type = eClientEvent::none; //!< event type long long time = 0; //!< event time in µs SServiceAttr attr; //!< event related service attributes }; @@ -109,7 +109,7 @@ namespace eCAL **/ struct SServerEventCallbackData { - eCAL_Server_Event type = server_event_none; //!< event type + eServerEvent type = eServerEvent::none; //!< event type long long time = 0; //!< event time in µs }; diff --git a/ecal/core/include/ecal/ecal_client_v5.h b/ecal/core/include/ecal/ecal_client_v5.h index 780ac95165..f8db9dbffb 100644 --- a/ecal/core/include/ecal/ecal_client_v5.h +++ b/ecal/core/include/ecal/ecal_client_v5.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -186,7 +186,7 @@ namespace eCAL * @return True if succeeded, false if not. **/ ECAL_API_EXPORTED_MEMBER - bool AddEventCallback(eCAL_Client_Event type_, ClientEventCallbackT callback_); + bool AddEventCallback(eClientEvent type_, ClientEventCallbackT callback_); /** * @brief Remove client event callback function. @@ -196,7 +196,7 @@ namespace eCAL * @return True if succeeded, false if not. **/ ECAL_API_EXPORTED_MEMBER - bool RemEventCallback(eCAL_Client_Event type_); + bool RemEventCallback(eClientEvent type_); /** * @brief Retrieve service name. diff --git a/ecal/core/include/ecal/ecal_log.h b/ecal/core/include/ecal/ecal_log.h index 0df0f9c477..76500c10f5 100644 --- a/ecal/core/include/ecal/ecal_log.h +++ b/ecal/core/include/ecal/ecal_log.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ namespace eCAL * @param level_ The level. * @param msg_ The log message string. **/ - ECAL_API void Log(eCAL_Logging_eLogLevel level_, const std::string& msg_); + ECAL_API void Log(eLogLevel level_, const std::string& msg_); /** * @brief Get logging as serialized protobuf string. diff --git a/ecal/core/include/ecal/ecal_log_level.h b/ecal/core/include/ecal/ecal_log_level.h index 9387d00bbe..cccc4e2aac 100644 --- a/ecal/core/include/ecal/ecal_log_level.h +++ b/ecal/core/include/ecal/ecal_log_level.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,21 +24,30 @@ #pragma once -/** - * @brief Values that represent different log level to filter on monitoring. -**/ -enum eCAL_Logging_eLogLevel +namespace eCAL { - log_level_none = 0, - log_level_all = 255, - log_level_info = 1, - log_level_warning = 2, - log_level_error = 4, - log_level_fatal = 8, - log_level_debug1 = 16, - log_level_debug2 = 32, - log_level_debug3 = 64, - log_level_debug4 = 128, -}; + namespace Logging + { + + /** + * @brief Values that represent different log level to filter on monitoring. + **/ + // We're currently not making this an enum class, because this will not allow the bitmasking anymore. + // Need to come up with a different solution in that case. + enum eLogLevel + { + log_level_none = 0, + log_level_all = 255, + log_level_info = 1, + log_level_warning = 2, + log_level_error = 4, + log_level_fatal = 8, + log_level_debug1 = 16, + log_level_debug2 = 32, + log_level_debug3 = 64, + log_level_debug4 = 128, + }; -typedef unsigned char eCAL_Logging_Filter; //!< This type is to be used as a bitmask for the activated logging levels \ No newline at end of file + typedef unsigned char Filter; //!< This type is to be used as a bitmask for the activated logging levels + } +} \ No newline at end of file diff --git a/ecal/core/include/ecal/ecal_os.h b/ecal/core/include/ecal/ecal_os.h index 27325b7deb..86c0445543 100644 --- a/ecal/core/include/ecal/ecal_os.h +++ b/ecal/core/include/ecal/ecal_os.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,19 +58,6 @@ #define ECAL_API_CLASS #define ECAL_API_EXPORTED_MEMBER ECAL_API - - #ifdef ECAL_CORE_C_EXPORTS - #define ECALC_API __declspec(dllexport) - #define ECALC_API_DEPRECATED __declspec(dllexport deprecated) - #elif defined(ECAL_CORE_C_IMPORTS) - #define ECALC_API __declspec(dllimport) - #define ECALC_API_DEPRECATED __declspec(dllimport deprecated) - #else - #define ECALC_API - #define ECALC_API_DEPRECATED __declspec(deprecated) - #endif - - #else /* _MSC_VER */ #define ECAL_API_CLASS __attribute__((visibility("default"))) #ifdef ECAL_CORE_EXPORTS @@ -81,11 +68,4 @@ #define ECAL_API_CLASS __attribute__((visibility("default"))) #define ECAL_API_EXPORTED_MEMBER - - #ifdef ECAL_CORE_C_EXPORTS - #define ECALC_API __attribute__((visibility("default"))) - #else - #define ECALC_API - #endif - #define ECALC_API_DEPRECATED __attribute__((deprecated)) ECALC_API #endif \ No newline at end of file diff --git a/ecal/core/include/ecal/ecal_process.h b/ecal/core/include/ecal/ecal_process.h index 14dc037040..b75fa5319d 100644 --- a/ecal/core/include/ecal/ecal_process.h +++ b/ecal/core/include/ecal/ecal_process.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -152,7 +152,7 @@ namespace eCAL * @param info_ Info message. * **/ - ECAL_API void SetState(eCAL_Process_eSeverity severity_, eCAL_Process_eSeverity_Level level_, const char* info_); + ECAL_API void SetState(eCAL::Process::eSeverity severity_, eCAL::Process::eSeverityLevel level_, const char* info_); /** * @brief Start specified process (windows only). @@ -166,7 +166,7 @@ namespace eCAL * * @return Process id or zero if failed. **/ - ECAL_API int StartProcess(const char* proc_name_, const char* proc_args_, const char* working_dir_, bool create_console_, eCAL_Process_eStartMode process_mode_, bool block_); + ECAL_API int StartProcess(const char* proc_name_, const char* proc_args_, const char* working_dir_, bool create_console_, eCAL::Process::eStartMode process_mode_, bool block_); /** * @brief Stop specified process (windows only). diff --git a/ecal/core/include/ecal/ecal_process_mode.h b/ecal/core/include/ecal/ecal_process_mode.h index a47a69715d..3c33efa718 100644 --- a/ecal/core/include/ecal/ecal_process_mode.h +++ b/ecal/core/include/ecal/ecal_process_mode.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,10 +27,16 @@ /** * @brief Process start mode (StartProcess) **/ -enum eCAL_Process_eStartMode +namespace eCAL { - proc_smode_normal = 0, /*!< 0 == start mode normal */ - proc_smode_hidden = 1, /*!< 1 == start mode hidden */ - proc_smode_minimized = 2, /*!< 2 == start mode minimized */ - proc_smode_maximized = 3, /*!< 3 == start mode maximized */ -}; + namespace Process + { + enum class eStartMode + { + normal = 0, /*!< 0 == start mode normal */ + hidden = 1, /*!< 1 == start mode hidden */ + minimized = 2, /*!< 2 == start mode minimized */ + maximized = 3, /*!< 3 == start mode maximized */ + }; + } +} \ No newline at end of file diff --git a/ecal/core/include/ecal/ecal_process_severity.h b/ecal/core/include/ecal/ecal_process_severity.h index cbd8a2064c..b363b186fd 100644 --- a/ecal/core/include/ecal/ecal_process_severity.h +++ b/ecal/core/include/ecal/ecal_process_severity.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,30 +24,37 @@ #pragma once -/** - * @brief Process severity -**/ -enum eCAL_Process_eSeverity +namespace eCAL { - proc_sev_unknown = 0, /*!< 0 == condition unknown */ - proc_sev_healthy = 1, /*!< 1 == process healthy */ - proc_sev_warning = 2, /*!< 2 == process warning level */ - proc_sev_critical = 3, /*!< 3 == process critical */ - proc_sev_failed = 4, /*!< 4 == process failed */ -}; + namespace Process + { + /** + * @brief Process severity + **/ + enum class eSeverity + { + unknown = 0, /*!< 0 == condition unknown */ + healthy = 1, /*!< 1 == process healthy */ + warning = 2, /*!< 2 == process warning level */ + critical = 3, /*!< 3 == process critical */ + failed = 4, /*!< 4 == process failed */ + }; -/** - * @brief Process Severity Level - * - * enumerations for ECAL_API::SetState functionality - * where the lowest process severity is generally proc_sev_level1 -**/ -enum eCAL_Process_eSeverity_Level -{ - proc_sev_level1 = 1, /*!< default severity level 1 */ - proc_sev_level2 = 2, /*!< severity level 2 */ - proc_sev_level3 = 3, /*!< severity level 3 */ - proc_sev_level4 = 4, /*!< severity level 4 */ - proc_sev_level5 = 5, /*!< severity level 5 */ -}; + + /** + * @brief Process Severity Level + * + * enumerations for ECAL_API::SetState functionality + * where the lowest process severity is generally proc_sev_level1 + **/ + enum class eSeverityLevel + { + level1 = 1, /*!< default severity level 1 */ + level2 = 2, /*!< severity level 2 */ + level3 = 3, /*!< severity level 3 */ + level4 = 4, /*!< severity level 4 */ + level5 = 5, /*!< severity level 5 */ + }; + } +} \ No newline at end of file diff --git a/ecal/core/include/ecal/ecal_publisher_v5.h b/ecal/core/include/ecal/ecal_publisher_v5.h index 872d4d7d0c..97831df369 100644 --- a/ecal/core/include/ecal/ecal_publisher_v5.h +++ b/ecal/core/include/ecal/ecal_publisher_v5.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -244,7 +244,7 @@ namespace eCAL * @return True if succeeded, false if not. **/ ECAL_API_EXPORTED_MEMBER - bool AddEventCallback(eCAL_Publisher_Event type_, PubEventCallbackT callback_); + bool AddEventCallback(ePublisherEvent type_, PubEventCallbackT callback_); /** * @brief Remove callback function for publisher events. @@ -254,7 +254,7 @@ namespace eCAL * @return True if succeeded, false if not. **/ ECAL_API_EXPORTED_MEMBER - bool RemEventCallback(eCAL_Publisher_Event type_); + bool RemEventCallback(ePublisherEvent type_); /** * @brief Query if the publisher is created. diff --git a/ecal/core/include/ecal/ecal_server_v5.h b/ecal/core/include/ecal/ecal_server_v5.h index 5b1e956633..433e3f19c7 100644 --- a/ecal/core/include/ecal/ecal_server_v5.h +++ b/ecal/core/include/ecal/ecal_server_v5.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -139,7 +139,7 @@ namespace eCAL * @return True if succeeded, false if not. **/ ECAL_API_EXPORTED_MEMBER - bool AddEventCallback(eCAL_Server_Event type_, ServerEventCallbackT callback_); + bool AddEventCallback(eServerEvent type_, ServerEventCallbackT callback_); /** * @brief Remove server event callback function. @@ -149,7 +149,7 @@ namespace eCAL * @return True if succeeded, false if not. **/ ECAL_API_EXPORTED_MEMBER - bool RemEventCallback(eCAL_Server_Event type_); + bool RemEventCallback(eServerEvent type_); /** * @brief Retrieve service name. diff --git a/ecal/core/include/ecal/ecal_service_info.h b/ecal/core/include/ecal/ecal_service_info.h index 938cb91c09..9357c02d21 100644 --- a/ecal/core/include/ecal/ecal_service_info.h +++ b/ecal/core/include/ecal/ecal_service_info.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ #pragma once -#include #include #include @@ -34,6 +33,17 @@ namespace eCAL { + /** + * @brief Service call state. + **/ + enum class eCallState + { + none = 0, //!< undefined + executed, //!< executed (successfully) + timeouted, //!< timeout + failed //!< failed + }; + /** * @brief Service method information struct containing the request and response type information. **/ @@ -52,7 +62,7 @@ namespace eCAL SServiceResponse() { ret_state = 0; - call_state = call_state_none; + call_state = eCallState::none; }; std::string host_name; //!< service host name std::string service_name; //!< name of the service @@ -73,7 +83,7 @@ namespace eCAL Registration::SServiceMethodId service_method_id; //!< service method information (service id (entity id, process id, host name), service name, method name) std::string error_msg; //!< human readable error message int ret_state = 0; //!< return state of the called service method - eCallState call_state = call_state_none; //!< call state (see eCallState) + eCallState call_state = eCallState::none; //!< call state (see eCallState) std::string response; //!< service response }; using ServiceIDResponseVecT = std::vector; //!< vector of multiple service responses diff --git a/ecal/core/include/ecal/ecal_subscriber_v5.h b/ecal/core/include/ecal/ecal_subscriber_v5.h index 9b7fd95266..7b44bc3cae 100644 --- a/ecal/core/include/ecal/ecal_subscriber_v5.h +++ b/ecal/core/include/ecal/ecal_subscriber_v5.h @@ -213,7 +213,7 @@ namespace eCAL * @return True if succeeded, false if not. **/ ECAL_API_EXPORTED_MEMBER - bool AddEventCallback(eCAL_Subscriber_Event type_, SubEventCallbackT callback_); + bool AddEventCallback(eSubscriberEvent type_, SubEventCallbackT callback_); /** * @brief Remove callback function for subscriber events. @@ -223,7 +223,7 @@ namespace eCAL * @return True if succeeded, false if not. **/ ECAL_API_EXPORTED_MEMBER - bool RemEventCallback(eCAL_Subscriber_Event type_); + bool RemEventCallback(eSubscriberEvent type_); /** * @brief Query if this object is created. diff --git a/ecal/core/include/ecal/types/logging.h b/ecal/core/include/ecal/types/logging.h index 496e8d96f7..99a9bebad5 100644 --- a/ecal/core/include/ecal/types/logging.h +++ b/ecal/core/include/ecal/types/logging.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ namespace eCAL int32_t pid = 0; // process id std::string pname; // process name std::string uname; // unit name - eCAL_Logging_eLogLevel level = log_level_none; // message level + eLogLevel level = log_level_none; // message level std::string content; // message content }; diff --git a/ecal/core/src/config/configuration_to_yaml.cpp b/ecal/core/src/config/configuration_to_yaml.cpp index cde88173f9..c86e06f7ff 100644 --- a/ecal/core/src/config/configuration_to_yaml.cpp +++ b/ecal/core/src/config/configuration_to_yaml.cpp @@ -10,38 +10,38 @@ namespace YAML member = node_[key].as(); } - eCAL_Logging_Filter ParseLogLevel(const std::vector& filter_) + eCAL::Logging::Filter ParseLogLevel(const std::vector& filter_) { // create excluding filter list - char filter_mask = log_level_none; + char filter_mask = eCAL::Logging::log_level_none; for (const auto& it : filter_) { - if (it == "all") filter_mask |= log_level_all; - if (it == "info") filter_mask |= log_level_info; - if (it == "warning") filter_mask |= log_level_warning; - if (it == "error") filter_mask |= log_level_error; - if (it == "fatal") filter_mask |= log_level_fatal; - if (it == "debug1") filter_mask |= log_level_debug1; - if (it == "debug2") filter_mask |= log_level_debug2; - if (it == "debug3") filter_mask |= log_level_debug3; - if (it == "debug4") filter_mask |= log_level_debug4; + if (it == "all") filter_mask |= eCAL::Logging::log_level_all; + if (it == "info") filter_mask |= eCAL::Logging::log_level_info; + if (it == "warning") filter_mask |= eCAL::Logging::log_level_warning; + if (it == "error") filter_mask |= eCAL::Logging::log_level_error; + if (it == "fatal") filter_mask |= eCAL::Logging::log_level_fatal; + if (it == "debug1") filter_mask |= eCAL::Logging::log_level_debug1; + if (it == "debug2") filter_mask |= eCAL::Logging::log_level_debug2; + if (it == "debug3") filter_mask |= eCAL::Logging::log_level_debug3; + if (it == "debug4") filter_mask |= eCAL::Logging::log_level_debug4; } return(filter_mask); } - std::vector LogLevelToVector(eCAL_Logging_Filter filter_mask) + std::vector LogLevelToVector(eCAL::Logging::Filter filter_mask) { std::vector filter; - if ((filter_mask & log_level_all) != 0) filter.emplace_back("all"); - if ((filter_mask & log_level_info) != 0) filter.emplace_back("info"); - if ((filter_mask & log_level_warning) != 0) filter.emplace_back("warning"); - if ((filter_mask & log_level_error) != 0) filter.emplace_back("error"); - if ((filter_mask & log_level_fatal) != 0) filter.emplace_back("fatal"); - if ((filter_mask & log_level_debug1) != 0) filter.emplace_back("debug1"); - if ((filter_mask & log_level_debug2) != 0) filter.emplace_back("debug2"); - if ((filter_mask & log_level_debug3) != 0) filter.emplace_back("debug3"); - if ((filter_mask & log_level_debug4) != 0) filter.emplace_back("debug4"); + if ((filter_mask & eCAL::Logging::log_level_all) != 0) filter.emplace_back("all"); + if ((filter_mask & eCAL::Logging::log_level_info) != 0) filter.emplace_back("info"); + if ((filter_mask & eCAL::Logging::log_level_warning) != 0) filter.emplace_back("warning"); + if ((filter_mask & eCAL::Logging::log_level_error) != 0) filter.emplace_back("error"); + if ((filter_mask & eCAL::Logging::log_level_fatal) != 0) filter.emplace_back("fatal"); + if ((filter_mask & eCAL::Logging::log_level_debug1) != 0) filter.emplace_back("debug1"); + if ((filter_mask & eCAL::Logging::log_level_debug2) != 0) filter.emplace_back("debug2"); + if ((filter_mask & eCAL::Logging::log_level_debug3) != 0) filter.emplace_back("debug3"); + if ((filter_mask & eCAL::Logging::log_level_debug4) != 0) filter.emplace_back("debug4"); return filter; } diff --git a/ecal/core/src/config/default_configuration.cpp b/ecal/core/src/config/default_configuration.cpp index bb09774762..1cdb543603 100644 --- a/ecal/core/src/config/default_configuration.cpp +++ b/ecal/core/src/config/default_configuration.cpp @@ -10,19 +10,19 @@ namespace return std::string("\"") + str_ + std::string("\""); } - std::string logToArray(const eCAL_Logging_Filter& filter_) + std::string logToArray(const eCAL::Logging::Filter& filter_) { std::string result = "["; - if ((filter_ & log_level_info) != 0) result += "\"info\", "; - if ((filter_ & log_level_warning) != 0) result += "\"warning\", "; - if ((filter_ & log_level_error) != 0) result += "\"error\", "; - if ((filter_ & log_level_fatal) != 0) result += "\"fatal\", "; - if ((filter_ & log_level_debug1) != 0) result += "\"debug1\", "; - if ((filter_ & log_level_debug2) != 0) result += "\"debug2\", "; - if ((filter_ & log_level_debug3) != 0) result += "\"debug3\", "; - if ((filter_ & log_level_debug4) != 0) result += "\"debug4\", "; + if ((filter_ & eCAL::Logging::log_level_info) != 0) result += "\"info\", "; + if ((filter_ & eCAL::Logging::log_level_warning) != 0) result += "\"warning\", "; + if ((filter_ & eCAL::Logging::log_level_error) != 0) result += "\"error\", "; + if ((filter_ & eCAL::Logging::log_level_fatal) != 0) result += "\"fatal\", "; + if ((filter_ & eCAL::Logging::log_level_debug1) != 0) result += "\"debug1\", "; + if ((filter_ & eCAL::Logging::log_level_debug2) != 0) result += "\"debug2\", "; + if ((filter_ & eCAL::Logging::log_level_debug3) != 0) result += "\"debug3\", "; + if ((filter_ & eCAL::Logging::log_level_debug4) != 0) result += "\"debug4\", "; - if (result.size() == 1 && (filter_ & log_level_all) != 0) + if (result.size() == 1 && (filter_ & eCAL::Logging::log_level_all) != 0) { result += "\"all\", "; } diff --git a/ecal/core/src/ecal_global_accessors.cpp b/ecal/core/src/ecal_global_accessors.cpp index 8f5b281d8a..b1318a9bdd 100644 --- a/ecal/core/src/ecal_global_accessors.cpp +++ b/ecal/core/src/ecal_global_accessors.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,8 +48,8 @@ namespace eCAL std::string g_process_id_s; std::string g_process_info; - eCAL_Process_eSeverity g_process_severity(eCAL_Process_eSeverity::proc_sev_unknown); - eCAL_Process_eSeverity_Level g_process_severity_level(eCAL_Process_eSeverity_Level::proc_sev_level1); + eCAL::Process::eSeverity g_process_severity(eCAL::Process::eSeverity::unknown); + eCAL::Process::eSeverityLevel g_process_severity_level(eCAL::Process::eSeverityLevel::level1); void InitGlobals() { diff --git a/ecal/core/src/ecal_global_accessors.h b/ecal/core/src/ecal_global_accessors.h index a44d88c877..b331633b63 100644 --- a/ecal/core/src/ecal_global_accessors.h +++ b/ecal/core/src/ecal_global_accessors.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -117,6 +117,6 @@ namespace eCAL extern std::string g_process_id_s; extern std::string g_process_info; - extern eCAL_Process_eSeverity g_process_severity; - extern eCAL_Process_eSeverity_Level g_process_severity_level; + extern eCAL::Process::eSeverity g_process_severity; + extern eCAL::Process::eSeverityLevel g_process_severity_level; } diff --git a/ecal/core/src/ecal_process.cpp b/ecal/core/src/ecal_process.cpp index 475f79aa6a..6b7f50bf0a 100644 --- a/ecal/core/src/ecal_process.cpp +++ b/ecal/core/src/ecal_process.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -289,7 +289,7 @@ namespace eCAL #endif } - void SetState(eCAL_Process_eSeverity severity_, eCAL_Process_eSeverity_Level level_, const char* info_) + void SetState(eCAL::Process::eSeverity severity_, eCAL::Process::eSeverityLevel level_, const char* info_) { g_process_severity = severity_; g_process_severity_level = level_; @@ -352,7 +352,7 @@ namespace eCAL return(g_process_par); } - int StartProcess(const char* proc_name_, const char* proc_args_, const char* working_dir_, const bool create_console_, const eCAL_Process_eStartMode process_mode_, const bool block_) + int StartProcess(const char* proc_name_, const char* proc_args_, const char* working_dir_, const bool create_console_, const eCAL::Process::eStartMode process_mode_, const bool block_) { int ret_pid = 0; @@ -970,7 +970,7 @@ namespace eCAL const char* proc_args_, const char* working_dir_, const bool /* create_console_ */, - const eCAL_Process_eStartMode process_mode_, + const eCAL::Process::eStartMode process_mode_, const bool block_) { // Evaluate whether we want to use a terminal emulator. We only use a @@ -981,7 +981,7 @@ namespace eCAL // - ecal_process_stub is available AND prints the correct version std::string terminal_emulator_command; - if (process_mode_ != eCAL_Process_eStartMode::proc_smode_hidden) + if (process_mode_ != eCAL::Process::eStartMode::hidden) { STD_COUT_DEBUG("[PID " << getpid() << "]: " << "Checking requirements for using a terminal emulator... " << std::endl); terminal_emulator_command = getTerminalEmulatorCommand(); diff --git a/ecal/core/src/io/shm/ecal_memfile_pool.cpp b/ecal/core/src/io/shm/ecal_memfile_pool.cpp index 9a982e48ae..efc90d9675 100644 --- a/ecal/core/src/io/shm/ecal_memfile_pool.cpp +++ b/ecal/core/src/io/shm/ecal_memfile_pool.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * Copyright (C) 2022 Eclipse Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -69,7 +69,7 @@ namespace eCAL #ifndef NDEBUG // log it - Logging::Log(log_level_debug2, std::string("CMemFileObserver " + m_memfile.Name() + " created")); + Logging::Log(Logging::log_level_debug2, std::string("CMemFileObserver " + m_memfile.Name() + " created")); #endif return true; @@ -90,7 +90,7 @@ namespace eCAL #ifndef NDEBUG // log it - Logging::Log(log_level_debug2, std::string("CMemFileObserver " + m_memfile.Name() + " destroyed")); + Logging::Log(Logging::log_level_debug2, std::string("CMemFileObserver " + m_memfile.Name() + " destroyed")); #endif return true; @@ -112,7 +112,7 @@ namespace eCAL #ifndef NDEBUG // log it - Logging::Log(log_level_debug2, std::string("CMemFileObserver started.")); + Logging::Log(Logging::log_level_debug2, std::string("CMemFileObserver started.")); #endif return true; @@ -281,11 +281,11 @@ namespace eCAL // log it if(m_do_stop) { - Logging::Log(log_level_debug2, std::string("CMemFileObserver " + m_memfile.Name() + " stopped")); + Logging::Log(Logging::log_level_debug2, std::string("CMemFileObserver " + m_memfile.Name() + " stopped")); } else { - Logging::Log(log_level_debug2, std::string("CMemFileObserver " + m_memfile.Name() + " timeout")); + Logging::Log(Logging::log_level_debug2, std::string("CMemFileObserver " + m_memfile.Name() + " timeout")); } #endif @@ -402,7 +402,7 @@ namespace eCAL m_observer_pool[memfile_name_] = observer; #ifndef NDEBUG // log it - Logging::Log(log_level_debug2, std::string("CMemFileThreadPool::ObserveFile " + memfile_name_ + " added")); + Logging::Log(Logging::log_level_debug2, std::string("CMemFileThreadPool::ObserveFile " + memfile_name_ + " added")); #endif return(true); } @@ -439,7 +439,7 @@ namespace eCAL { #ifndef NDEBUG // log it - Logging::Log(log_level_debug2, std::string("CMemFileThreadPool::ObserveFile " + observer->first + " removed")); + Logging::Log(eCAL::Logging::log_level_debug2, std::string("CMemFileThreadPool::ObserveFile " + observer->first + " removed")); #endif observer = m_observer_pool.erase(observer); } diff --git a/ecal/core/src/io/shm/ecal_memfile_sync.cpp b/ecal/core/src/io/shm/ecal_memfile_sync.cpp index ebc3ef5b6e..f90982388f 100644 --- a/ecal/core/src/io/shm/ecal_memfile_sync.cpp +++ b/ecal/core/src/io/shm/ecal_memfile_sync.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -124,7 +124,7 @@ namespace eCAL if (file_to_small) { #ifndef NDEBUG - Logging::Log(log_level_debug4, m_base_name + "::CSyncMemoryFile::CheckSize - RECREATE"); + Logging::Log(Logging::log_level_debug4, m_base_name + "::CSyncMemoryFile::CheckSize - RECREATE"); #endif // estimate size of memory file const size_t memfile_size = sizeof(SMemFileHeader) + size_ + static_cast((static_cast(m_attr.reserve) / 100.0f) * static_cast(size_)); @@ -143,7 +143,7 @@ namespace eCAL { if (!m_created) { - Logging::Log(log_level_error, m_base_name + "::CSyncMemoryFile::Write - FAILED (m_created == false)"); + Logging::Log(Logging::log_level_error, m_base_name + "::CSyncMemoryFile::Write - FAILED (m_created == false)"); return false; } @@ -153,7 +153,7 @@ namespace eCAL // write header and payload into the memory file #ifndef NDEBUG - Logging::Log(log_level_debug4, m_base_name + "::CSyncMemoryFile::Write"); + Logging::Log(Logging::log_level_debug4, m_base_name + "::CSyncMemoryFile::Write"); #endif // create user file header @@ -181,7 +181,7 @@ namespace eCAL if (!write_access) { #ifndef NDEBUG - Logging::Log(log_level_debug2, m_base_name + "::CSyncMemoryFile::Write::GetWriteAccess - FAILED"); + Logging::Log(Logging::log_level_debug2, m_base_name + "::CSyncMemoryFile::Write::GetWriteAccess - FAILED"); #endif // try to recreate the memory file @@ -192,7 +192,7 @@ namespace eCAL // still no chance ? hell .... we give up if (!write_access) { - Logging::Log(log_level_error, m_base_name + "::CSyncMemoryFile::Write::GetWriteAccess - FAILED FINALLY"); + Logging::Log(Logging::log_level_error, m_base_name + "::CSyncMemoryFile::Write::GetWriteAccess - FAILED FINALLY"); return false; } } @@ -218,12 +218,12 @@ namespace eCAL if (written) { #ifndef NDEBUG - Logging::Log(log_level_debug4, m_base_name + "::CSyncMemoryFile::Write - SUCCESS : " + std::to_string(data_.len) + " Bytes written"); + Logging::Log(Logging::log_level_debug4, m_base_name + "::CSyncMemoryFile::Write - SUCCESS : " + std::to_string(data_.len) + " Bytes written"); #endif } else { - Logging::Log(log_level_error, m_base_name + "::CSyncMemoryFile::Write - FAILED (written == false)"); + Logging::Log(Logging::log_level_error, m_base_name + "::CSyncMemoryFile::Write - FAILED (written == false)"); } // return success @@ -257,12 +257,12 @@ namespace eCAL // create the memory file if (!m_memfile.Create(m_memfile_name.c_str(), true, memfile_size)) { - Logging::Log(log_level_error, std::string("CSyncMemoryFile::Create FAILED : ") + m_memfile_name); + Logging::Log(Logging::log_level_error, std::string("CSyncMemoryFile::Create FAILED : ") + m_memfile_name); return false; } #ifndef NDEBUG - Logging::Log(log_level_debug2, std::string("CSyncMemoryFile::Create SUCCESS : ") + m_memfile_name); + Logging::Log(Logging::log_level_debug2, std::string("CSyncMemoryFile::Create SUCCESS : ") + m_memfile_name); #endif // initialize memory file with empty header @@ -294,13 +294,13 @@ namespace eCAL if (!m_memfile.Destroy(true)) { #ifndef NDEBUG - Logging::Log(log_level_debug2, std::string(m_base_name + "::CSyncMemoryFile::Destroy - FAILED : ") + m_memfile.Name()); + Logging::Log(Logging::log_level_debug2, std::string(m_base_name + "::CSyncMemoryFile::Destroy - FAILED : ") + m_memfile.Name()); #endif return false; } #ifndef NDEBUG - Logging::Log(log_level_debug2, std::string(m_base_name + "::CSyncMemoryFile::Destroy - SUCCESS : ") + m_memfile.Name()); + Logging::Log(Logging::log_level_debug2, std::string(m_base_name + "::CSyncMemoryFile::Destroy - SUCCESS : ") + m_memfile.Name()); #endif return true; } @@ -392,14 +392,14 @@ namespace eCAL // requests that via registration layer again. event_handle.second.event_ack_is_invalid = true; #ifndef NDEBUG - Logging::Log(log_level_debug2, m_base_name + "::CSyncMemoryFile::SignalWritten - ACK event timeout"); + Logging::Log(Logging::log_level_debug2, m_base_name + "::CSyncMemoryFile::SignalWritten - ACK event timeout"); #endif } } } #ifndef NDEBUG - Logging::Log(log_level_debug4, m_base_name + "::CSyncMemoryFile::SignalWritten"); + Logging::Log(Logging::log_level_debug4, m_base_name + "::CSyncMemoryFile::SignalWritten"); #endif } diff --git a/ecal/core/src/logging/config/attributes/ecal_log_provider_attributes.h b/ecal/core/src/logging/config/attributes/ecal_log_provider_attributes.h index 065a75ca54..c9a8fcfc6b 100644 --- a/ecal/core/src/logging/config/attributes/ecal_log_provider_attributes.h +++ b/ecal/core/src/logging/config/attributes/ecal_log_provider_attributes.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ namespace eCAL struct SSink { bool enabled; - eCAL_Logging_Filter filter_log; + Filter filter_log; }; struct SUDP diff --git a/ecal/core/src/logging/ecal_log.cpp b/ecal/core/src/logging/ecal_log.cpp index 5fb3b2517a..e746bee66c 100644 --- a/ecal/core/src/logging/ecal_log.cpp +++ b/ecal/core/src/logging/ecal_log.cpp @@ -37,7 +37,7 @@ namespace eCAL * * @param msg_ The log message string. **/ - void Log(eCAL_Logging_eLogLevel level_, const std::string& msg_) + void Log(eLogLevel level_, const std::string& msg_) { if(g_log_provider() != nullptr) g_log_provider()->Log(level_, msg_); } diff --git a/ecal/core/src/logging/ecal_log_provider.cpp b/ecal/core/src/logging/ecal_log_provider.cpp index 93bf74e158..25a1acc084 100644 --- a/ecal/core/src/logging/ecal_log_provider.cpp +++ b/ecal/core/src/logging/ecal_log_provider.cpp @@ -85,7 +85,7 @@ namespace std::cout << "[eCAL][Logging-Provider][Warning] " << msg_ << "\n"; } - void createLogHeader(std::stringstream& msg_stream, const eCAL_Logging_eLogLevel level_, const eCAL::Logging::SProviderAttributes& attr_, const eCAL::Time::ecal_clock::time_point& log_time_) + void createLogHeader(std::stringstream& msg_stream, const eCAL::Logging::eLogLevel level_, const eCAL::Logging::SProviderAttributes& attr_, const eCAL::Time::ecal_clock::time_point& log_time_) { msg_stream << std::chrono::duration_cast(log_time_.time_since_epoch()).count(); msg_stream << " ms"; @@ -98,31 +98,31 @@ namespace msg_stream << " | "; switch(level_) { - case log_level_none: - case log_level_all: + case eCAL::Logging::log_level_none: + case eCAL::Logging::log_level_all: break; - case log_level_info: + case eCAL::Logging::log_level_info: msg_stream << "info"; break; - case log_level_warning: + case eCAL::Logging::log_level_warning: msg_stream << "warning"; break; - case log_level_error: + case eCAL::Logging::log_level_error: msg_stream << "error"; break; - case log_level_fatal: + case eCAL::Logging::log_level_fatal: msg_stream << "fatal"; break; - case log_level_debug1: + case eCAL::Logging::log_level_debug1: msg_stream << "debug1"; break; - case log_level_debug2: + case eCAL::Logging::log_level_debug2: msg_stream << "debug2"; break; - case log_level_debug3: + case eCAL::Logging::log_level_debug3: msg_stream << "debug3"; break; - case log_level_debug4: + case eCAL::Logging::log_level_debug4: msg_stream << "debug4"; break; } @@ -209,16 +209,16 @@ namespace eCAL return m_udp_logging_sender != nullptr; } - void CLogProvider::Log(const eCAL_Logging_eLogLevel level_, const std::string& msg_) + void CLogProvider::Log(const eLogLevel level_, const std::string& msg_) { const std::lock_guard lock(m_log_mtx); if(!m_created) return; if(msg_.empty()) return; - const eCAL_Logging_Filter log_con = level_ & m_attributes.console_sink.filter_log; - const eCAL_Logging_Filter log_file = level_ & m_attributes.file_sink.filter_log; - const eCAL_Logging_Filter log_udp = level_ & m_attributes.udp_sink.filter_log; + const Filter log_con = level_ & m_attributes.console_sink.filter_log; + const Filter log_file = level_ & m_attributes.file_sink.filter_log; + const Filter log_udp = level_ & m_attributes.udp_sink.filter_log; if((log_con | log_file | log_udp) == 0) return; auto log_time = eCAL::Time::ecal_clock::now(); diff --git a/ecal/core/src/logging/ecal_log_provider.h b/ecal/core/src/logging/ecal_log_provider.h index b1aa0f4845..35e2212f21 100644 --- a/ecal/core/src/logging/ecal_log_provider.h +++ b/ecal/core/src/logging/ecal_log_provider.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,7 +69,7 @@ namespace eCAL * @param level_ The level. * @param msg_ The message. **/ - void Log(eCAL_Logging_eLogLevel level_, const std::string& msg_); + void Log(eLogLevel level_, const std::string& msg_); private: diff --git a/ecal/core/src/monitoring/ecal_monitoring_impl.cpp b/ecal/core/src/monitoring/ecal_monitoring_impl.cpp index 3d8f13823c..d9a9043f28 100644 --- a/ecal/core/src/monitoring/ecal_monitoring_impl.cpp +++ b/ecal/core/src/monitoring/ecal_monitoring_impl.cpp @@ -129,7 +129,7 @@ namespace eCAL break; default: { - Logging::Log(log_level_debug1, "CMonitoringImpl::ApplySample : unknown sample type"); + Logging::Log(Logging::log_level_debug1, "CMonitoringImpl::ApplySample : unknown sample type"); } break; } diff --git a/ecal/core/src/pubsub/ecal_publisher_impl.cpp b/ecal/core/src/pubsub/ecal_publisher_impl.cpp index 285b01e662..cf4b34cee7 100644 --- a/ecal/core/src/pubsub/ecal_publisher_impl.cpp +++ b/ecal/core/src/pubsub/ecal_publisher_impl.cpp @@ -105,7 +105,7 @@ namespace eCAL m_created(false) { #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::Constructor"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::Constructor"); #endif // build topic id @@ -118,7 +118,7 @@ namespace eCAL CPublisherImpl::~CPublisherImpl() { #ifndef NDEBUG - Logging::Log(log_level_debug1, m_attributes.topic_name + "::CPublisherImpl::Destructor"); + Logging::Log(Logging::log_level_debug1, m_attributes.topic_name + "::CPublisherImpl::Destructor"); #endif if (!m_created) return; @@ -184,7 +184,7 @@ namespace eCAL if (m_writer_shm) { #ifndef NDEBUG - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Write::SHM"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Write::SHM"); #endif // send it @@ -230,11 +230,11 @@ namespace eCAL #ifndef NDEBUG if (shm_sent) { - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Write::SHM - SUCCESS"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Write::SHM - SUCCESS"); } else { - Logging::Log(log_level_error, m_attributes.topic_name + "::CPublisherImpl::Write::SHM - FAILED"); + Logging::Log(Logging::log_level_error, m_attributes.topic_name + "::CPublisherImpl::Write::SHM - FAILED"); } #endif } @@ -247,7 +247,7 @@ namespace eCAL if (m_writer_udp) { #ifndef NDEBUG - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Write::udp"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Write::udp"); #endif // send it @@ -279,11 +279,11 @@ namespace eCAL #ifndef NDEBUG if (udp_sent) { - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Write::udp - SUCCESS"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Write::udp - SUCCESS"); } else { - Logging::Log(log_level_error, m_attributes.topic_name + "::CPublisherImpl::Write::udp - FAILED"); + Logging::Log(Logging::log_level_error, m_attributes.topic_name + "::CPublisherImpl::Write::udp - FAILED"); } #endif } @@ -296,7 +296,7 @@ namespace eCAL if (m_writer_tcp) { #ifndef NDEBUG - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Send::TCP"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Send::TCP"); #endif // send it @@ -319,11 +319,11 @@ namespace eCAL #ifndef NDEBUG if (tcp_sent) { - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Write::TCP - SUCCESS"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::Write::TCP - SUCCESS"); } else { - Logging::Log(log_level_error, m_attributes.topic_name + "::CPublisherImpl::Write::TCP - FAILED"); + Logging::Log(eCAL::Logging::log_level_error, m_attributes.topic_name + "::CPublisherImpl::Write::TCP - FAILED"); } #endif } @@ -338,7 +338,7 @@ namespace eCAL m_topic_info = topic_info_; #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::SetDataTypeInformation"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::SetDataTypeInformation"); #endif return(true); @@ -349,7 +349,7 @@ namespace eCAL m_attr[attr_name_] = attr_value_; #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::SetAttribute"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::SetAttribute"); #endif return(true); @@ -360,18 +360,18 @@ namespace eCAL m_attr.erase(attr_name_); #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::ClearAttribute"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::ClearAttribute"); #endif return(true); } - bool CPublisherImpl::SetEventCallback(eCAL_Publisher_Event type_, const v5::PubEventCallbackT callback_) + bool CPublisherImpl::SetEventCallback(ePublisherEvent type_, const v5::PubEventCallbackT callback_) { if (!m_created) return(false); #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::SetEventCallback"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::SetEventCallback"); #endif // set event callback @@ -383,12 +383,12 @@ namespace eCAL return(true); } - bool CPublisherImpl::RemoveEventCallback(eCAL_Publisher_Event type_) + bool CPublisherImpl::RemoveEventCallback(ePublisherEvent type_) { if (!m_created) return(false); #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::RemoveEventCallback"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::RemoveEventCallback"); #endif // remove event callback @@ -405,7 +405,7 @@ namespace eCAL if (!m_created) return false; #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::SetEventCallback"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::SetEventCallback"); #endif // set event id callback @@ -421,7 +421,7 @@ namespace eCAL if (!m_created) return false; #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::RemoveEventCallback"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::RemoveEventCallback"); #endif // remove event id callback @@ -539,7 +539,7 @@ namespace eCAL } #ifndef NDEBUG - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::ApplySubscriberRegistration"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::ApplySubscriberRegistration"); #endif } @@ -570,7 +570,7 @@ namespace eCAL FireDisconnectEvent(subscription_info_, data_type_info_); #ifndef NDEBUG - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::ApplySubscriberUnregistration"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CPublisherImpl::ApplySubscriberUnregistration"); #endif } @@ -606,7 +606,7 @@ namespace eCAL if (g_registration_provider() != nullptr) g_registration_provider()->RegisterSample(registration_sample); #ifndef NDEBUG - Logging::Log(log_level_debug4, m_attributes.topic_name + "::CPublisherImpl::Register"); + Logging::Log(Logging::log_level_debug4, m_attributes.topic_name + "::CPublisherImpl::Register"); #endif #endif // ECAL_CORE_REGISTRATION } @@ -619,7 +619,7 @@ namespace eCAL if (g_registration_provider() != nullptr) g_registration_provider()->UnregisterSample(unregistration_sample); #ifndef NDEBUG - Logging::Log(log_level_debug4, m_attributes.topic_name + "::CPublisherImpl::Unregister"); + Logging::Log(Logging::log_level_debug4, m_attributes.topic_name + "::CPublisherImpl::Unregister"); #endif #endif // ECAL_CORE_REGISTRATION } @@ -733,7 +733,7 @@ namespace eCAL ecal_reg_sample_topic.uname = m_attributes.unit_name; } - void CPublisherImpl::FireEvent(const eCAL_Publisher_Event type_, const SSubscriptionInfo& subscription_info_, const SDataTypeInformation& data_type_info_) + void CPublisherImpl::FireEvent(const ePublisherEvent type_, const SSubscriptionInfo& subscription_info_, const SDataTypeInformation& data_type_info_) { // new event handling with topic id if(m_event_id_callback) @@ -776,17 +776,17 @@ namespace eCAL void CPublisherImpl::FireConnectEvent(const SSubscriptionInfo& subscription_info_, const SDataTypeInformation& data_type_info_) { - FireEvent(pub_event_connected, subscription_info_, data_type_info_); + FireEvent(ePublisherEvent::connected, subscription_info_, data_type_info_); } void CPublisherImpl::FireUpdateEvent(const SSubscriptionInfo& subscription_info_, const SDataTypeInformation& data_type_info_) { - FireEvent(pub_event_update_connection, subscription_info_, data_type_info_); + FireEvent(ePublisherEvent::update_connection, subscription_info_, data_type_info_); } void CPublisherImpl::FireDisconnectEvent(const SSubscriptionInfo& subscription_info_, const SDataTypeInformation& data_type_info_) { - FireEvent(pub_event_disconnected, subscription_info_, data_type_info_); + FireEvent(ePublisherEvent::disconnected, subscription_info_, data_type_info_); } size_t CPublisherImpl::GetConnectionCount() @@ -812,7 +812,7 @@ namespace eCAL m_layers.udp.write_enabled = true; // log state - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartUdpLayer::ACTIVATED"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartUdpLayer::ACTIVATED"); // create writer m_writer_udp = std::make_unique(eCAL::eCALWriter::BuildUDPAttributes(m_topic_id, m_attributes)); @@ -821,7 +821,7 @@ namespace eCAL Register(); #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartUdpLayer::WRITER_CREATED"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartUdpLayer::WRITER_CREATED"); #endif return true; #else // ECAL_CORE_TRANSPORT_UDP @@ -838,7 +838,7 @@ namespace eCAL m_layers.shm.write_enabled = true; // log state - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartShmLayer::ACTIVATED"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartShmLayer::ACTIVATED"); // create writer m_writer_shm = std::make_unique(eCAL::eCALWriter::BuildSHMAttributes(m_attributes)); @@ -847,7 +847,7 @@ namespace eCAL Register(); #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartShmLayer::WRITER_CREATED"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartShmLayer::WRITER_CREATED"); #endif return true; #else // ECAL_CORE_TRANSPORT_SHM @@ -864,7 +864,7 @@ namespace eCAL m_layers.tcp.write_enabled = true; // log state - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartTcpLayer::ACTIVATED"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartTcpLayer::ACTIVATED"); // create writer m_writer_tcp = std::make_unique(eCAL::eCALWriter::BuildTCPAttributes(m_topic_id, m_attributes)); @@ -873,7 +873,7 @@ namespace eCAL Register(); #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartTcpLayer::WRITER_CREATED"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CPublisherImpl::StartTcpLayer::WRITER_CREATED"); #endif return true; #else // ECAL_CORE_TRANSPORT_TCP diff --git a/ecal/core/src/pubsub/ecal_publisher_impl.h b/ecal/core/src/pubsub/ecal_publisher_impl.h index 6234cf2f6d..3886ff15d3 100644 --- a/ecal/core/src/pubsub/ecal_publisher_impl.h +++ b/ecal/core/src/pubsub/ecal_publisher_impl.h @@ -83,8 +83,8 @@ namespace eCAL bool SetDataTypeInformation(const SDataTypeInformation& topic_info_); // deprecated event callback interface - bool SetEventCallback(eCAL_Publisher_Event type_, const v5::PubEventCallbackT callback_); - bool RemoveEventCallback(eCAL_Publisher_Event type_); + bool SetEventCallback(ePublisherEvent type_, const v5::PubEventCallbackT callback_); + bool RemoveEventCallback(ePublisherEvent type_); // future event callback interface bool SetEventCallback(const PubEventCallbackT callback_); @@ -130,7 +130,7 @@ namespace eCAL void StopAllLayer(); - void FireEvent(const eCAL_Publisher_Event type_, const SSubscriptionInfo& subscription_info_, const SDataTypeInformation& data_type_info_); + void FireEvent(const ePublisherEvent type_, const SSubscriptionInfo& subscription_info_, const SDataTypeInformation& data_type_info_); void FireConnectEvent (const SSubscriptionInfo& subscription_info_, const SDataTypeInformation& data_type_info_); void FireUpdateEvent (const SSubscriptionInfo& subscription_info_, const SDataTypeInformation& data_type_info_); @@ -163,7 +163,7 @@ namespace eCAL SSubscriptionMapT m_connection_map; std::atomic m_connection_count{ 0 }; - using EventCallbackMapT = std::map; + using EventCallbackMapT = std::map; std::mutex m_event_callback_map_mutex; EventCallbackMapT m_event_callback_map; diff --git a/ecal/core/src/pubsub/ecal_publisher_v5.cpp b/ecal/core/src/pubsub/ecal_publisher_v5.cpp index ee8e12537a..684586a88f 100644 --- a/ecal/core/src/pubsub/ecal_publisher_v5.cpp +++ b/ecal/core/src/pubsub/ecal_publisher_v5.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,7 +116,7 @@ namespace eCAL if(g_pubgate() != nullptr) g_pubgate()->Unregister(m_publisher_impl->GetTopicName(), m_publisher_impl); #ifndef NDEBUG // log it - eCAL::Logging::Log(log_level_debug1, std::string(m_publisher_impl->GetTopicName() + "::CPublisher::Destroy")); + eCAL::Logging::Log(Logging::log_level_debug1, std::string(m_publisher_impl->GetTopicName() + "::CPublisher::Destroy")); #endif // destroy publisher @@ -184,14 +184,14 @@ namespace eCAL return(Send(s_.data(), s_.size(), time_)); } - bool CPublisher::AddEventCallback(eCAL_Publisher_Event type_, PubEventCallbackT callback_) + bool CPublisher::AddEventCallback(ePublisherEvent type_, PubEventCallbackT callback_) { if (m_publisher_impl == nullptr) return(false); RemEventCallback(type_); return(m_publisher_impl->SetEventCallback(type_, std::move(callback_))); } - bool CPublisher::RemEventCallback(eCAL_Publisher_Event type_) + bool CPublisher::RemEventCallback(ePublisherEvent type_) { if (m_publisher_impl == nullptr) return(false); return(m_publisher_impl->RemoveEventCallback(type_)); diff --git a/ecal/core/src/pubsub/ecal_subgate.cpp b/ecal/core/src/pubsub/ecal_subgate.cpp index 79530e33a6..9c798d03d2 100644 --- a/ecal/core/src/pubsub/ecal_subgate.cpp +++ b/ecal/core/src/pubsub/ecal_subgate.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -120,7 +120,7 @@ namespace eCAL if (layer_ == eTLayerType::tl_none) { // log it - Logging::Log(log_level_error, ecal_sample.topic_info.tname + " : payload received without layer definition !"); + Logging::Log(Logging::log_level_error, ecal_sample.topic_info.tname + " : payload received without layer definition !"); } #endif diff --git a/ecal/core/src/pubsub/ecal_subscriber_impl.cpp b/ecal/core/src/pubsub/ecal_subscriber_impl.cpp index d8eed21647..019d62dce6 100644 --- a/ecal/core/src/pubsub/ecal_subscriber_impl.cpp +++ b/ecal/core/src/pubsub/ecal_subscriber_impl.cpp @@ -77,7 +77,7 @@ namespace eCAL { #ifndef NDEBUG // log it - Logging::Log(log_level_debug1, m_attributes.topic_name + "::CSubscriberImpl::Constructor"); + Logging::Log(Logging::log_level_debug1, m_attributes.topic_name + "::CSubscriberImpl::Constructor"); #endif // build topic id @@ -95,7 +95,7 @@ namespace eCAL { #ifndef NDEBUG // log it - Logging::Log(log_level_debug1, m_attributes.topic_name + "::CSubscriberImpl::Destructor"); + Logging::Log(Logging::log_level_debug1, m_attributes.topic_name + "::CSubscriberImpl::Destructor"); #endif if (!m_created) return; @@ -146,7 +146,7 @@ namespace eCAL { #ifndef NDEBUG // log it - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::Read"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::Read"); #endif // copy content to target string buf_.clear(); @@ -168,7 +168,7 @@ namespace eCAL if (!m_created) return(false); #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::SetReceiveCallback"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::SetReceiveCallback"); #endif // set receive callback @@ -185,7 +185,7 @@ namespace eCAL if (!m_created) return(false); #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::RemoveReceiveCallback"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::RemoveReceiveCallback"); #endif // remove receive callback @@ -197,12 +197,12 @@ namespace eCAL return(true); } - bool CSubscriberImpl::SetEventCallback(eCAL_Subscriber_Event type_, v5::SubEventCallbackT callback_) + bool CSubscriberImpl::SetEventCallback(eSubscriberEvent type_, v5::SubEventCallbackT callback_) { if (!m_created) return(false); #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::SetEventCallback"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::SetEventCallback"); #endif // set event callback @@ -214,12 +214,12 @@ namespace eCAL return(true); } - bool CSubscriberImpl::RemoveEventCallback(eCAL_Subscriber_Event type_) + bool CSubscriberImpl::RemoveEventCallback(eSubscriberEvent type_) { if (!m_created) return(false); #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::RemoveEventCallback"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::RemoveEventCallback"); #endif // remove event callback @@ -236,7 +236,7 @@ namespace eCAL if (!m_created) return false; #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::SetEventIDCallback"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::SetEventIDCallback"); #endif // set event id callback @@ -252,7 +252,7 @@ namespace eCAL if (!m_created) return false; #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::RemoveEventCallback"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::RemoveEventCallback"); #endif // remove event id callback @@ -266,7 +266,7 @@ namespace eCAL bool CSubscriberImpl::SetAttribute(const std::string& attr_name_, const std::string& attr_value_) { #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::SetAttribute"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::SetAttribute"); #endif m_attr[attr_name_] = attr_value_; @@ -277,7 +277,7 @@ namespace eCAL bool CSubscriberImpl::ClearAttribute(const std::string& attr_name_) { #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::ClearAttribute"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::ClearAttribute"); #endif m_attr.erase(attr_name_); @@ -288,7 +288,7 @@ namespace eCAL void CSubscriberImpl::SetFilterIDs(const std::set& filter_ids_) { #ifndef NDEBUG - Logging::Log(log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::SetFilterIDs"); + Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::SetFilterIDs"); #endif m_id_set = filter_ids_; @@ -357,7 +357,7 @@ namespace eCAL } #ifndef NDEBUG - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::ApplyPublisherRegistration"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::ApplyPublisherRegistration"); #endif } @@ -382,7 +382,7 @@ namespace eCAL } #ifndef NDEBUG - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::ApplyPublisherUnregistration"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::ApplyPublisherUnregistration"); #endif } @@ -476,7 +476,7 @@ namespace eCAL { #ifndef NDEBUG // log it - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::AddSample discard sample because of multiple receive"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::AddSample discard sample because of multiple receive"); #endif return(size_); } @@ -505,7 +505,7 @@ namespace eCAL #ifndef NDEBUG // log it - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::ApplySample"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::ApplySample"); #endif // increase read clock @@ -532,7 +532,7 @@ namespace eCAL { #ifndef NDEBUG // log it - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::ApplySample::ReceiveCallback"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::ApplySample::ReceiveCallback"); #endif // prepare data struct SReceiveCallbackData cb_data; @@ -574,7 +574,7 @@ namespace eCAL m_read_buf_cv.notify_one(); #ifndef NDEBUG // log it - Logging::Log(log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::ApplySample::Receive::Buffered"); + Logging::Log(Logging::log_level_debug3, m_attributes.topic_name + "::CSubscriberImpl::ApplySample::Receive::Buffered"); #endif } @@ -590,7 +590,7 @@ namespace eCAL #ifndef NDEBUG // log it - Logging::Log(log_level_debug4, m_attributes.topic_name + "::CSubscriberImpl::Register"); + Logging::Log(Logging::log_level_debug4, m_attributes.topic_name + "::CSubscriberImpl::Register"); #endif #endif // ECAL_CORE_REGISTRATION } @@ -604,7 +604,7 @@ namespace eCAL #ifndef NDEBUG // log it - Logging::Log(log_level_debug4, m_attributes.topic_name + "::CSubscriberImpl::Unregister"); + Logging::Log(Logging::log_level_debug4, m_attributes.topic_name + "::CSubscriberImpl::Unregister"); #endif #endif // ECAL_CORE_REGISTRATION } @@ -782,7 +782,7 @@ namespace eCAL #endif } - void CSubscriberImpl::FireEvent(const eCAL_Subscriber_Event type_, const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_) + void CSubscriberImpl::FireEvent(const eSubscriberEvent type_, const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_) { // new event handling with topic id if (m_event_id_callback) @@ -825,17 +825,17 @@ namespace eCAL void CSubscriberImpl::FireConnectEvent(const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_) { - FireEvent(sub_event_connected, publication_info_, data_type_info_); + FireEvent(eSubscriberEvent::connected, publication_info_, data_type_info_); } void CSubscriberImpl::FireUpdateEvent(const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_) { - FireEvent(sub_event_update_connection, publication_info_, data_type_info_); + FireEvent(eSubscriberEvent::update_connection, publication_info_, data_type_info_); } void CSubscriberImpl::FireDisconnectEvent(const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_) { - FireEvent(sub_event_disconnected, publication_info_, data_type_info_); + FireEvent(eSubscriberEvent::disconnected, publication_info_, data_type_info_); } size_t CSubscriberImpl::GetConnectionCount() @@ -910,7 +910,7 @@ namespace eCAL if (m_event_id_callback) { SSubEventCallbackData data; - data.type = sub_event_dropped; + data.type = eSubscriberEvent::dropped; data.time = std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()).count(); data.clock = current_clock_; @@ -925,11 +925,11 @@ namespace eCAL // deprecated event handling with topic name { const std::lock_guard lock(m_event_callback_map_mutex); - auto citer = m_event_callback_map.find(sub_event_dropped); + auto citer = m_event_callback_map.find(eSubscriberEvent::dropped); if (citer != m_event_callback_map.end() && citer->second) { v5::SSubEventCallbackData data; - data.type = sub_event_dropped; + data.type = eSubscriberEvent::dropped; data.time = std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()).count(); data.clock = current_clock_; @@ -977,7 +977,7 @@ namespace eCAL msg += m_attributes.topic_name; msg += "\'"; msg += " received a message in the wrong order"; - Logging::Log(log_level_warning, msg); + Logging::Log(Logging::log_level_warning, msg); // process it return true; diff --git a/ecal/core/src/pubsub/ecal_subscriber_impl.h b/ecal/core/src/pubsub/ecal_subscriber_impl.h index 38f9af546b..e30a721735 100644 --- a/ecal/core/src/pubsub/ecal_subscriber_impl.h +++ b/ecal/core/src/pubsub/ecal_subscriber_impl.h @@ -74,8 +74,8 @@ namespace eCAL bool RemoveReceiveCallback(); // deprecated event callback interface - bool SetEventCallback(eCAL_Subscriber_Event type_, v5::SubEventCallbackT callback_); - bool RemoveEventCallback(eCAL_Subscriber_Event type_); + bool SetEventCallback(eSubscriberEvent type_, v5::SubEventCallbackT callback_); + bool RemoveEventCallback(eSubscriberEvent type_); // future event callback interface bool SetEventIDCallback(const SubEventCallbackT callback_); @@ -123,7 +123,7 @@ namespace eCAL void StartTransportLayer(); void StopTransportLayer(); - void FireEvent(const eCAL_Subscriber_Event type_, const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_); + void FireEvent(const eSubscriberEvent type_, const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_); void FireConnectEvent (const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_); void FireUpdateEvent (const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_); @@ -163,7 +163,7 @@ namespace eCAL std::deque m_sample_hash_queue; - using EventCallbackMapT = std::map; + using EventCallbackMapT = std::map; std::mutex m_event_callback_map_mutex; EventCallbackMapT m_event_callback_map; diff --git a/ecal/core/src/pubsub/ecal_subscriber_v5.cpp b/ecal/core/src/pubsub/ecal_subscriber_v5.cpp index 602ee9a639..bc65c114fb 100644 --- a/ecal/core/src/pubsub/ecal_subscriber_v5.cpp +++ b/ecal/core/src/pubsub/ecal_subscriber_v5.cpp @@ -111,7 +111,7 @@ namespace eCAL #ifndef NDEBUG // log it - eCAL::Logging::Log(log_level_debug1, std::string(m_subscriber_impl->GetTopicName() + "::CSubscriber::Destroy")); + eCAL::Logging::Log(Logging::log_level_debug1, std::string(m_subscriber_impl->GetTopicName() + "::CSubscriber::Destroy")); #endif // destroy datareader @@ -168,14 +168,14 @@ namespace eCAL return(m_subscriber_impl->RemoveReceiveCallback()); } - bool CSubscriber::AddEventCallback(eCAL_Subscriber_Event type_, SubEventCallbackT callback_) + bool CSubscriber::AddEventCallback(eSubscriberEvent type_, SubEventCallbackT callback_) { if (m_subscriber_impl == nullptr) return(false); RemEventCallback(type_); return(m_subscriber_impl->SetEventCallback(type_, callback_)); } - bool CSubscriber::RemEventCallback(eCAL_Subscriber_Event type_) + bool CSubscriber::RemEventCallback(eSubscriberEvent type_) { if (m_subscriber_impl == nullptr) return(false); return(m_subscriber_impl->RemoveEventCallback(type_)); diff --git a/ecal/core/src/readwrite/shm/ecal_writer_shm.cpp b/ecal/core/src/readwrite/shm/ecal_writer_shm.cpp index 0e319b1bdc..02bb4ac7f9 100644 --- a/ecal/core/src/readwrite/shm/ecal_writer_shm.cpp +++ b/ecal/core/src/readwrite/shm/ecal_writer_shm.cpp @@ -99,7 +99,7 @@ namespace eCAL { memory_file->Connect(std::to_string(process_id_)); #ifndef NDEBUG - Logging::Log(log_level_debug1, std::string("CDataWriterSHM::ApplySubscription - Memory FileName: ") + memory_file->GetName() + " to ProcessId " + std::to_string(process_id_)); + Logging::Log(Logging::log_level_debug1, std::string("CDataWriterSHM::ApplySubscription - Memory FileName: ") + memory_file->GetName() + " to ProcessId " + std::to_string(process_id_)); #endif } } @@ -140,7 +140,7 @@ namespace eCAL { memory_file->Disconnect(std::to_string(process_id_)); #ifndef NDEBUG - Logging::Log(log_level_debug1, std::string("CDataWriterSHM::RemoveSubscription - Memory FileName: ") + memory_file->GetName() + " to ProcessId " + std::to_string(process_id_)); + Logging::Log(Logging::log_level_debug1, std::string("CDataWriterSHM::RemoveSubscription - Memory FileName: ") + memory_file->GetName() + " to ProcessId " + std::to_string(process_id_)); #endif } } @@ -163,7 +163,7 @@ namespace eCAL // buffer count zero not allowed if (buffer_count_ < 1) { - Logging::Log(log_level_error, m_attributes.topic_name + "::CDataWriterSHM::SetBufferCount minimal number of memory files is 1 !"); + Logging::Log(Logging::log_level_error, m_attributes.topic_name + "::CDataWriterSHM::SetBufferCount minimal number of memory files is 1 !"); return false; } @@ -197,7 +197,7 @@ namespace eCAL else { m_memory_file_vec.clear(); - Logging::Log(log_level_error, "CDataWriterSHM::SetBufferCount - FAILED"); + Logging::Log(Logging::log_level_error, "CDataWriterSHM::SetBufferCount - FAILED"); return false; } } diff --git a/ecal/core/src/readwrite/tcp/ecal_tcp_pubsub_logger.h b/ecal/core/src/readwrite/tcp/ecal_tcp_pubsub_logger.h index 2ae254246d..777a6d0bb9 100644 --- a/ecal/core/src/readwrite/tcp/ecal_tcp_pubsub_logger.h +++ b/ecal/core/src/readwrite/tcp/ecal_tcp_pubsub_logger.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,22 +33,22 @@ namespace eCAL switch (log_level_) { case tcp_pubsub::logger::LogLevel::DebugVerbose: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_debug4, std::string("CTCPReaderLayer - TCPPubSub (DebugVerbose) -") + message_); + eCAL::Logging::Log(eCAL::Logging::log_level_debug4, std::string("CTCPReaderLayer - TCPPubSub (DebugVerbose) -") + message_); break; case tcp_pubsub::logger::LogLevel::Debug: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_debug3, std::string("CTCPReaderLayer - TCPPubSub (Debug) -") + message_); + eCAL::Logging::Log(eCAL::Logging::log_level_debug3, std::string("CTCPReaderLayer - TCPPubSub (Debug) -") + message_); break; case tcp_pubsub::logger::LogLevel::Info: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_info, std::string("CTCPReaderLayer - TCPPubSub (Info) -") + message_); + eCAL::Logging::Log(eCAL::Logging::log_level_info, std::string("CTCPReaderLayer - TCPPubSub (Info) -") + message_); break; case tcp_pubsub::logger::LogLevel::Warning: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_warning, std::string("CTCPReaderLayer - TCPPubSub (Warning) -") + message_); + eCAL::Logging::Log(eCAL::Logging::log_level_warning, std::string("CTCPReaderLayer - TCPPubSub (Warning) -") + message_); break; case tcp_pubsub::logger::LogLevel::Error: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_error, std::string("CTCPReaderLayer - TCPPubSub (Error) -") + message_); + eCAL::Logging::Log(eCAL::Logging::log_level_error, std::string("CTCPReaderLayer - TCPPubSub (Error) -") + message_); break; case tcp_pubsub::logger::LogLevel::Fatal: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_fatal, std::string("CTCPReaderLayer - TCPPubSub (Fatal) -") + message_); + eCAL::Logging::Log(eCAL::Logging::log_level_fatal, std::string("CTCPReaderLayer - TCPPubSub (Fatal) -") + message_); break; default: break; diff --git a/ecal/core/src/readwrite/udp/ecal_writer_udp.cpp b/ecal/core/src/readwrite/udp/ecal_writer_udp.cpp index 76af9e7ebd..fd8afd4912 100644 --- a/ecal/core/src/readwrite/udp/ecal_writer_udp.cpp +++ b/ecal/core/src/readwrite/udp/ecal_writer_udp.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,7 +105,7 @@ namespace eCAL // log it if (sent == 0) { - Logging::Log(log_level_fatal, "CDataWriterUDP::Send failed to send message !"); + Logging::Log(Logging::log_level_fatal, "CDataWriterUDP::Send failed to send message !"); } return(sent > 0); diff --git a/ecal/core/src/registration/ecal_registration_provider.cpp b/ecal/core/src/registration/ecal_registration_provider.cpp index 88be21131d..83405ff3f2 100644 --- a/ecal/core/src/registration/ecal_registration_provider.cpp +++ b/ecal/core/src/registration/ecal_registration_provider.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +79,7 @@ namespace eCAL } else { - eCAL::Logging::Log(log_level_warning, "[CRegistrationProvider] No registration layer enabled."); + eCAL::Logging::Log(Logging::log_level_warning, "[CRegistrationProvider] No registration layer enabled."); return; } diff --git a/ecal/core/src/registration/ecal_registration_sample_applier.cpp b/ecal/core/src/registration/ecal_registration_sample_applier.cpp index 516a5a58db..831cd04e27 100644 --- a/ecal/core/src/registration/ecal_registration_sample_applier.cpp +++ b/ecal/core/src/registration/ecal_registration_sample_applier.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ namespace eCAL { if (!AcceptRegistrationSample(sample_)) { - Logging::Log(log_level_debug1, "CSampleApplier::ApplySample : Incoming sample discarded"); + Logging::Log(Logging::log_level_debug1, "CSampleApplier::ApplySample : Incoming sample discarded"); return false; } diff --git a/ecal/core/src/registration/ecal_registration_sample_applier_gates.cpp b/ecal/core/src/registration/ecal_registration_sample_applier_gates.cpp index 795f327dbe..25b7ddcc77 100644 --- a/ecal/core/src/registration/ecal_registration_sample_applier_gates.cpp +++ b/ecal/core/src/registration/ecal_registration_sample_applier_gates.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ namespace eCAL break; #endif default: - Logging::Log(log_level_debug1, "CGatesApplier::ApplySample : unknown sample type"); + Logging::Log(Logging::log_level_debug1, "CGatesApplier::ApplySample : unknown sample type"); break; } } diff --git a/ecal/core/src/serialization/ecal_serialize_logging.cpp b/ecal/core/src/serialization/ecal_serialize_logging.cpp index 89c75664cb..fd7538d815 100644 --- a/ecal/core/src/serialization/ecal_serialize_logging.cpp +++ b/ecal/core/src/serialization/ecal_serialize_logging.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -133,7 +133,7 @@ namespace // pid log_message_.pid = pb_log_message_.pid; // level - log_message_.level = static_cast(pb_log_message_.level); + log_message_.level = static_cast(pb_log_message_.level); } bool Buffer2LogMessageStruct(const char* data_, size_t size_, eCAL::Logging::SLogMessage& log_message_) diff --git a/ecal/core/src/service/ecal_service_client.cpp b/ecal/core/src/service/ecal_service_client.cpp index 35de283414..b8c56a2f12 100644 --- a/ecal/core/src/service/ecal_service_client.cpp +++ b/ecal/core/src/service/ecal_service_client.cpp @@ -121,7 +121,7 @@ namespace eCAL // handle exceptions and add an error response SServiceIDResponse error_response; error_response.error_msg = e.what(); - error_response.call_state = call_state_failed; + error_response.call_state = eCallState::failed; service_response_vec_.emplace_back(error_response); // mark overall success as false if any call fails diff --git a/ecal/core/src/service/ecal_service_client_impl.cpp b/ecal/core/src/service/ecal_service_client_impl.cpp index 2493a23e60..b6b9b180e9 100644 --- a/ecal/core/src/service/ecal_service_client_impl.cpp +++ b/ecal/core/src/service/ecal_service_client_impl.cpp @@ -58,14 +58,14 @@ namespace // error message, return state and call state error_response.error_msg = error_message_; error_response.ret_state = 0; - error_response.call_state = call_state_failed; + error_response.call_state = eCAL::eCallState::failed; return error_response; } void ResponseError(const eCAL::Registration::SEntityId& entity_id_, const std::string& service_name_, const std::string& method_name_, const std::string& error_message_, const eCAL::ResponseIDCallbackT& response_callback_) { - eCAL::Logging::Log(log_level_error, "CServiceClientImpl: Response error for service: " + service_name_ + ", method: " + method_name_ + ", error: " + error_message_); + eCAL::Logging::Log(eCAL::Logging::log_level_error, "CServiceClientImpl: Response error for service: " + service_name_ + ", method: " + method_name_ + ", error: " + error_message_); response_callback_(entity_id_, CreateErrorResponse(entity_id_, service_name_, method_name_, error_message_)); } } @@ -77,7 +77,7 @@ namespace eCAL const std::string& service_name_, const ServiceMethodInformationMapT& method_information_map_, const ClientEventCallbackT& event_callback_) { #ifndef NDEBUG - eCAL::Logging::Log(log_level_debug2, "CServiceClientImpl::CreateInstance: Creating instance of CServiceClientImpl for service: " + service_name_); + eCAL::Logging::Log(eCAL::Logging::log_level_debug2, "CServiceClientImpl::CreateInstance: Creating instance of CServiceClientImpl for service: " + service_name_); #endif return std::shared_ptr(new CServiceClientImpl(service_name_, method_information_map_, event_callback_)); } @@ -88,7 +88,7 @@ namespace eCAL : m_service_name(service_name_), m_method_information_map(method_information_map_) { #ifndef NDEBUG - eCAL::Logging::Log(log_level_debug2, "CServiceClientImpl::CServiceClientImpl: Initializing service client for: " + service_name_); + eCAL::Logging::Log(eCAL::Logging::log_level_debug2, "CServiceClientImpl::CServiceClientImpl: Initializing service client for: " + service_name_); #endif // initialize method call counts @@ -111,7 +111,7 @@ namespace eCAL { g_registration_provider()->RegisterSample(GetRegistrationSample()); #ifndef NDEBUG - eCAL::Logging::Log(log_level_debug2, "CServiceClientImpl::CServiceClientImpl: Registered client with service name: " + m_service_name); + eCAL::Logging::Log(eCAL::Logging::log_level_debug2, "CServiceClientImpl::CServiceClientImpl: Registered client with service name: " + m_service_name); #endif } } @@ -120,7 +120,7 @@ namespace eCAL CServiceClientImpl::~CServiceClientImpl() { #ifndef NDEBUG - eCAL::Logging::Log(log_level_debug2, "CServiceClientImpl::~CServiceClientImpl: Destroying service client for: " + m_service_name); + eCAL::Logging::Log(eCAL::Logging::log_level_debug2, "CServiceClientImpl::~CServiceClientImpl: Destroying service client for: " + m_service_name); #endif // reset client map @@ -140,7 +140,7 @@ namespace eCAL { g_registration_provider()->UnregisterSample(GetUnregistrationSample()); #ifndef NDEBUG - eCAL::Logging::Log(log_level_debug2, "CServiceClientImpl::~CServiceClientImpl: Unregistered client for service name: " + m_service_name); + eCAL::Logging::Log(eCAL::Logging::log_level_debug2, "CServiceClientImpl::~CServiceClientImpl: Unregistered client for service name: " + m_service_name); #endif } } @@ -167,13 +167,13 @@ namespace eCAL const std::string& request_, int timeout_ms_, const ResponseIDCallbackT& response_callback_) { #ifndef NDEBUG - eCAL::Logging::Log(log_level_debug1, "CServiceClientImpl::CallWithCallback: Performing synchronous call for service: " + m_service_name + ", method: " + method_name_); + eCAL::Logging::Log(eCAL::Logging::log_level_debug1, "CServiceClientImpl::CallWithCallback: Performing synchronous call for service: " + m_service_name + ", method: " + method_name_); #endif SClient client; if (!GetClientByEntity(entity_id_, client)) { - eCAL::Logging::Log(log_level_warning, "CServiceClientImpl::CallWithCallback: Failed to find client for entity ID: " + entity_id_.entity_id); + eCAL::Logging::Log(Logging::log_level_warning, "CServiceClientImpl::CallWithCallback: Failed to find client for entity ID: " + entity_id_.entity_id); return { false, SServiceIDResponse() }; } @@ -186,14 +186,14 @@ namespace eCAL } // Handle timeout event - if (!response.first && response.second.call_state == eCallState::call_state_timeouted) + if (!response.first && response.second.call_state == eCallState::timeouted) { Registration::SServiceMethodId service_id; service_id.service_name = m_service_name; service_id.service_id = entity_id_; - NotifyEventCallback(service_id, eCAL_Client_Event::client_event_timeout); + NotifyEventCallback(service_id, eClientEvent::timeout); #ifndef NDEBUG - eCAL::Logging::Log(log_level_debug1, "CServiceClientImpl::CallWithCallback: Synchronous call for service: " + m_service_name + ", method: " + method_name_ + " timed out."); + eCAL::Logging::Log(eCAL::Logging::log_level_debug1, "CServiceClientImpl::CallWithCallback: Synchronous call for service: " + m_service_name + ", method: " + method_name_ + " timed out."); #endif } @@ -204,14 +204,14 @@ namespace eCAL bool CServiceClientImpl::CallWithCallbackAsync(const Registration::SEntityId& entity_id_, const std::string& method_name_, const std::string& request_, const ResponseIDCallbackT& response_callback_) { #ifndef NDEBUG - eCAL::Logging::Log(log_level_debug2, "CServiceClientImpl::CallWithCallbackAsync: Performing asynchronous call for service: " + m_service_name + ", method: " + method_name_); + eCAL::Logging::Log(eCAL::Logging::log_level_debug2, "CServiceClientImpl::CallWithCallbackAsync: Performing asynchronous call for service: " + m_service_name + ", method: " + method_name_); #endif // Retrieve the client SClient client; if (!GetClientByEntity(entity_id_, client)) { - eCAL::Logging::Log(log_level_warning, "CServiceClientImpl::CallWithCallbackAsync: Failed to find client for entity ID: " + entity_id_.entity_id); + eCAL::Logging::Log(Logging::log_level_warning, "CServiceClientImpl::CallWithCallbackAsync: Failed to find client for entity ID: " + entity_id_.entity_id); return false; } @@ -226,7 +226,7 @@ namespace eCAL auto request_shared_ptr = SerializeRequest(method_name_, request_); if (!request_shared_ptr) { - eCAL::Logging::Log(log_level_error, "CServiceClientImpl::CallWithCallbackAsync: Request serialization failed."); + eCAL::Logging::Log(eCAL::Logging::log_level_error, "CServiceClientImpl::CallWithCallbackAsync: Request serialization failed."); return false; } @@ -241,16 +241,16 @@ namespace eCAL { if (error) { - eCAL::Logging::Log(log_level_error, "CServiceClientImpl::CallWithCallbackAsync: Asynchronous call returned an error: " + error.ToString()); + eCAL::Logging::Log(eCAL::Logging::log_level_error, "CServiceClientImpl::CallWithCallbackAsync: Asynchronous call returned an error: " + error.ToString()); response_data->response->first = false; response_data->response->second.error_msg = error.ToString(); - response_data->response->second.call_state = eCallState::call_state_failed; + response_data->response->second.call_state = eCallState::failed; response_data->response->second.ret_state = 0; } else { #ifndef NDEBUG - eCAL::Logging::Log(log_level_debug1, "CServiceClientImpl::CallWithCallbackAsync: Asynchronous call succeded"); + eCAL::Logging::Log(eCAL::Logging::log_level_debug1, "CServiceClientImpl::CallWithCallbackAsync: Asynchronous call succeded"); #endif response_data->response->first = true; response_data->response->second = DeserializedResponse(client, *response_); @@ -281,7 +281,7 @@ namespace eCAL auto iter = m_client_session_map.find(entity_id_); bool state((iter != m_client_session_map.end() && iter->second.connected)); #ifndef NDEBUG - eCAL::Logging::Log(log_level_debug2, "CServiceClientImpl::IsConnected: Returned: " + std::to_string(state)); + eCAL::Logging::Log(eCAL::Logging::log_level_debug2, "CServiceClientImpl::IsConnected: Returned: " + std::to_string(state)); #endif return state; } @@ -325,7 +325,7 @@ namespace eCAL Registration::Sample CServiceClientImpl::GetRegistration() { #ifndef NDEBUG - Logging::Log(log_level_debug2, "CServiceClientImpl:::GetRegistration: Generating registration sample for: " + m_service_name); + Logging::Log(eCAL::Logging::log_level_debug2, "CServiceClientImpl:::GetRegistration: Generating registration sample for: " + m_service_name); #endif UpdateConnectionStates(); return GetRegistrationSample(); @@ -456,7 +456,7 @@ namespace eCAL { response_data->response->first = false; response_data->response->second.error_msg = "Timeout"; - response_data->response->second.call_state = eCallState::call_state_timeouted; + response_data->response->second.call_state = eCallState::timeouted; } } else @@ -492,13 +492,13 @@ namespace eCAL if (!client_data.connected && state == eCAL::service::State::CONNECTED) { client_data.connected = true; - NotifyEventCallback(service_id, client_event_connected); + NotifyEventCallback(service_id, eClientEvent::connected); ++it; } else if (client_data.connected && state == eCAL::service::State::FAILED) { client_data.connected = false; - NotifyEventCallback(service_id, client_event_disconnected); + NotifyEventCallback(service_id, eClientEvent::disconnected); it = m_client_session_map.erase(it); } else @@ -515,10 +515,10 @@ namespace eCAL } - void CServiceClientImpl::NotifyEventCallback(const Registration::SServiceMethodId& service_id_, eCAL_Client_Event event_type_) + void CServiceClientImpl::NotifyEventCallback(const Registration::SServiceMethodId& service_id_, eClientEvent event_type_) { #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceClientImpl::NotifyEventCallback: Notifying event callback for: " + m_service_name + " Event Type: " + std::to_string(event_type_)); + Logging::Log(Logging::log_level_debug1, "CServiceClientImpl::NotifyEventCallback: Notifying event callback for: " + m_service_name + " Event Type: " + to_string(event_type_)); #endif const std::lock_guard lock(m_event_callback_mutex); @@ -542,7 +542,7 @@ namespace eCAL data->response->second.service_method_id.service_name = client_.service_attr.sname; data->response->second.service_method_id.method_name = method_name_; - data->response->second.call_state = eCallState::call_state_none; + data->response->second.call_state = eCallState::none; return data; } @@ -557,7 +557,7 @@ namespace eCAL { response_data_->response->first = false; response_data_->response->second.error_msg = error.ToString(); - response_data_->response->second.call_state = eCallState::call_state_failed; + response_data_->response->second.call_state = eCallState::failed; response_data_->response->second.ret_state = 0; } else @@ -595,10 +595,10 @@ namespace eCAL switch (response_header.state) { case eCAL::Service::eMethodCallState::executed: - service_reponse.call_state = call_state_executed; + service_reponse.call_state = eCallState::executed; break; case eCAL::Service::eMethodCallState::failed: - service_reponse.call_state = call_state_failed; + service_reponse.call_state = eCallState::failed; break; default: break; @@ -610,7 +610,7 @@ namespace eCAL { service_reponse.error_msg = "Could not parse server response"; service_reponse.ret_state = 0; - service_reponse.call_state = eCallState::call_state_failed; + service_reponse.call_state = eCallState::failed; service_reponse.response = ""; } diff --git a/ecal/core/src/service/ecal_service_client_impl.h b/ecal/core/src/service/ecal_service_client_impl.h index afb3421294..fbccaba366 100644 --- a/ecal/core/src/service/ecal_service_client_impl.h +++ b/ecal/core/src/service/ecal_service_client_impl.h @@ -118,7 +118,7 @@ namespace eCAL void IncrementMethodCallCount(const std::string& method_name_); // Notify specific event callback - void NotifyEventCallback(const Registration::SServiceMethodId& service_id_, eCAL_Client_Event event_type_); + void NotifyEventCallback(const Registration::SServiceMethodId& service_id_, eClientEvent event_type_); // SResponseData struct for handling response callbacks struct SResponseData diff --git a/ecal/core/src/service/ecal_service_client_v5.cpp b/ecal/core/src/service/ecal_service_client_v5.cpp index dd8021bedb..d9e143983f 100644 --- a/ecal/core/src/service/ecal_service_client_v5.cpp +++ b/ecal/core/src/service/ecal_service_client_v5.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,13 +108,13 @@ namespace eCAL return m_service_client_impl->RemResponseCallback(); } - bool CServiceClient::AddEventCallback(eCAL_Client_Event type_, ClientEventCallbackT callback_) + bool CServiceClient::AddEventCallback(eClientEvent type_, ClientEventCallbackT callback_) { if (m_service_client_impl == nullptr) return false; return m_service_client_impl->AddEventCallback(type_, callback_); } - bool CServiceClient::RemEventCallback(eCAL_Client_Event type_) + bool CServiceClient::RemEventCallback(eClientEvent type_) { if (m_service_client_impl == nullptr) return false; return m_service_client_impl->RemEventCallback(type_); diff --git a/ecal/core/src/service/ecal_service_client_v5_impl.cpp b/ecal/core/src/service/ecal_service_client_v5_impl.cpp index 0037eaefbd..5005509cc3 100644 --- a/ecal/core/src/service/ecal_service_client_v5_impl.cpp +++ b/ecal/core/src/service/ecal_service_client_v5_impl.cpp @@ -55,26 +55,26 @@ namespace eCAL CServiceClientImpl::CServiceClientImpl() : m_service_client_impl(nullptr) { - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Initializing default service client implementation."); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Initializing default service client implementation."); } CServiceClientImpl::CServiceClientImpl(const std::string& service_name_) : m_service_client_impl(nullptr) { - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Initializing service client with name: " + service_name_); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Initializing service client with name: " + service_name_); Create(service_name_); } CServiceClientImpl::CServiceClientImpl(const std::string& service_name_, const ServiceMethodInformationMapT& method_information_map_) : m_service_client_impl(nullptr) { - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Initializing service client with name: " + service_name_); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Initializing service client with name: " + service_name_); Create(service_name_, method_information_map_); } CServiceClientImpl::~CServiceClientImpl() { - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Destroying service client implementation."); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Destroying service client implementation."); Destroy(); } @@ -87,16 +87,16 @@ namespace eCAL { if (m_service_client_impl != nullptr) { - Logging::Log(log_level_warning, "v5::CServiceClientImpl: Service client already created: " + service_name_); + Logging::Log(Logging::log_level_warning, "v5::CServiceClientImpl: Service client already created: " + service_name_); return false; } - Logging::Log(log_level_debug1, "v5::CServiceClientImpl: Creating service client with name: " + service_name_); + Logging::Log(Logging::log_level_debug1, "v5::CServiceClientImpl: Creating service client with name: " + service_name_); // Define the event callback to pass to CServiceClient v6::ClientEventCallbackT event_callback = [this](const Registration::SServiceMethodId& service_id_, const v6::SClientEventCallbackData& data_) { - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Event callback triggered for event type: " + std::to_string(data_.type)); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Event callback triggered for event type: " + to_string(data_.type)); // Lock the mutex to safely access m_event_callbacks std::lock_guard lock(m_event_callback_map_mutex); @@ -105,7 +105,7 @@ namespace eCAL const auto& callback = m_event_callback_map.find(data_.type); if (callback != m_event_callback_map.end()) { - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Executing event callback for event type: " + std::to_string(data_.type)); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Executing event callback for event type: " + to_string(data_.type)); // Call the user's callback SClientEventCallbackData event_data; event_data.type = data_.type; @@ -125,7 +125,7 @@ namespace eCAL event_callback ); - Logging::Log(log_level_debug1, "v5::CServiceClientImpl: Service client created successfully with name: " + service_name_); + Logging::Log(Logging::log_level_debug1, "v5::CServiceClientImpl: Service client created successfully with name: " + service_name_); return true; } @@ -133,11 +133,11 @@ namespace eCAL { if (m_service_client_impl == nullptr) { - Logging::Log(log_level_warning, "v5::CServiceClientImpl: Service client not initialized, cannot destroy."); + Logging::Log(Logging::log_level_warning, "v5::CServiceClientImpl: Service client not initialized, cannot destroy."); return false; } - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Destroying service client implementation."); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Destroying service client implementation."); // Reset the service client implementation m_service_client_impl.reset(); @@ -147,7 +147,7 @@ namespace eCAL m_event_callback_map.clear(); m_host_name.clear(); - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Service client destroyed successfully."); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Service client destroyed successfully."); return true; } @@ -155,11 +155,11 @@ namespace eCAL { if (m_service_client_impl == nullptr) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot set host name."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot set host name."); return false; } - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Setting host name to: " + host_name_); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Setting host name to: " + host_name_); // Store the host name filter m_host_name = host_name_; @@ -171,23 +171,23 @@ namespace eCAL { if (m_service_client_impl == nullptr) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot make a call."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot make a call."); return false; } if (!m_response_callback) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Response callback not set, cannot make a call."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Response callback not set, cannot make a call."); return false; } - Logging::Log(log_level_debug1, "v5::CServiceClientImpl: Making a synchronous call to method: " + method_name_); + Logging::Log(Logging::log_level_debug1, "v5::CServiceClientImpl: Making a synchronous call to method: " + method_name_); // Wrap the response callback to filter by host name if necessary const ResponseIDCallbackT callback = [this](const Registration::SEntityId& /*entity_id_*/, const struct SServiceIDResponse& service_response_) { if (m_host_name.empty() || service_response_.service_method_id.service_id.host_name == m_host_name) { - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Response received for method call."); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Response received for method call."); // Convert SServiceResponse to SServiceIDResponse const SServiceResponse service_response = ConvertToServiceResponse(service_response_); @@ -205,16 +205,16 @@ namespace eCAL { if (m_service_client_impl == nullptr) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot make a call."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot make a call."); return false; } if (!service_response_vec_) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Response vector is null, cannot make a call."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Response vector is null, cannot make a call."); return false; } - Logging::Log(log_level_debug1, "v5::CServiceClientImpl: Making a synchronous call with response collection to method: " + method_name_); + Logging::Log(Logging::log_level_debug1, "v5::CServiceClientImpl: Making a synchronous call with response collection to method: " + method_name_); // Call the method using the new API ServiceIDResponseVecT service_id_responses; @@ -231,7 +231,7 @@ namespace eCAL } } - Logging::Log(log_level_debug1, "v5::CServiceClientImpl: Call completed with success: " + std::to_string(success)); + Logging::Log(Logging::log_level_debug1, "v5::CServiceClientImpl: Call completed with success: " + std::to_string(success)); return success; } @@ -239,23 +239,23 @@ namespace eCAL { if (m_service_client_impl == nullptr) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot make an async call."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot make an async call."); return false; } if (!m_response_callback) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Response callback not set, cannot make an async call."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Response callback not set, cannot make an async call."); return false; } - Logging::Log(log_level_debug1, "v5::CServiceClientImpl: Making an asynchronous call to method: " + method_name_); + Logging::Log(Logging::log_level_debug1, "v5::CServiceClientImpl: Making an asynchronous call to method: " + method_name_); // Wrap the response callback to filter by host name if necessary const ResponseIDCallbackT callback = [this](const Registration::SEntityId& /*entity_id_*/, const struct SServiceIDResponse& service_response_) { if (m_host_name.empty() || service_response_.service_method_id.service_id.host_name == m_host_name) { - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Response received for async method call."); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Response received for async method call."); // Call the stored response callback m_response_callback(ConvertToServiceResponse(service_response_)); } @@ -263,7 +263,7 @@ namespace eCAL // Call the method asynchronously using the new API const bool success = m_service_client_impl->CallWithCallbackAsync(method_name_, request_, callback); - Logging::Log(log_level_debug1, "v5::CServiceClientImpl: Async call to method: " + method_name_ + " completed with success: " + std::to_string(success)); + Logging::Log(Logging::log_level_debug1, "v5::CServiceClientImpl: Async call to method: " + method_name_ + " completed with success: " + std::to_string(success)); return success; } @@ -271,11 +271,11 @@ namespace eCAL { if (m_service_client_impl == nullptr) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot add response callback."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot add response callback."); return false; } - Logging::Log(log_level_debug1, "v5::CServiceClientImpl: Adding response callback."); + Logging::Log(Logging::log_level_debug1, "v5::CServiceClientImpl: Adding response callback."); { const std::lock_guard lock(m_response_callback_mutex); @@ -289,11 +289,11 @@ namespace eCAL { if (m_service_client_impl == nullptr) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot remove response callback."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot remove response callback."); return false; } - Logging::Log(log_level_debug1, "v5::CServiceClientImpl: Removing response callback."); + Logging::Log(Logging::log_level_debug1, "v5::CServiceClientImpl: Removing response callback."); { const std::lock_guard lock(m_response_callback_mutex); @@ -303,15 +303,15 @@ namespace eCAL return true; } - bool CServiceClientImpl::AddEventCallback(eCAL_Client_Event type_, ClientEventCallbackT callback_) + bool CServiceClientImpl::AddEventCallback(eClientEvent type_, ClientEventCallbackT callback_) { if (m_service_client_impl == nullptr) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot add event callback."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot add event callback."); return false; } - Logging::Log(log_level_debug1, "v5::CServiceClientImpl: Adding event callback for event type: " + std::to_string(type_)); + Logging::Log(Logging::log_level_debug1, "v5::CServiceClientImpl: Adding event callback for event type: " + to_string(type_)); { const std::lock_guard lock(m_event_callback_map_mutex); @@ -321,15 +321,15 @@ namespace eCAL return true; } - bool CServiceClientImpl::RemEventCallback(eCAL_Client_Event type_) + bool CServiceClientImpl::RemEventCallback(eClientEvent type_) { if (m_service_client_impl == nullptr) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot remove event callback."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot remove event callback."); return false; } - Logging::Log(log_level_debug1, "v5::CServiceClientImpl: Removing event callback for event type: " + std::to_string(type_)); + Logging::Log(Logging::log_level_debug1, "v5::CServiceClientImpl: Removing event callback for event type: " + to_string(type_)); { const std::lock_guard lock(m_event_callback_map_mutex); @@ -343,12 +343,12 @@ namespace eCAL { if (m_service_client_impl == nullptr) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot get service name."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot get service name."); return ""; } std::string service_name = m_service_client_impl->GetServiceName(); - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Retrieved service name: " + service_name); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Retrieved service name: " + service_name); return service_name; } @@ -356,12 +356,12 @@ namespace eCAL { if (m_service_client_impl == nullptr) { - Logging::Log(log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot check connection status."); + Logging::Log(Logging::log_level_error, "v5::CServiceClientImpl: Service client not initialized, cannot check connection status."); return false; } bool connected = m_service_client_impl->IsConnected(); - Logging::Log(log_level_debug2, "v5::CServiceClientImpl: Connection status: " + std::string(connected ? "connected" : "disconnected")); + Logging::Log(Logging::log_level_debug2, "v5::CServiceClientImpl: Connection status: " + std::string(connected ? "connected" : "disconnected")); return connected; } } diff --git a/ecal/core/src/service/ecal_service_client_v5_impl.h b/ecal/core/src/service/ecal_service_client_v5_impl.h index 63b9bb3e08..4f0267c9e1 100644 --- a/ecal/core/src/service/ecal_service_client_v5_impl.h +++ b/ecal/core/src/service/ecal_service_client_v5_impl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,10 +83,10 @@ namespace eCAL bool RemResponseCallback(); // Registers a callback function for a specific client event. - bool AddEventCallback(eCAL_Client_Event type_, ClientEventCallbackT callback_); + bool AddEventCallback(eClientEvent type_, ClientEventCallbackT callback_); // Removes the registered callback function for a specific client event. - bool RemEventCallback(eCAL_Client_Event type_); + bool RemEventCallback(eClientEvent type_); // Retrieves the name of the associated service. std::string GetServiceName(); @@ -109,7 +109,7 @@ namespace eCAL // Mutex and map for managing event callbacks std::mutex m_event_callback_map_mutex; - std::map m_event_callback_map; + std::map m_event_callback_map; // Mutex and callback for managing server responses std::mutex m_response_callback_mutex; diff --git a/ecal/core/src/service/ecal_service_server_impl.cpp b/ecal/core/src/service/ecal_service_server_impl.cpp index 05f19b8b54..e50335ade5 100644 --- a/ecal/core/src/service/ecal_service_server_impl.cpp +++ b/ecal/core/src/service/ecal_service_server_impl.cpp @@ -38,7 +38,7 @@ namespace eCAL const std::string& service_name_, const ServerEventCallbackT& event_callback_) { #ifndef NDEBUG - Logging::Log(log_level_debug2, "CServiceServerImpl::CreateInstance: Creating instance of CServiceServerImpl for service: " + service_name_); + Logging::Log(Logging::log_level_debug2, "CServiceServerImpl::CreateInstance: Creating instance of CServiceServerImpl for service: " + service_name_); #endif auto instance = std::shared_ptr(new CServiceServerImpl(service_name_, event_callback_)); if (instance != nullptr) @@ -53,7 +53,7 @@ namespace eCAL : m_created(false), m_service_name(service_name_), m_event_callback(event_callback_) { #ifndef NDEBUG - Logging::Log(log_level_debug2, "CServiceServerImpl::CServiceServerImpl: Initializing service server for: " + m_service_name); + Logging::Log(Logging::log_level_debug2, "CServiceServerImpl::CServiceServerImpl: Initializing service server for: " + m_service_name); #endif } @@ -61,7 +61,7 @@ namespace eCAL CServiceServerImpl::~CServiceServerImpl() { #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceServerImpl::~CServiceServerImpl: Destroying service server for: " + m_service_name); + Logging::Log(Logging::log_level_debug1, "CServiceServerImpl::~CServiceServerImpl: Destroying service server for: " + m_service_name); #endif Stop(); } @@ -69,14 +69,14 @@ namespace eCAL bool CServiceServerImpl::SetMethodCallback(const std::string& method_, const SServiceMethodInformation& method_info_, const MethodInfoCallbackT& callback_) { #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceServerImpl::SetMethodCallback: Adding method callback for method: " + method_); + Logging::Log(Logging::log_level_debug1, "CServiceServerImpl::SetMethodCallback: Adding method callback for method: " + method_); #endif const std::lock_guard lock(m_method_map_mutex); auto iter = m_method_map.find(method_); if (iter != m_method_map.end()) { - Logging::Log(log_level_warning, "CServiceServerImpl::SetMethodCallback: Method already exists, updating attributes and callback: " + method_); + Logging::Log(Logging::log_level_warning, "CServiceServerImpl::SetMethodCallback: Method already exists, updating attributes and callback: " + method_); #if 0 // this is how it should look like if we do not use the old type and descriptor fields // update data type and callback @@ -116,7 +116,7 @@ namespace eCAL else { #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceServerImpl::SetMethodCallback: Registering new method: " + method_); + Logging::Log(Logging::log_level_debug1, "CServiceServerImpl::SetMethodCallback: Registering new method: " + method_); #endif SMethod method; // method name @@ -167,7 +167,7 @@ namespace eCAL bool CServiceServerImpl::RemoveMethodCallback(const std::string& method_) { #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceServerImpl::RemoveMethodCallback: Removing method callback for method: " + method_); + Logging::Log(Logging::log_level_debug1, "CServiceServerImpl::RemoveMethodCallback: Removing method callback for method: " + method_); #endif const std::lock_guard lock(m_method_map_mutex); @@ -176,12 +176,12 @@ namespace eCAL { m_method_map.erase(iter); #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceServerImpl::RemoveMethodCallback: Successfully removed method callback: " + method_); + Logging::Log(Logging::log_level_debug1, "CServiceServerImpl::RemoveMethodCallback: Successfully removed method callback: " + method_); #endif return true; } - Logging::Log(log_level_warning, "CServiceServerImpl::RemoveMethodCallback: Attempt to remove non-existent method callback: " + method_); + Logging::Log(Logging::log_level_warning, "CServiceServerImpl::RemoveMethodCallback: Attempt to remove non-existent method callback: " + method_); return false; } @@ -190,14 +190,14 @@ namespace eCAL if (!m_created) { #ifndef NDEBUG - Logging::Log(log_level_debug2, "CServiceServerImpl: Service is not created; cannot check connection state for: " + m_service_name); + Logging::Log(Logging::log_level_debug2, "CServiceServerImpl: Service is not created; cannot check connection state for: " + m_service_name); #endif return false; } bool connected = m_tcp_server && m_tcp_server->is_connected(); #ifndef NDEBUG - Logging::Log(log_level_debug2, "CServiceServerImpl: Connection state for service " + m_service_name + ": " + (connected ? "connected" : "disconnected")); + Logging::Log(Logging::log_level_debug2, "CServiceServerImpl: Connection state for service " + m_service_name + ": " + (connected ? "connected" : "disconnected")); #endif return connected; } @@ -210,7 +210,7 @@ namespace eCAL Registration::Sample CServiceServerImpl::GetRegistration() { #ifndef NDEBUG - Logging::Log(log_level_debug2, "CServiceServerImpl:::GetRegistration: Generating registration sample for: " + m_service_name); + Logging::Log(Logging::log_level_debug2, "CServiceServerImpl:::GetRegistration: Generating registration sample for: " + m_service_name); #endif return GetRegistrationSample(); } @@ -236,12 +236,12 @@ namespace eCAL { if (m_created) { - Logging::Log(log_level_warning, "CServiceServerImpl: Service is already started: " + m_service_name); + Logging::Log(Logging::log_level_warning, "CServiceServerImpl: Service is already started: " + m_service_name); return; } #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceServerImpl: Starting service server for: " + m_service_name); + Logging::Log(Logging::log_level_debug1, "CServiceServerImpl: Starting service server for: " + m_service_name); #endif // Create service ID @@ -251,7 +251,7 @@ namespace eCAL auto server_manager = eCAL::service::ServiceManager::instance()->get_server_manager(); if (!server_manager || server_manager->is_stopped()) { - Logging::Log(log_level_error, "CServiceServerImpl: Failed to start service: Global server manager is unavailable or stopped for: " + m_service_name); + Logging::Log(Logging::log_level_error, "CServiceServerImpl: Failed to start service: Global server manager is unavailable or stopped for: " + m_service_name); return; } @@ -265,8 +265,8 @@ namespace eCAL service_id.service_name = me->m_service_name; service_id.service_id.entity_id = me->m_service_id; me->NotifyEventCallback(service_id, event == eCAL::service::ServerEventType::Connected - ? eCAL_Server_Event::server_event_connected - : eCAL_Server_Event::server_event_disconnected, message); + ? eServerEvent::connected + : eServerEvent::disconnected, message); } }; @@ -283,7 +283,7 @@ namespace eCAL if (!m_tcp_server) { - Logging::Log(log_level_error, "CServiceServerImpl: Failed to create TCP server for service: " + m_service_name); + Logging::Log(Logging::log_level_error, "CServiceServerImpl: Failed to create TCP server for service: " + m_service_name); return; } @@ -293,7 +293,7 @@ namespace eCAL m_created = true; #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceServerImpl: Service started successfully: " + m_service_name); + Logging::Log(Logging::log_level_debug1, "CServiceServerImpl: Service started successfully: " + m_service_name); #endif } @@ -301,12 +301,12 @@ namespace eCAL { if (!m_created) { - Logging::Log(log_level_warning, "CServiceServerImpl::Stop: Service is not running; cannot stop: " + m_service_name); + Logging::Log(Logging::log_level_warning, "CServiceServerImpl::Stop: Service is not running; cannot stop: " + m_service_name); return; } #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceServerImpl::Stop: Stopping service server for: " + m_service_name); + Logging::Log(Logging::log_level_debug1, "CServiceServerImpl::Stop: Stopping service server for: " + m_service_name); #endif // Stop TCP server @@ -314,7 +314,7 @@ namespace eCAL { m_tcp_server->stop(); #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceServerImpl::Stop: TCP server stopped for: " + m_service_name); + Logging::Log(Logging::log_level_debug1, "CServiceServerImpl::Stop: TCP server stopped for: " + m_service_name); #endif } m_tcp_server.reset(); @@ -337,7 +337,7 @@ namespace eCAL m_created = false; #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceServerImpl::Stop: Service stopped successfully: " + m_service_name); + Logging::Log(Logging::log_level_debug1, "CServiceServerImpl::Stop: Service stopped successfully: " + m_service_name); #endif } @@ -410,7 +410,7 @@ namespace eCAL int CServiceServerImpl::RequestCallback(const std::string& request_pb_, std::string& response_pb_) { #ifndef NDEBUG - Logging::Log(log_level_debug2, "CServiceServerImpl::RequestCallback: Processing request callback for: " + m_service_name); + Logging::Log(Logging::log_level_debug2, "CServiceServerImpl::RequestCallback: Processing request callback for: " + m_service_name); #endif // prepare response @@ -424,7 +424,7 @@ namespace eCAL Service::Request request; if (!DeserializeFromBuffer(request_pb_.c_str(), request_pb_.size(), request)) { - Logging::Log(log_level_error, m_service_name + "::CServiceServerImpl::RequestCallback: Failed to parse request message"); + Logging::Log(Logging::log_level_error, m_service_name + "::CServiceServerImpl::RequestCallback: Failed to parse request message"); response_header.state = Service::eMethodCallState::failed; const std::string emsg = "Service '" + m_service_name + "' request message could not be parsed."; @@ -493,10 +493,10 @@ namespace eCAL return 0; } - void CServiceServerImpl::NotifyEventCallback(const Registration::SServiceMethodId& service_id_, eCAL_Server_Event event_type_, const std::string& /*message_*/) + void CServiceServerImpl::NotifyEventCallback(const Registration::SServiceMethodId& service_id_, eServerEvent event_type_, const std::string& /*message_*/) { #ifndef NDEBUG - Logging::Log(log_level_debug1, "CServiceServerImpl::NotifyEventCallback: Notifying event callback for: " + m_service_name + " Event Type: " + std::to_string(event_type_)); + Logging::Log(Logging::log_level_debug1, "CServiceServerImpl::NotifyEventCallback: Notifying event callback for: " + m_service_name + " Event Type: " + to_string(event_type_)); #endif const std::lock_guard lock_cb(m_event_callback_mutex); diff --git a/ecal/core/src/service/ecal_service_server_impl.h b/ecal/core/src/service/ecal_service_server_impl.h index b3e57367d9..9a044360a3 100644 --- a/ecal/core/src/service/ecal_service_server_impl.h +++ b/ecal/core/src/service/ecal_service_server_impl.h @@ -91,7 +91,7 @@ namespace eCAL // Request and event callback methods int RequestCallback(const std::string& request_pb_, std::string& response_pb_); - void NotifyEventCallback(const Registration::SServiceMethodId& service_id_, eCAL_Server_Event event_type_, const std::string& message_); + void NotifyEventCallback(const Registration::SServiceMethodId& service_id_, eServerEvent event_type_, const std::string& message_); // Server version (incremented for protocol or functionality changes) static constexpr int m_server_version = 1; diff --git a/ecal/core/src/service/ecal_service_server_v5.cpp b/ecal/core/src/service/ecal_service_server_v5.cpp index 705a0a09de..10bdd76b1a 100644 --- a/ecal/core/src/service/ecal_service_server_v5.cpp +++ b/ecal/core/src/service/ecal_service_server_v5.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,13 +81,13 @@ namespace eCAL return m_service_server_impl->RemMethodCallback(method_); } - bool CServiceServer::AddEventCallback(eCAL_Server_Event type_, ServerEventCallbackT callback_) + bool CServiceServer::AddEventCallback(eServerEvent type_, ServerEventCallbackT callback_) { if (m_service_server_impl == nullptr) return false; return m_service_server_impl->AddEventCallback(type_, callback_); } - bool CServiceServer::RemEventCallback(eCAL_Server_Event type_) + bool CServiceServer::RemEventCallback(eServerEvent type_) { if (m_service_server_impl == nullptr) return false; return m_service_server_impl->RemEventCallback(type_); diff --git a/ecal/core/src/service/ecal_service_server_v5_impl.cpp b/ecal/core/src/service/ecal_service_server_v5_impl.cpp index f2b5279b7c..e465a81b06 100644 --- a/ecal/core/src/service/ecal_service_server_v5_impl.cpp +++ b/ecal/core/src/service/ecal_service_server_v5_impl.cpp @@ -32,19 +32,19 @@ namespace eCAL CServiceServerImpl::CServiceServerImpl() : m_service_server_impl(nullptr) { - Logging::Log(log_level_debug2, "v5::CServiceServerImpl: Initializing default service server implementation."); + Logging::Log(Logging::log_level_debug2, "v5::CServiceServerImpl: Initializing default service server implementation."); } CServiceServerImpl::CServiceServerImpl(const std::string& service_name_) : m_service_server_impl(nullptr) { - Logging::Log(log_level_debug2, "v5::CServiceServerImpl: Initializing service server with name: " + service_name_); + Logging::Log(Logging::log_level_debug2, "v5::CServiceServerImpl: Initializing service server with name: " + service_name_); Create(service_name_); } CServiceServerImpl::~CServiceServerImpl() { - Logging::Log(log_level_debug2, "v5::CServiceServerImpl: Destroying service server implementation."); + Logging::Log(Logging::log_level_debug2, "v5::CServiceServerImpl: Destroying service server implementation."); Destroy(); } @@ -52,14 +52,14 @@ namespace eCAL { if (m_service_server_impl) { - Logging::Log(log_level_warning, "v5::CServiceServerImpl: Service server already created: " + service_name_); + Logging::Log(Logging::log_level_warning, "v5::CServiceServerImpl: Service server already created: " + service_name_); return false; } // Define the event callback to pass to CServiceClient v6::ServerEventCallbackT event_callback = [this](const Registration::SServiceMethodId& service_id_, const v6::SServerEventCallbackData& data_) { - Logging::Log(log_level_debug2, "v5::CServiceServerImpl: Event callback triggered for event type: " + std::to_string(data_.type)); + Logging::Log(Logging::log_level_debug2, "v5::CServiceServerImpl: Event callback triggered for event type: " + to_string(data_.type)); // Lock the mutex to safely access m_event_callbacks std::lock_guard lock(m_event_callback_map_mutex); @@ -68,7 +68,7 @@ namespace eCAL const auto& callback = m_event_callback_map.find(data_.type); if (callback != m_event_callback_map.end()) { - Logging::Log(log_level_debug2, "v5::CServiceServerImpl: Executing event callback for event type: " + std::to_string(data_.type)); + Logging::Log(Logging::log_level_debug2, "v5::CServiceServerImpl: Executing event callback for event type: " + to_string(data_.type)); // Call the user's callback SServerEventCallbackData event_data; event_data.type = data_.type; @@ -78,7 +78,7 @@ namespace eCAL }; m_service_server_impl = std::make_shared(service_name_, event_callback); - Logging::Log(log_level_debug1, "v5::CServiceServerImpl: Service server created with name: " + service_name_); + Logging::Log(Logging::log_level_debug1, "v5::CServiceServerImpl: Service server created with name: " + service_name_); return true; } @@ -86,22 +86,22 @@ namespace eCAL { if (!m_service_server_impl) { - Logging::Log(log_level_warning, "v5::CServiceServerImpl: Service server not initialized, cannot destroy."); + Logging::Log(Logging::log_level_warning, "v5::CServiceServerImpl: Service server not initialized, cannot destroy."); return false; } m_service_server_impl.reset(); - Logging::Log(log_level_debug2, "v5::CServiceServerImpl: Service server destroyed."); + Logging::Log(Logging::log_level_debug2, "v5::CServiceServerImpl: Service server destroyed."); return true; } bool CServiceServerImpl::AddDescription(const std::string& method_, const std::string& req_type_, const std::string& req_desc_, const std::string& resp_type_, const std::string& resp_desc_) { - Logging::Log(log_level_debug1, "v5::CServiceServerImpl: Adding description for method: " + method_); + Logging::Log(Logging::log_level_debug1, "v5::CServiceServerImpl: Adding description for method: " + method_); if (!m_service_server_impl) { - Logging::Log(log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot add description."); + Logging::Log(Logging::log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot add description."); return false; } @@ -116,11 +116,11 @@ namespace eCAL bool CServiceServerImpl::AddMethodCallback(const std::string& method_, const std::string& req_type_, const std::string& resp_type_, const MethodCallbackT& callback_) { - Logging::Log(log_level_debug2, "v5::CServiceServerImpl: Adding method callback for method: " + method_); + Logging::Log(Logging::log_level_debug2, "v5::CServiceServerImpl: Adding method callback for method: " + method_); if (!m_service_server_impl) { - Logging::Log(log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot add method callback."); + Logging::Log(Logging::log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot add method callback."); return false; } @@ -142,25 +142,25 @@ namespace eCAL bool CServiceServerImpl::RemMethodCallback(const std::string& method_) { - Logging::Log(log_level_debug2, "v5::CServiceServerImpl: Removing method callback for method: " + method_); + Logging::Log(Logging::log_level_debug2, "v5::CServiceServerImpl: Removing method callback for method: " + method_); if (!m_service_server_impl) { - Logging::Log(log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot remove method callback."); + Logging::Log(Logging::log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot remove method callback."); return false; } return m_service_server_impl->RemoveMethodCallback(method_); } - bool CServiceServerImpl::AddEventCallback(eCAL_Server_Event type_, ServerEventCallbackT callback_) + bool CServiceServerImpl::AddEventCallback(eServerEvent type_, ServerEventCallbackT callback_) { if (!m_service_server_impl) { - Logging::Log(log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot add event callback."); + Logging::Log(Logging::log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot add event callback."); return false; } - Logging::Log(log_level_debug2, "v5::CServiceServerImpl: Adding event callback for event type: " + std::to_string(type_)); + Logging::Log(Logging::log_level_debug2, "v5::CServiceServerImpl: Adding event callback for event type: " + to_string(type_)); { const std::lock_guard lock(m_event_callback_map_mutex); @@ -170,14 +170,14 @@ namespace eCAL return true; } - bool CServiceServerImpl::RemEventCallback(eCAL_Server_Event type_) + bool CServiceServerImpl::RemEventCallback(eServerEvent type_) { if (!m_service_server_impl) { - Logging::Log(log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot remove event callback."); + Logging::Log(Logging::log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot remove event callback."); return false; } - Logging::Log(log_level_debug2, "v5::CServiceServerImpl: Removing event callback for event type: " + std::to_string(type_)); + Logging::Log(Logging::log_level_debug2, "v5::CServiceServerImpl: Removing event callback for event type: " + to_string(type_)); { const std::lock_guard lock(m_event_callback_map_mutex); @@ -191,7 +191,7 @@ namespace eCAL { if (!m_service_server_impl) { - Logging::Log(log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot get service name."); + Logging::Log(Logging::log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot get service name."); return ""; } @@ -202,7 +202,7 @@ namespace eCAL { if (!m_service_server_impl) { - Logging::Log(log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot check connection status."); + Logging::Log(Logging::log_level_error, "v5::CServiceServerImpl: Service server not initialized, cannot check connection status."); return false; } diff --git a/ecal/core/src/service/ecal_service_server_v5_impl.h b/ecal/core/src/service/ecal_service_server_v5_impl.h index 0df254af17..313e076756 100644 --- a/ecal/core/src/service/ecal_service_server_v5_impl.h +++ b/ecal/core/src/service/ecal_service_server_v5_impl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,8 +50,8 @@ namespace eCAL bool AddMethodCallback(const std::string& method_, const std::string& req_type_, const std::string& resp_type_, const MethodCallbackT& callback_); bool RemMethodCallback(const std::string& method_); - bool AddEventCallback(eCAL_Server_Event type_, ServerEventCallbackT callback_); - bool RemEventCallback(eCAL_Server_Event type_); + bool AddEventCallback(eServerEvent type_, ServerEventCallbackT callback_); + bool RemEventCallback(eServerEvent type_); std::string GetServiceName(); bool IsConnected(); @@ -68,7 +68,7 @@ namespace eCAL // Mutex and map for managing event callbacks std::mutex m_event_callback_map_mutex; - std::map m_event_callback_map; + std::map m_event_callback_map; }; } } diff --git a/ecal/core/src/service/ecal_service_singleton_manager.cpp b/ecal/core/src/service/ecal_service_singleton_manager.cpp index fa8a3b7fd9..72fe9f10ad 100644 --- a/ecal/core/src/service/ecal_service_singleton_manager.cpp +++ b/ecal/core/src/service/ecal_service_singleton_manager.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,22 +37,22 @@ namespace eCAL switch (log_level) { case LogLevel::DebugVerbose: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_debug4, "[" + node_name + "] " + message); + eCAL::Logging::Log(eCAL::Logging::log_level_debug4, "[" + node_name + "] " + message); break; case LogLevel::Debug: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_debug1, "[" + node_name + "] " + message); + eCAL::Logging::Log(eCAL::Logging::log_level_debug1, "[" + node_name + "] " + message); break; case LogLevel::Info: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_debug1, "[" + node_name + "] " + message); + eCAL::Logging::Log(eCAL::Logging::log_level_debug1, "[" + node_name + "] " + message); break; case LogLevel::Warning: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_warning, "[" + node_name + "] " + message); + eCAL::Logging::Log(eCAL::Logging::log_level_warning, "[" + node_name + "] " + message); break; case LogLevel::Error: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_error, "[" + node_name + "] " + message); + eCAL::Logging::Log(eCAL::Logging::log_level_error, "[" + node_name + "] " + message); break; case LogLevel::Fatal: - eCAL::Logging::Log(eCAL_Logging_eLogLevel::log_level_fatal, "[" + node_name + "] " + message); + eCAL::Logging::Log(eCAL::Logging::log_level_fatal, "[" + node_name + "] " + message); break; default: break; diff --git a/ecal/core/src/time/ecal_timegate.cpp b/ecal/core/src/time/ecal_timegate.cpp index 6e2b528a8a..07f9166280 100644 --- a/ecal/core/src/time/ecal_timegate.cpp +++ b/ecal/core/src/time/ecal_timegate.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -419,7 +419,7 @@ namespace eCAL if (interface_.module_handle == nullptr) { - eCAL::Logging::Log(log_level_error, "Could not load eCAL time sync module " + module_name); + eCAL::Logging::Log(Logging::log_level_error, "Could not load eCAL time sync module " + module_name); return false; } else @@ -457,7 +457,7 @@ namespace eCAL || (interface_.etime_get_status_ptr == nullptr) ) { - eCAL::Logging::Log(log_level_error, "Could not load eCAL time sync module " + module_name); + eCAL::Logging::Log(Logging::log_level_error, "Could not load eCAL time sync module " + module_name); return false; } } diff --git a/ecal/samples/CMakeLists.txt b/ecal/samples/CMakeLists.txt index 6a7bea5b8c..e0d218d725 100644 --- a/ecal/samples/CMakeLists.txt +++ b/ecal/samples/CMakeLists.txt @@ -17,25 +17,6 @@ # ========================= eCAL LICENSE ================================= cmake_minimum_required(VERSION 3.10) -# -------------------------------------------------------- -# c samples -# -------------------------------------------------------- -# pubsub -if(ECAL_CORE_PUBLISHER) - add_subdirectory(c/pubsub/string/minimal_snd) -endif() - -if(ECAL_CORE_SUBSCRIBER) - add_subdirectory(c/pubsub/string/minimal_rec) - add_subdirectory(c/pubsub/string/minimal_rec_cb) -endif() - -# services -if(ECAL_CORE_SERVICE) - add_subdirectory(c/services/minimal_client_c) - add_subdirectory(c/services/minimal_server_c) -endif() - # -------------------------------------------------------- # cpp samples # -------------------------------------------------------- diff --git a/ecal/samples/cpp/benchmarks/counter_snd/src/counter_snd.cpp b/ecal/samples/cpp/benchmarks/counter_snd/src/counter_snd.cpp index 801e8acbe6..8f2ae042ec 100644 --- a/ecal/samples/cpp/benchmarks/counter_snd/src/counter_snd.cpp +++ b/ecal/samples/cpp/benchmarks/counter_snd/src/counter_snd.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,7 @@ int main(int argc, char **argv) msgs = 0; bytes = 0; - eCAL::Logging::Log(log_level_info, out.str()); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, out.str()); } } } diff --git a/ecal/samples/cpp/benchmarks/performance_snd/src/performance_snd.cpp b/ecal/samples/cpp/benchmarks/performance_snd/src/performance_snd.cpp index e848cdc47e..158bc6d60a 100644 --- a/ecal/samples/cpp/benchmarks/performance_snd/src/performance_snd.cpp +++ b/ecal/samples/cpp/benchmarks/performance_snd/src/performance_snd.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,7 +98,7 @@ int main(int argc, char **argv) out << "Messages/s: " << (unsigned int)(msgs / diff_time.count()) << std::endl; out << "Latency (us): " << (diff_time.count() * 1e6) / (double)msgs << std::endl; std::cout << out.str() << std::endl; - eCAL::Logging::Log(log_level_info, out.str()); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, out.str()); // reset counter msgs = 0; diff --git a/ecal/samples/cpp/misc/process/src/process.cpp b/ecal/samples/cpp/misc/process/src/process.cpp index 78a1c88482..c6b7696f91 100644 --- a/ecal/samples/cpp/misc/process/src/process.cpp +++ b/ecal/samples/cpp/misc/process/src/process.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ int main() eCAL::Initialize("process", eCAL::Init::None); // start process - eCAL::Process::StartProcess(proc_name, "", "", false, proc_smode_normal, false); + eCAL::Process::StartProcess(proc_name, "", "", false, eCAL::Process::eStartMode::normal, false); // sleep 2 seconds eCAL::Process::SleepMS(2000); @@ -43,7 +43,7 @@ int main() eCAL::Process::SleepMS(2000); // start process - int pid = eCAL::Process::StartProcess(proc_name, "", "", false, proc_smode_normal, false); + int pid = eCAL::Process::StartProcess(proc_name, "", "", false, eCAL::Process::eStartMode::normal, false); // sleep 2 seconds eCAL::Process::SleepMS(2000); diff --git a/ecal/samples/cpp/misc/timer/src/timer.cpp b/ecal/samples/cpp/misc/timer/src/timer.cpp index a3926b682a..e7495ffce1 100644 --- a/ecal/samples/cpp/misc/timer/src/timer.cpp +++ b/ecal/samples/cpp/misc/timer/src/timer.cpp @@ -30,7 +30,7 @@ int main() // initialize eCAL API eCAL::Initialize("person publisher"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); eCAL::CPublisher pub("hello"); eCAL::CTimer timer; diff --git a/ecal/samples/cpp/services/minimal_client/src/minimal_client.cpp b/ecal/samples/cpp/services/minimal_client/src/minimal_client.cpp index dc8127e8c8..b5759fbd09 100644 --- a/ecal/samples/cpp/services/minimal_client/src/minimal_client.cpp +++ b/ecal/samples/cpp/services/minimal_client/src/minimal_client.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,13 +37,13 @@ int main() switch (service_response_.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { std::cout << "Received response for method " << service_response_.service_method_id.method_name << " : " << service_response_.response << " from service id " << entity_id_.entity_id << " from host " << service_response_.service_method_id.service_id.host_name << std::endl; } break; // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: std::cout << "Received error for method " << service_response_.service_method_id.method_name << " : " << service_response_.error_msg << " from service id " << entity_id_.entity_id << " from host " << service_response_.service_method_id.service_id.host_name << std::endl; break; default: @@ -79,13 +79,13 @@ int main() switch (service_info.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { std::cout << "Received response : " << service_response.second.response << " from service id " << client_instance.GetClientID() << " from host " << service_info.host_name << std::endl; } break; // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: std::cout << "Received error : " << service_info.error_msg << " from service id " << client_instance.GetClientID() << " from host " << service_info.host_name << std::endl; break; default: diff --git a/ecal/tests/CMakeLists.txt b/ecal/tests/CMakeLists.txt index 7c19f59412..cb3c1ce81b 100644 --- a/ecal/tests/CMakeLists.txt +++ b/ecal/tests/CMakeLists.txt @@ -18,11 +18,6 @@ cmake_minimum_required(VERSION 3.13) -# -------------------------------------------------------- -# c tests -# -------------------------------------------------------- -add_subdirectory(c/core_test) - # -------------------------------------------------------- # cpp tests # -------------------------------------------------------- diff --git a/ecal/tests/cpp/clientserver_test/src/clientserver_test.cpp b/ecal/tests/cpp/clientserver_test/src/clientserver_test.cpp index 35a95c6591..2e7004d994 100644 --- a/ecal/tests/cpp/clientserver_test/src/clientserver_test.cpp +++ b/ecal/tests/cpp/clientserver_test/src/clientserver_test.cpp @@ -84,13 +84,13 @@ namespace std::cout << "Execution state : "; switch (service_response_.call_state) { - case call_state_none: + case none: std::cout << "call_state_none"; break; - case call_state_executed: + case executed: std::cout << "call_state_executed"; break; - case call_state_failed: + case failed: std::cout << "call_state_failed"; break; } @@ -120,13 +120,13 @@ TEST(core_cpp_clientserver, ClientConnectEvent) { switch (data_.type) { - case client_event_connected: + case eCAL::eClientEvent::connected: #if DO_LOGGING std::cout << "event connected fired" << std::endl; #endif event_connected_fired++; break; - case client_event_disconnected: + case eCAL::eClientEvent::disconnected: #if DO_LOGGING std::cout << "event disconnected fired" << std::endl; #endif @@ -185,13 +185,13 @@ TEST(core_cpp_clientserver, ServerConnectEvent) { switch (data_.type) { - case server_event_connected: + case eCAL::eServerEvent::connected: #if DO_LOGGING std::cout << "event connected fired" << std::endl; #endif event_connected_fired++; break; - case server_event_disconnected: + case eCAL::eServerEvent::disconnected: #if DO_LOGGING std::cout << "event disconnected fired" << std::endl; #endif @@ -386,7 +386,7 @@ TEST(core_cpp_clientserver, ClientServerBaseCallbackTimeout) std::atomic timeout_fired(0); auto event_callback = [&](const eCAL::Registration::SServiceMethodId& /*service_id_*/, const struct eCAL::SClientEventCallbackData& data_) -> void { - if (data_.type == client_event_timeout) + if (data_.type == eCAL::eClientEvent::timeout) { #if DO_LOGGING std::cout << "event timeouted fired" << std::endl; diff --git a/ecal/tests/cpp/clientserver_v5_test/src/clientserver_test.cpp b/ecal/tests/cpp/clientserver_v5_test/src/clientserver_test.cpp index aefa81d27d..a76a24f5c5 100644 --- a/ecal/tests/cpp/clientserver_v5_test/src/clientserver_test.cpp +++ b/ecal/tests/cpp/clientserver_v5_test/src/clientserver_test.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,13 +80,13 @@ namespace std::cout << "Execution state : "; switch (service_response_.call_state) { - case call_state_none: + case none: std::cout << "call_state_none"; break; - case call_state_executed: + case executed: std::cout << "call_state_executed"; break; - case call_state_failed: + case failed: std::cout << "call_state_failed"; break; } @@ -120,13 +120,13 @@ TEST(core_cpp_clientserver_v5, ClientConnectEvent) { switch (data_->type) { - case client_event_connected: + case eCAL::eClientEvent::connected: #if DO_LOGGING std::cout << "event connected fired" << std::endl; #endif event_connected_fired++; break; - case client_event_disconnected: + case eCAL::eClientEvent::disconnected: #if DO_LOGGING std::cout << "event disconnected fired" << std::endl; #endif @@ -137,8 +137,8 @@ TEST(core_cpp_clientserver_v5, ClientConnectEvent) } }; // attach event - client.AddEventCallback(client_event_connected, std::bind(event_callback, std::placeholders::_2)); - client.AddEventCallback(client_event_disconnected, std::bind(event_callback, std::placeholders::_2)); + client.AddEventCallback(eCAL::eClientEvent::connected, std::bind(event_callback, std::placeholders::_2)); + client.AddEventCallback(eCAL::eClientEvent::disconnected, std::bind(event_callback, std::placeholders::_2)); // check events eCAL::Process::SleepMS(CMN_REGISTRATION_REFRESH_MS); @@ -187,13 +187,13 @@ TEST(core_cpp_clientserver_v5, ServerConnectEvent) { switch (data_->type) { - case server_event_connected: + case eCAL::eServerEvent::connected: #if DO_LOGGING std::cout << "event connected fired" << std::endl; #endif event_connected_fired++; break; - case server_event_disconnected: + case eCAL::eServerEvent::disconnected: #if DO_LOGGING std::cout << "event disconnected fired" << std::endl; #endif @@ -204,8 +204,8 @@ TEST(core_cpp_clientserver_v5, ServerConnectEvent) } }; // attach event - server.AddEventCallback(server_event_connected, std::bind(event_callback, std::placeholders::_2)); - server.AddEventCallback(server_event_disconnected, std::bind(event_callback, std::placeholders::_2)); + server.AddEventCallback(eCAL::eServerEvent::connected, std::bind(event_callback, std::placeholders::_2)); + server.AddEventCallback(eCAL::eServerEvent::disconnected, std::bind(event_callback, std::placeholders::_2)); // check events eCAL::Process::SleepMS(CMN_REGISTRATION_REFRESH_MS); @@ -413,7 +413,7 @@ TEST(core_cpp_clientserver_v5, ClientServerBaseCallbackTimeout) for (const auto& client : client_vec) { // catch events - client->AddEventCallback(client_event_timeout, std::bind(event_callback, std::placeholders::_2)); + client->AddEventCallback(eCAL::eClientEvent::timeout, std::bind(event_callback, std::placeholders::_2)); } // let's match them -> wait REGISTRATION_REFRESH_CYCLE (ecal_def.h) diff --git a/ecal/tests/cpp/config_test/src/config_test.cpp b/ecal/tests/cpp/config_test/src/config_test.cpp index 2e4231da18..7eacd3dcc1 100644 --- a/ecal/tests/cpp/config_test/src/config_test.cpp +++ b/ecal/tests/cpp/config_test/src/config_test.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ TEST(core_cpp_config /*unused*/, user_config_passing /*unused*/) const int upd_snd_buff = (5242880 + 1024); // Monitoring options - const eCAL_Logging_Filter mon_log_filter_con = log_level_warning; + const eCAL::Logging::Filter mon_log_filter_con = eCAL::Logging::log_level_warning; // Publisher options const bool pub_use_shm = false; diff --git a/ecal/tests/cpp/logging_test/src/logging_test.cpp b/ecal/tests/cpp/logging_test/src/logging_test.cpp index ca6a6c0733..a6735c0c14 100644 --- a/ecal/tests/cpp/logging_test/src/logging_test.cpp +++ b/ecal/tests/cpp/logging_test/src/logging_test.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ eCAL::Configuration GetUDPConfiguration() config.logging.provider.console.enable = false; config.logging.provider.udp.enable = true; config.logging.receiver.enable = true; - config.logging.provider.udp.filter_log = log_level_all; + config.logging.provider.udp.filter_log = eCAL::Logging::log_level_all; return config; } @@ -69,7 +69,7 @@ eCAL::Configuration GetFileConfiguration(const std::string& path_) config.logging.provider.console.enable = false; config.logging.provider.file.enable = true; config.logging.provider.file_config.path = path_; - config.logging.provider.file.filter_log = log_level_all; + config.logging.provider.file.filter_log = eCAL::Logging::log_level_all; return config; } @@ -79,7 +79,7 @@ eCAL::Configuration GetConsoleConfiguration() config.logging.provider.file.enable = false; config.logging.provider.udp.enable = false; config.logging.provider.console.enable = true; - config.logging.provider.console.filter_log = log_level_all; + config.logging.provider.console.filter_log = eCAL::Logging::log_level_all; return config; } @@ -92,7 +92,7 @@ TEST(logging_to /*unused*/, file /*unused*/) eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); - eCAL::Logging::Log(log_level_info, log_message); + eCAL::Logging::Log(eCAL::Logging::log_level_info, log_message); eCAL::Finalize(); @@ -132,7 +132,7 @@ TEST(logging_to /*unused*/, udp /*unused*/) eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); - eCAL::Logging::Log(log_level_info, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, log_message); std::this_thread::sleep_for(UDP_WAIT_TIME); @@ -148,7 +148,7 @@ TEST(logging_to /*unused*/, udp /*unused*/) EXPECT_EQ(log.log_messages.front().hname, eCAL::Process::GetHostName()); EXPECT_EQ(log.log_messages.front().pid, eCAL::Process::GetProcessID()); EXPECT_EQ(log.log_messages.front().uname, unit_name); - EXPECT_EQ(log.log_messages.front().level, log_level_info); + EXPECT_EQ(log.log_messages.front().level, eCAL::Logging::eLogLevel::log_level_info); EXPECT_TRUE(log.log_messages.front().content.find(log_message) != std::string::npos); } @@ -167,7 +167,7 @@ TEST(logging_to /*unused*/, console /*unused*/) // Redirect the output stream to a stringstream in order to find log messages std::stringstream ss; CoutRedirect redirect(ss); - eCAL::Logging::Log(log_level_info, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, log_message); std::string console_output = ss.str(); EXPECT_TRUE(console_output.find(log_message) != std::string::npos); } @@ -193,29 +193,29 @@ TEST(logging_levels /*unused*/, all /*unused*/) eCAL::Logging::SLogging log; - eCAL::Logging::Log(log_level_info, log_message); + eCAL::Logging::Log(eCAL::Logging::log_level_info, log_message); EXPECT_EQ(getLogging(log), 1); - eCAL::Logging::Log(log_level_warning, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_warning, log_message); EXPECT_EQ(getLogging(log), 1); - eCAL::Logging::Log(log_level_error, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_error, log_message); EXPECT_EQ(getLogging(log), 1); - eCAL::Logging::Log(log_level_debug1, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_debug1, log_message); EXPECT_EQ(getLogging(log), 1); - eCAL::Logging::Log(log_level_debug1, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_debug1, log_message); EXPECT_EQ(getLogging(log), 1); - eCAL::Logging::Log(log_level_debug2, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_debug2, log_message); EXPECT_EQ(getLogging(log), 1); - eCAL::Logging::Log(log_level_debug3, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_debug3, log_message); EXPECT_EQ(getLogging(log), 1); - eCAL::Logging::Log(log_level_debug4, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_debug4, log_message); EXPECT_EQ(getLogging(log), 1); eCAL::Finalize(); @@ -227,18 +227,18 @@ TEST(logging_levels /*unused*/, log_warning_vs_info /*unused*/) const std::string log_message = "Logging level warning vs info test for udp."; auto ecal_config = GetUDPConfiguration(); - ecal_config.logging.provider.udp.filter_log = log_level_warning; + ecal_config.logging.provider.udp.filter_log = eCAL::Logging::eLogLevel::log_level_warning; eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); eCAL::Logging::SLogging log; // logging not expected - eCAL::Logging::Log(log_level_info, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, log_message); EXPECT_EQ(getLogging(log), 0); // logging expected - eCAL::Logging::Log(log_level_warning, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_warning, log_message); EXPECT_EQ(getLogging(log), 1); eCAL::Finalize(); @@ -250,34 +250,34 @@ TEST(logging_levels /*unused*/, none /*unused*/) const std::string log_message = "Logging level none test for udp."; auto ecal_config = GetUDPConfiguration(); - ecal_config.logging.provider.udp.filter_log = log_level_none; + ecal_config.logging.provider.udp.filter_log = eCAL::Logging::eLogLevel::log_level_none; eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); eCAL::Logging::SLogging log; - eCAL::Logging::Log(log_level_info, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, log_message); EXPECT_EQ(getLogging(log), 0); - eCAL::Logging::Log(log_level_warning, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_warning, log_message); EXPECT_EQ(getLogging(log), 0); - eCAL::Logging::Log(log_level_error, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_error, log_message); EXPECT_EQ(getLogging(log), 0); - eCAL::Logging::Log(log_level_debug1, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_debug1, log_message); EXPECT_EQ(getLogging(log), 0); - eCAL::Logging::Log(log_level_debug1, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_debug1, log_message); EXPECT_EQ(getLogging(log), 0); - eCAL::Logging::Log(log_level_debug2, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_debug2, log_message); EXPECT_EQ(getLogging(log), 0); - eCAL::Logging::Log(log_level_debug3, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_debug3, log_message); EXPECT_EQ(getLogging(log), 0); - eCAL::Logging::Log(log_level_debug4, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_debug4, log_message); EXPECT_EQ(getLogging(log), 0); eCAL::Finalize(); @@ -293,7 +293,7 @@ TEST(logging_disable /*unused*/, file /*unused*/) ecal_config.logging.provider.file.enable = false; eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); - eCAL::Logging::Log(log_level_info, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, log_message); eCAL::Finalize(); @@ -321,7 +321,7 @@ TEST(logging_disable /*unused*/, udp /*unused*/) ecal_config.logging.provider.udp.enable = false; eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); - eCAL::Logging::Log(log_level_info, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, log_message); std::this_thread::sleep_for(UDP_WAIT_TIME); @@ -342,7 +342,7 @@ TEST(logging_disable /*unused*/, udp_receive /*unused*/) ecal_config.logging.receiver.enable = false; eCAL::Initialize(ecal_config, unit_name.c_str(), eCAL::Init::Logging); - eCAL::Logging::Log(log_level_info, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, log_message); std::this_thread::sleep_for(UDP_WAIT_TIME); @@ -365,7 +365,7 @@ TEST(logging_disable /*unused*/, udp_different_receive_port /*unused*/) eCAL::Initialize(ecal_config, unit_name.c_str(), eCAL::Init::Logging); - eCAL::Logging::Log(log_level_info, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, log_message); std::this_thread::sleep_for(UDP_WAIT_TIME); @@ -390,7 +390,7 @@ TEST(logging_disable /*unused*/, console /*unused*/) // Redirect the output stream to a stringstream in order to find log messages std::stringstream ss; CoutRedirect redirect(ss); - eCAL::Logging::Log(log_level_info, log_message); + eCAL::Logging::Log(eCAL::Logging::eLogLevel::log_level_info, log_message); std::string console_output = ss.str(); EXPECT_TRUE(console_output.find(log_message) == std::string::npos); } diff --git a/ecal/tests/cpp/serialization_test/src/logging_generate.cpp b/ecal/tests/cpp/serialization_test/src/logging_generate.cpp index f871a18e65..d01b6c4e9a 100644 --- a/ecal/tests/cpp/serialization_test/src/logging_generate.cpp +++ b/ecal/tests/cpp/serialization_test/src/logging_generate.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ namespace eCAL logMessage.pid = rand() % 1000; logMessage.pname = GenerateString(8); logMessage.uname = GenerateString(6); - logMessage.level = static_cast(rand() % 2); + logMessage.level = static_cast(rand() % 2); logMessage.content = GenerateString(50); return logMessage; diff --git a/lang/c/CMakeLists.txt b/lang/c/CMakeLists.txt new file mode 100644 index 0000000000..b6100a50c3 --- /dev/null +++ b/lang/c/CMakeLists.txt @@ -0,0 +1,33 @@ +# ========================= eCAL LICENSE ================================= +# +# Copyright (C) 2016 - 2025 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 ================================= + +# C build, can be executed standalone against an eCAL installation +project(ecal_c) + +option(ECAL_C_BUILD_SAMPLES "BUILD eCAL C samples" ON) +option(ECAL_C_BUILD_TESTS "BUILD eCAL C unittests" ON) + +add_subdirectory(core) + +if (ECAL_C_BUILD_SAMPLES) +add_subdirectory(samples) +endif() + +if (ECAL_C_BUILD_TESTS) +add_subdirectory(tests) +endif () \ No newline at end of file diff --git a/lang/c/core/CMakeLists.txt b/lang/c/core/CMakeLists.txt new file mode 100644 index 0000000000..06634b78de --- /dev/null +++ b/lang/c/core/CMakeLists.txt @@ -0,0 +1,126 @@ +# ========================= eCAL LICENSE ================================= +# +# Copyright (C) 2016 - 2025 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 ================================= + +project(core_c VERSION ${eCAL_VERSION_STRING}) + + +###################################### +# c interface +###################################### +set(ecal_c_src + src/ecal_client_cimpl.cpp + src/ecal_common_cimpl.cpp + src/ecal_common_cimpl.h + src/ecal_core_cimpl.cpp + src/ecal_log_cimpl.cpp + src/ecal_monitoring_cimpl.cpp + src/ecal_process_cimpl.cpp + src/ecal_publisher_cimpl.cpp + src/ecal_server_cimpl.cpp + src/ecal_subscriber_cimpl.cpp + src/ecal_time_cimpl.cpp + src/ecal_timer_cimpl.cpp + src/ecal_util_cimpl.cpp +) + +###################################### +# windows dll +###################################### +if(WIN32) + set(ecal_c_win_src + src/win32/dll/dllmain.cpp + src/win32/dll/ecal.rc + ) +endif() + +###################################### +# public header +###################################### + + +set(ecal_header_cimpl + include/ecal/cimpl/ecal_callback_cimpl.h + include/ecal/cimpl/ecal_client_cimpl.h + include/ecal/cimpl/ecal_core_cimpl.h + include/ecal/cimpl/ecal_init_cimpl.h + include/ecal/cimpl/ecal_log_cimpl.h + include/ecal/cimpl/ecal_monitoring_cimpl.h + include/ecal/cimpl/ecal_process_cimpl.h + include/ecal/cimpl/ecal_publisher_cimpl.h + include/ecal/cimpl/ecal_server_cimpl.h + include/ecal/cimpl/ecal_service_info_cimpl.h + include/ecal/cimpl/ecal_subscriber_cimpl.h + include/ecal/cimpl/ecal_time_cimpl.h + include/ecal/cimpl/ecal_timer_cimpl.h + include/ecal/cimpl/ecal_util_cimpl.h + include/ecal/ecalc.h + include/ecal/ecalc_export.h + include/ecal/ecalc_types.h +) + + +set(ecal_c_sources + ${ecal_c_src} + ${ecal_c_win_src} + ${ecal_header_cimpl} +) + +ecal_add_ecal_shared_library(${PROJECT_NAME} + ${ecal_c_sources} +) + +add_library(eCAL::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) + +target_include_directories(${PROJECT_NAME} + PUBLIC + $ + $ +) + +target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::core) + +target_compile_definitions(${PROJECT_NAME} + INTERFACE + ECAL_CORE_C_IMPORTS + PRIVATE + ECAL_CORE_C_EXPORTS + ECAL_NO_DEPRECATION_WARNINGS +) + +set_target_properties(${PROJECT_NAME} + PROPERTIES + CXX_VISIBILITY_PRESET hidden + C_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON +) + + +set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER lang/c) + +ecal_install_ecal_shared_library(${PROJECT_NAME}) + +install(DIRECTORY + "include/" DESTINATION "${INSTALL_INCLUDE_DIR}" COMPONENT sdk + FILES_MATCHING PATTERN "*.h") + + +if(NOT ${CMAKE_VERSION} VERSION_LESS "3.8.0") + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES + ${ecal_c_sources} + ) +endif() \ No newline at end of file diff --git a/ecal/core/include/ecal/cimpl/ecal_callback_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_callback_cimpl.h similarity index 100% rename from ecal/core/include/ecal/cimpl/ecal_callback_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_callback_cimpl.h diff --git a/ecal/core/include/ecal/cimpl/ecal_client_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_client_cimpl.h similarity index 98% rename from ecal/core/include/ecal/cimpl/ecal_client_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_client_cimpl.h index e40f114006..5fa2247a3e 100644 --- a/ecal/core/include/ecal/cimpl/ecal_client_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_client_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ #ifndef ecal_client_cimpl_h_included #define ecal_client_cimpl_h_included -#include +#include #include #include diff --git a/ecal/core/include/ecal/cimpl/ecal_core_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_core_cimpl.h similarity index 96% rename from ecal/core/include/ecal/cimpl/ecal_core_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_core_cimpl.h index d7a6a81ff6..0c5b4fa24e 100644 --- a/ecal/core/include/ecal/cimpl/ecal_core_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_core_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,10 +25,10 @@ #ifndef ecal_core_cimpl_h_included #define ecal_core_cimpl_h_included -#include +#include #include -#include "ecal_init_cimpl.h" +#include #ifdef __cplusplus extern "C" diff --git a/ecal/core/include/ecal/cimpl/ecal_init_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_init_cimpl.h similarity index 100% rename from ecal/core/include/ecal/cimpl/ecal_init_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_init_cimpl.h diff --git a/ecal/core/include/ecal/cimpl/ecal_log_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_log_cimpl.h similarity index 77% rename from ecal/core/include/ecal/cimpl/ecal_log_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_log_cimpl.h index 48eaa8048d..82b0511b47 100644 --- a/ecal/core/include/ecal/cimpl/ecal_log_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_log_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,14 +25,29 @@ #ifndef ecal_log_cimpl_h_included #define ecal_log_cimpl_h_included -#include - -#include +#include #ifdef __cplusplus extern "C" { #endif /*__cplusplus*/ + /** + * @brief Values that represent different log level to filter on monitoring. + **/ + enum eCAL_Logging_eLogLevel + { + log_level_none = 0, + log_level_all = 255, + log_level_info = 1, + log_level_warning = 2, + log_level_error = 4, + log_level_fatal = 8, + log_level_debug1 = 16, + log_level_debug2 = 32, + log_level_debug3 = 64, + log_level_debug4 = 128, + }; + /** * @brief Log a message (with current log level). * diff --git a/ecal/core/include/ecal/cimpl/ecal_monitoring_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_monitoring_cimpl.h similarity index 95% rename from ecal/core/include/ecal/cimpl/ecal_monitoring_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_monitoring_cimpl.h index cd93dffc8d..95f80c54c9 100644 --- a/ecal/core/include/ecal/cimpl/ecal_monitoring_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_monitoring_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ #ifndef ecal_monitoring_cimpl_h_included #define ecal_monitoring_cimpl_h_included -#include +#include #ifdef __cplusplus extern "C" diff --git a/ecal/core/include/ecal/cimpl/ecal_process_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_process_cimpl.h similarity index 79% rename from ecal/core/include/ecal/cimpl/ecal_process_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_process_cimpl.h index 07fca1e097..30131ce7e9 100644 --- a/ecal/core/include/ecal/cimpl/ecal_process_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_process_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,15 +25,49 @@ #ifndef ecal_process_cimpl_h_included #define ecal_process_cimpl_h_included -#include -#include - -#include +#include #ifdef __cplusplus extern "C" { #endif /*__cplusplus*/ + + enum eCAL_Process_eStartMode + { + proc_smode_normal = 0, /*!< 0 == start mode normal */ + proc_smode_hidden = 1, /*!< 1 == start mode hidden */ + proc_smode_minimized = 2, /*!< 2 == start mode minimized */ + proc_smode_maximized = 3, /*!< 3 == start mode maximized */ + }; + + /** + * @brief Process severity +**/ + enum eCAL_Process_eSeverity + { + proc_sev_unknown = 0, /*!< 0 == condition unknown */ + proc_sev_healthy = 1, /*!< 1 == process healthy */ + proc_sev_warning = 2, /*!< 2 == process warning level */ + proc_sev_critical = 3, /*!< 3 == process critical */ + proc_sev_failed = 4, /*!< 4 == process failed */ + }; + + /** + * @brief Process Severity Level + * + * enumerations for ECAL_API::SetState functionality + * where the lowest process severity is generally proc_sev_level1 + **/ + enum eCAL_Process_eSeverity_Level + { + proc_sev_level1 = 1, /*!< default severity level 1 */ + proc_sev_level2 = 2, /*!< severity level 2 */ + proc_sev_level3 = 3, /*!< severity level 3 */ + proc_sev_level4 = 4, /*!< severity level 4 */ + proc_sev_level5 = 5, /*!< severity level 5 */ + }; + + /** * @brief Dump configuration to console. **/ diff --git a/ecal/core/include/ecal/cimpl/ecal_publisher_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_publisher_cimpl.h similarity index 98% rename from ecal/core/include/ecal/cimpl/ecal_publisher_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_publisher_cimpl.h index 754af8dd45..b3139faf24 100644 --- a/ecal/core/include/ecal/cimpl/ecal_publisher_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_publisher_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ #ifndef ecal_publisher_cimpl_h_included #define ecal_publisher_cimpl_h_included -#include +#include #include #include diff --git a/ecal/core/include/ecal/cimpl/ecal_server_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_server_cimpl.h similarity index 97% rename from ecal/core/include/ecal/cimpl/ecal_server_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_server_cimpl.h index 7a0ce0b028..9acf63f053 100644 --- a/ecal/core/include/ecal/cimpl/ecal_server_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_server_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ #ifndef ecal_server_cimpl_h_included #define ecal_server_cimpl_h_included -#include +#include #include #include diff --git a/ecal/core/include/ecal/cimpl/ecal_service_info_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_service_info_cimpl.h similarity index 100% rename from ecal/core/include/ecal/cimpl/ecal_service_info_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_service_info_cimpl.h diff --git a/ecal/core/include/ecal/cimpl/ecal_subscriber_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_subscriber_cimpl.h similarity index 99% rename from ecal/core/include/ecal/cimpl/ecal_subscriber_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_subscriber_cimpl.h index b5ec324283..602b86855b 100644 --- a/ecal/core/include/ecal/cimpl/ecal_subscriber_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_subscriber_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ #ifndef ecal_subscriber_cimpl_h_included #define ecal_subscriber_cimpl_h_included -#include +#include #include #include diff --git a/ecal/core/include/ecal/cimpl/ecal_time_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_time_cimpl.h similarity index 97% rename from ecal/core/include/ecal/cimpl/ecal_time_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_time_cimpl.h index 3618fba7ea..621ec594b3 100644 --- a/ecal/core/include/ecal/cimpl/ecal_time_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_time_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ #ifndef ecal_time_cimpl_h_included #define ecal_time_cimpl_h_included -#include +#include #ifdef __cplusplus extern "C" diff --git a/ecal/core/include/ecal/cimpl/ecal_timer_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_timer_cimpl.h similarity index 96% rename from ecal/core/include/ecal/cimpl/ecal_timer_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_timer_cimpl.h index c9b871fc62..7c6aa34f73 100644 --- a/ecal/core/include/ecal/cimpl/ecal_timer_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_timer_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ #ifndef ecal_timer_cimpl_h_included #define ecal_timer_cimpl_h_included -#include +#include #include #include diff --git a/ecal/core/include/ecal/cimpl/ecal_tlayer_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_tlayer_cimpl.h similarity index 100% rename from ecal/core/include/ecal/cimpl/ecal_tlayer_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_tlayer_cimpl.h diff --git a/ecal/core/include/ecal/cimpl/ecal_util_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_util_cimpl.h similarity index 94% rename from ecal/core/include/ecal/cimpl/ecal_util_cimpl.h rename to lang/c/core/include/ecal/cimpl/ecal_util_cimpl.h index 96d011a892..d739393ef2 100644 --- a/ecal/core/include/ecal/cimpl/ecal_util_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_util_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ #ifndef ecal_util_cimpl_h_included #define ecal_util_cimpl_h_included -#include +#include #ifdef __cplusplus extern "C" diff --git a/ecal/core/include/ecal/ecalc.h b/lang/c/core/include/ecal/ecalc.h similarity index 93% rename from ecal/core/include/ecal/ecalc.h rename to lang/c/core/include/ecal/ecalc.h index b1a212f923..b7459ddbd0 100644 --- a/ecal/core/include/ecal/ecalc.h +++ b/lang/c/core/include/ecal/ecalc.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,8 +30,7 @@ #endif // all ecal c includes -#include -#include +#include #include #include #include diff --git a/lang/c/core/include/ecal/ecalc_export.h b/lang/c/core/include/ecal/ecalc_export.h new file mode 100644 index 0000000000..4015811d4c --- /dev/null +++ b/lang/c/core/include/ecal/ecalc_export.h @@ -0,0 +1,48 @@ +/* ========================= eCAL LICENSE ================================= + * + * Copyright (C) 2016 - 2025 Continental Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ========================= eCAL LICENSE ================================= +*/ + +/** + * @file ecalc_export.h + * @brief eCAL dll / so export commands +**/ + +#ifndef ecalc_export_h_included +#define ecalc_export_h_included + +#ifdef _MSC_VER + #ifdef ECAL_CORE_C_EXPORTS + #define ECALC_API __declspec(dllexport) + #define ECALC_API_DEPRECATED __declspec(dllexport deprecated) + #elif defined(ECAL_CORE_C_IMPORTS) + #define ECALC_API __declspec(dllimport) + #define ECALC_API_DEPRECATED __declspec(dllimport deprecated) + #else + #define ECALC_API + #define ECALC_API_DEPRECATED __declspec(deprecated) + #endif +#else /* _MSC_VER */ + #ifdef ECAL_CORE_C_EXPORTS + #define ECALC_API __attribute__((visibility("default"))) + #else + #define ECALC_API + #endif + #define ECALC_API_DEPRECATED __attribute__((deprecated)) ECALC_API +#endif + +#endif \ No newline at end of file diff --git a/ecal/core/include/ecal/ecalc_types.h b/lang/c/core/include/ecal/ecalc_types.h similarity index 100% rename from ecal/core/include/ecal/ecalc_types.h rename to lang/c/core/include/ecal/ecalc_types.h diff --git a/ecal/core/src/cimpl/ecal_client_cimpl.cpp b/lang/c/core/src/ecal_client_cimpl.cpp similarity index 78% rename from ecal/core/src/cimpl/ecal_client_cimpl.cpp rename to lang/c/core/src/ecal_client_cimpl.cpp index 3c353ecc83..fe594a5f01 100644 --- a/ecal/core/src/cimpl/ecal_client_cimpl.cpp +++ b/lang/c/core/src/ecal_client_cimpl.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include #include +#include #include "ecal_common_cimpl.h" @@ -33,6 +34,43 @@ #if ECAL_CORE_SERVICE namespace { + eCallState enum_class_to_enum(eCAL::eCallState cpp_call_state_) + { + switch (cpp_call_state_) + { + case eCAL::eCallState::none: return call_state_none; + case eCAL::eCallState::executed: return call_state_executed; + case eCAL::eCallState::timeouted: return call_state_timeouted; + case eCAL::eCallState::failed: return call_state_failed; + default: return call_state_none; + } + } + + eCAL_Client_Event enum_class_to_enum(eCAL::eClientEvent cpp_event_) + { + switch (cpp_event_) + { + case eCAL::eClientEvent::none: return client_event_none; + case eCAL::eClientEvent::connected: return client_event_connected; + case eCAL::eClientEvent::disconnected: return client_event_disconnected; + case eCAL::eClientEvent::timeout: return client_event_timeout; + default: return client_event_none; + } + } + + eCAL::eClientEvent enum_to_enum_class(eCAL_Client_Event c_event) + { + switch (c_event) + { + case client_event_none: return eCAL::eClientEvent::none; + case client_event_connected: return eCAL::eClientEvent::connected; + case client_event_disconnected: return eCAL::eClientEvent::disconnected; + case client_event_timeout: return eCAL::eClientEvent::timeout; + default: return eCAL::eClientEvent::none; + } + } + + std::recursive_mutex g_response_callback_mtx; // NOLINT(*-avoid-non-const-global-variables) void g_response_callback(const struct eCAL::SServiceResponse& service_response_, const ResponseCallbackCT callback_, void* par_) { @@ -44,7 +82,7 @@ namespace service_response.method_name = service_response_.method_name.c_str(); service_response.error_msg = service_response_.error_msg.c_str(); service_response.ret_state = service_response_.ret_state; - service_response.call_state = service_response_.call_state; + service_response.call_state = enum_class_to_enum(service_response_.call_state); service_response.response = service_response_.response.c_str(); service_response.response_len = static_cast(service_response_.response.size()); callback_(&service_response, par_); @@ -56,7 +94,7 @@ namespace const std::lock_guard lock(g_client_event_callback_mtx); SClientEventCallbackDataC data{}; data.time = data_->time; - data.type = data_->type; + data.type = enum_class_to_enum(data_->type); callback_(name_, &data, par_); } } @@ -110,7 +148,7 @@ extern "C" service_response_->method_name = nullptr; service_response_->error_msg = nullptr; service_response_->ret_state = service_response_vec[0].ret_state; - service_response_->call_state = service_response_vec[0].call_state; + service_response_->call_state = enum_class_to_enum(service_response_vec[0].call_state); service_response_->response = nullptr; service_response_->response_len = 0; return(CopyBuffer(response_, response_len_, service_response_vec[0].response)); @@ -148,7 +186,7 @@ ECALC_API int eCAL_Client_AddEventCallback(ECAL_HANDLE handle_, enum eCAL_Client if (handle_ == nullptr) return(0); auto* client = static_cast(handle_); auto callback = std::bind(g_client_event_callback, std::placeholders::_1, std::placeholders::_2, callback_, par_); - if (client->AddEventCallback(type_, callback)) return(1); + if (client->AddEventCallback(enum_to_enum_class(type_), callback)) return(1); return(0); } @@ -156,7 +194,7 @@ ECALC_API int eCAL_Client_RemEventCallback(ECAL_HANDLE handle_, enum eCAL_Client { if (handle_ == nullptr) return(0); auto* client = static_cast(handle_); - if (client->RemEventCallback(type_)) return(1); + if (client->RemEventCallback(enum_to_enum_class(type_))) return(1); return(0); } diff --git a/ecal/core/src/cimpl/ecal_common_cimpl.cpp b/lang/c/core/src/ecal_common_cimpl.cpp similarity index 100% rename from ecal/core/src/cimpl/ecal_common_cimpl.cpp rename to lang/c/core/src/ecal_common_cimpl.cpp diff --git a/ecal/core/src/cimpl/ecal_common_cimpl.h b/lang/c/core/src/ecal_common_cimpl.h similarity index 100% rename from ecal/core/src/cimpl/ecal_common_cimpl.h rename to lang/c/core/src/ecal_common_cimpl.h diff --git a/ecal/core/src/cimpl/ecal_core_cimpl.cpp b/lang/c/core/src/ecal_core_cimpl.cpp similarity index 100% rename from ecal/core/src/cimpl/ecal_core_cimpl.cpp rename to lang/c/core/src/ecal_core_cimpl.cpp diff --git a/ecal/core/src/cimpl/ecal_log_cimpl.cpp b/lang/c/core/src/ecal_log_cimpl.cpp similarity index 85% rename from ecal/core/src/cimpl/ecal_log_cimpl.cpp rename to lang/c/core/src/ecal_log_cimpl.cpp index 4ee5e7eeb3..78db17d9ee 100644 --- a/ecal/core/src/cimpl/ecal_log_cimpl.cpp +++ b/lang/c/core/src/ecal_log_cimpl.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,8 @@ extern "C" { ECALC_API void eCAL_Logging_Log(enum eCAL_Logging_eLogLevel level_, const char* const msg_) { - eCAL::Logging::Log(level_, msg_); + // This is dangerous. We need to make sure to keep both enum types in synch. + eCAL::Logging::Log(static_cast(level_), msg_); } ECALC_API int eCAL_Logging_GetLogging(void* buf_, int buf_len_) diff --git a/ecal/core/src/cimpl/ecal_monitoring_cimpl.cpp b/lang/c/core/src/ecal_monitoring_cimpl.cpp similarity index 100% rename from ecal/core/src/cimpl/ecal_monitoring_cimpl.cpp rename to lang/c/core/src/ecal_monitoring_cimpl.cpp diff --git a/ecal/core/src/cimpl/ecal_process_cimpl.cpp b/lang/c/core/src/ecal_process_cimpl.cpp similarity index 89% rename from ecal/core/src/cimpl/ecal_process_cimpl.cpp rename to lang/c/core/src/ecal_process_cimpl.cpp index 50f7eca83f..675d88a7b1 100644 --- a/ecal/core/src/cimpl/ecal_process_cimpl.cpp +++ b/lang/c/core/src/ecal_process_cimpl.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,12 +96,13 @@ extern "C" ECALC_API void eCAL_Process_SetState(enum eCAL_Process_eSeverity severity_, enum eCAL_Process_eSeverity_Level level_, const char* info_) { - eCAL::Process::SetState(severity_, level_, info_); + // This is potentially dangerous, need to keep enums in sync. + eCAL::Process::SetState(static_cast(severity_), static_cast(level_), info_); } ECALC_API int eCAL_Process_StartProcess(const char* proc_name_, const char* proc_args_, const char* working_dir_, int create_console_, enum eCAL_Process_eStartMode process_mode_, int block_) { - return(eCAL::Process::StartProcess(proc_name_, proc_args_, working_dir_, create_console_ != 0, process_mode_, block_ != 0)); + return(eCAL::Process::StartProcess(proc_name_, proc_args_, working_dir_, create_console_ != 0, static_cast(process_mode_), block_ != 0)); } ECALC_API int eCAL_Process_StopProcessName(const char* proc_name_) diff --git a/ecal/core/src/cimpl/ecal_publisher_cimpl.cpp b/lang/c/core/src/ecal_publisher_cimpl.cpp similarity index 77% rename from ecal/core/src/cimpl/ecal_publisher_cimpl.cpp rename to lang/c/core/src/ecal_publisher_cimpl.cpp index 245dc4dbb1..ba64778196 100644 --- a/ecal/core/src/cimpl/ecal_publisher_cimpl.cpp +++ b/lang/c/core/src/ecal_publisher_cimpl.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,12 +33,35 @@ #if ECAL_CORE_PUBLISHER namespace { + eCAL_Publisher_Event enum_class_to_enum(eCAL::ePublisherEvent event_) { + switch (event_) { + case eCAL::ePublisherEvent::none: return pub_event_none; + case eCAL::ePublisherEvent::connected: return pub_event_connected; + case eCAL::ePublisherEvent::disconnected: return pub_event_disconnected; + case eCAL::ePublisherEvent::dropped: return pub_event_dropped; + case eCAL::ePublisherEvent::update_connection: return pub_event_update_connection; + default: return pub_event_none; + } + } + + eCAL::ePublisherEvent enum_to_enum_class(eCAL_Publisher_Event event_) { + switch (event_) { + case pub_event_none: return eCAL::ePublisherEvent::none; + case pub_event_connected: return eCAL::ePublisherEvent::connected; + case pub_event_disconnected: return eCAL::ePublisherEvent::disconnected; + case pub_event_dropped: return eCAL::ePublisherEvent::dropped; + case pub_event_update_connection: return eCAL::ePublisherEvent::update_connection; + default: return eCAL::ePublisherEvent::none; + } + } + + std::recursive_mutex g_pub_event_callback_mtx; // NOLINT(*-avoid-non-const-global-variables) void g_pub_event_callback(const char* topic_name_, const struct eCAL::v5::SPubEventCallbackData* data_, const PubEventCallbackCT callback_, void* par_) { const std::lock_guard lock(g_pub_event_callback_mtx); SPubEventCallbackDataC data{}; - data.type = data_->type; + data.type = enum_class_to_enum(data_->type); data.time = data_->time; data.clock = data_->clock; data.tid = data_->tid.c_str(); @@ -123,7 +146,7 @@ extern "C" if (handle_ == nullptr) return(0); auto* pub = static_cast(handle_); auto callback = std::bind(g_pub_event_callback, std::placeholders::_1, std::placeholders::_2, callback_, par_); - if (pub->AddEventCallback(type_, callback)) return(1); + if (pub->AddEventCallback(enum_to_enum_class(type_), callback)) return(1); return(0); } @@ -131,7 +154,7 @@ extern "C" { if (handle_ == nullptr) return(0); auto* pub = static_cast(handle_); - if (pub->RemEventCallback(type_)) return(1); + if (pub->RemEventCallback(enum_to_enum_class(type_))) return(1); return(0); } diff --git a/ecal/core/src/cimpl/ecal_server_cimpl.cpp b/lang/c/core/src/ecal_server_cimpl.cpp similarity index 81% rename from ecal/core/src/cimpl/ecal_server_cimpl.cpp rename to lang/c/core/src/ecal_server_cimpl.cpp index d6eab98fb9..562dbfdefe 100644 --- a/ecal/core/src/cimpl/ecal_server_cimpl.cpp +++ b/lang/c/core/src/ecal_server_cimpl.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,30 @@ #if ECAL_CORE_SERVICE namespace { + eCAL_Server_Event enum_class_to_enum(eCAL::eServerEvent cpp_event_) + { + switch (cpp_event_) + { + case eCAL::eServerEvent::none: return server_event_none; + case eCAL::eServerEvent::connected: return server_event_connected; + case eCAL::eServerEvent::disconnected: return server_event_disconnected; + default: return server_event_none; + } + } + + eCAL::eServerEvent enum_to_enum_class(eCAL_Server_Event c_event) + { + switch (c_event) + { + case server_event_none: return eCAL::eServerEvent::none; + case server_event_connected: return eCAL::eServerEvent::connected; + case server_event_disconnected: return eCAL::eServerEvent::disconnected; + default: return eCAL::eServerEvent::none; + } + } + + + std::recursive_mutex g_method_callback_mtx; // NOLINT(*-avoid-non-const-global-variables) int g_method_callback(const std::string& method_, const std::string& req_type_, const std::string& resp_type_, const std::string& request_, std::string& response_, MethodCallbackCT callback_, void* par_) { @@ -53,7 +77,7 @@ namespace const std::lock_guard lock(g_server_event_callback_mtx); SServerEventCallbackDataC data{}; data.time = data_->time; - data.type = data_->type; + data.type = enum_class_to_enum(data_->type); callback_(name_, &data, par_); } } @@ -95,7 +119,7 @@ extern "C" if (handle_ == nullptr) return(0); auto* server = static_cast(handle_); auto callback = std::bind(g_server_event_callback, std::placeholders::_1, std::placeholders::_2, callback_, par_); - if (server->AddEventCallback(type_, callback)) return(1); + if (server->AddEventCallback(enum_to_enum_class(type_), callback)) return(1); return(0); } @@ -103,7 +127,7 @@ extern "C" { if (handle_ == nullptr) return(0); auto* server = static_cast(handle_); - if (server->RemEventCallback(type_)) return(1); + if (server->RemEventCallback(enum_to_enum_class(type_))) return(1); return(0); } diff --git a/ecal/core/src/cimpl/ecal_subscriber_cimpl.cpp b/lang/c/core/src/ecal_subscriber_cimpl.cpp similarity index 84% rename from ecal/core/src/cimpl/ecal_subscriber_cimpl.cpp rename to lang/c/core/src/ecal_subscriber_cimpl.cpp index 48dbfe90ae..c42342b526 100644 --- a/ecal/core/src/cimpl/ecal_subscriber_cimpl.cpp +++ b/lang/c/core/src/ecal_subscriber_cimpl.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,30 @@ #if ECAL_CORE_SUBSCRIBER namespace { + eCAL_Subscriber_Event enum_class_to_enum(eCAL::eSubscriberEvent cpp_event_) { + switch (cpp_event_) { + case eCAL::eSubscriberEvent::none: return sub_event_none; + case eCAL::eSubscriberEvent::connected: return sub_event_connected; + case eCAL::eSubscriberEvent::disconnected: return sub_event_disconnected; + case eCAL::eSubscriberEvent::dropped: return sub_event_dropped; + case eCAL::eSubscriberEvent::corrupted: return sub_event_corrupted; + case eCAL::eSubscriberEvent::update_connection: return sub_event_update_connection; + default: return sub_event_none; + } + } + + eCAL::eSubscriberEvent enum_to_enum_class(eCAL_Subscriber_Event c_event_) { + switch (c_event_) { + case sub_event_none: return eCAL::eSubscriberEvent::none; + case sub_event_connected: return eCAL::eSubscriberEvent::connected; + case sub_event_disconnected: return eCAL::eSubscriberEvent::disconnected; + case sub_event_dropped: return eCAL::eSubscriberEvent::dropped; + case sub_event_corrupted: return eCAL::eSubscriberEvent::corrupted; + case sub_event_update_connection: return eCAL::eSubscriberEvent::update_connection; + default: return eCAL::eSubscriberEvent::none; + } + } + std::recursive_mutex g_sub_receive_callback_mtx; // NOLINT(*-avoid-non-const-global-variables) void g_sub_receive_callback(const char* topic_name_, const struct eCAL::SReceiveCallbackData* data_, const ReceiveCallbackCT callback_, void* par_) { @@ -51,7 +75,7 @@ namespace { const std::lock_guard lock(g_sub_event_callback_mtx); SSubEventCallbackDataC data{}; - data.type = data_->type; + data.type = enum_class_to_enum(data_->type); data.time = data_->time; data.clock = data_->clock; data.tid = data_->tid.c_str(); @@ -182,7 +206,7 @@ extern "C" if (handle_ == nullptr) return(0); auto* sub = static_cast(handle_); auto callback = std::bind(g_sub_event_callback, std::placeholders::_1, std::placeholders::_2, callback_, par_); - if (sub->AddEventCallback(type_, callback)) return(1); + if (sub->AddEventCallback(enum_to_enum_class(type_), callback)) return(1); return(0); } @@ -190,7 +214,7 @@ extern "C" { if (handle_ == nullptr) return(0); auto* sub = static_cast(handle_); - if (sub->RemEventCallback(type_)) return(1); + if (sub->RemEventCallback(enum_to_enum_class(type_))) return(1); return(0); } diff --git a/ecal/core/src/cimpl/ecal_time_cimpl.cpp b/lang/c/core/src/ecal_time_cimpl.cpp similarity index 100% rename from ecal/core/src/cimpl/ecal_time_cimpl.cpp rename to lang/c/core/src/ecal_time_cimpl.cpp diff --git a/ecal/core/src/cimpl/ecal_timer_cimpl.cpp b/lang/c/core/src/ecal_timer_cimpl.cpp similarity index 100% rename from ecal/core/src/cimpl/ecal_timer_cimpl.cpp rename to lang/c/core/src/ecal_timer_cimpl.cpp diff --git a/ecal/core/src/cimpl/ecal_util_cimpl.cpp b/lang/c/core/src/ecal_util_cimpl.cpp similarity index 100% rename from ecal/core/src/cimpl/ecal_util_cimpl.cpp rename to lang/c/core/src/ecal_util_cimpl.cpp diff --git a/lang/c/core/src/win32/dll/dllmain.cpp b/lang/c/core/src/win32/dll/dllmain.cpp new file mode 100644 index 0000000000..080bea4214 --- /dev/null +++ b/lang/c/core/src/win32/dll/dllmain.cpp @@ -0,0 +1,21 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#if defined(__clang__) && !defined(CINTERFACE) +#define CINTERFACE +#endif +#include "windows.h" + +BOOL APIENTRY DllMain( HMODULE /*hModule*/, + DWORD ul_reason_for_call, + LPVOID /*lpReserved*/ + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} diff --git a/lang/c/core/src/win32/dll/ecal.rc b/lang/c/core/src/win32/dll/ecal.rc new file mode 100644 index 0000000000000000000000000000000000000000..3c8e552567ed8d71d80157495fec4467158f8f43 GIT binary patch literal 5714 zcmdUzYfsx)5QgV-rTq_X_(Ii|OWTjtN+E=lt+^;SZ6&0LLI_BZpd{=r(*E|g&wEZz zY-1-ap;BE%j_vWxoVmO+XY8+EHf_@)JFqJ|v$2hA!f|0!XkBO%yR%cf=B{Qh`9(Ic zz709X(5IZwp^Z69?vAT7t|RWG?aFT9*|0zC8LMo%^BUA4Pp{!Vcf6IH{DxgxWdZkl zWX_yToAaxl({#bAlKj(2YR$D7T`S6}svTR)+SajM+qWa@S<~uJcey^a*gipN@qb`D zP-3ow<+8qfzhGTBN7lg4huOIxz9YNA|0&T?9NKvOH~;&1UBgesqYnKI$HQEHKYRbW zjC#2wbHS$aMNJmTx-}3uoFQaYY?R+ic^i@EKHg5ruCL~GGTx`oPoZ8ze^HS6Nve*n z;En8grk>7io!Z$0NxqI+)J%tps)3~*`eT05`#-;Ep=28!O>o=8#=1k|3%70z{SbPG zbHkxCPy%NgxhiYCLVF9o9j?8MR1F5m8IV!Q^87gU-j4twKW2zfgU{R;&Bh2 zIx%RuUUta6>UobWNILx_&?Ozgu}@U$4|pOdH5bpk-UH}=p|?q_mvL#G?{OWYtIbLu z(6#0Kis;HsLQCW-@Q55LG8HUPztP@10CQJ()<m{{Z7jATL`wZRJw^FG5UlBAt$JT%uQ{~m zUpl)reQ6@|zTCJSPLrKxHLpQC-DhW;_JXq%J?8!%`SD8jX8V=5b5XBIV*^Yximp1y*`4)BkF-2R^Fz{Sx@2KI z&*>_CD~sed+SFMl#6GD;Unkl{d{;R#Ho;vZBb7Buu zyS&y>ZYzBb>f~lXzV#k`NoLoX1%}*(_h#*o{w;b^iV0lU>R^fD8)oUE`CEJqIQH4+ zG{@!V?<_|Tt^QrwV>Ue{<=@FQt97ZwkL=67X3L-JfXGGf*5SF%I<|?~qPK88FP>kD zzm%NJr=V^h6P;*X$B@n5Xr x=hSq$5gkzKBcW +) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) diff --git a/lang/python/core/src/ecal_clang.cpp b/lang/python/core/src/ecal_clang.cpp index b0ed705c36..01ff885a0f 100644 --- a/lang/python/core/src/ecal_clang.cpp +++ b/lang/python/core/src/ecal_clang.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,6 +67,58 @@ namespace } return false; } + + /**********************************************************************/ + /* This is duplicated code from ecal_core_c */ + /* We need to use the C API here instead of reimplementing everything */ + /* But will be obsolete once we move to nanobind */ + /**********************************************************************/ + + eCAL_Publisher_Event enum_class_to_enum(eCAL::ePublisherEvent event_) { + switch (event_) { + case eCAL::ePublisherEvent::none: return pub_event_none; + case eCAL::ePublisherEvent::connected: return pub_event_connected; + case eCAL::ePublisherEvent::disconnected: return pub_event_disconnected; + case eCAL::ePublisherEvent::dropped: return pub_event_dropped; + case eCAL::ePublisherEvent::update_connection: return pub_event_update_connection; + default: return pub_event_none; + } + } + + eCAL::ePublisherEvent enum_to_enum_class(eCAL_Publisher_Event event_) { + switch (event_) { + case pub_event_none: return eCAL::ePublisherEvent::none; + case pub_event_connected: return eCAL::ePublisherEvent::connected; + case pub_event_disconnected: return eCAL::ePublisherEvent::disconnected; + case pub_event_dropped: return eCAL::ePublisherEvent::dropped; + case pub_event_update_connection: return eCAL::ePublisherEvent::update_connection; + default: return eCAL::ePublisherEvent::none; + } + } + + eCAL_Subscriber_Event enum_class_to_enum(eCAL::eSubscriberEvent cpp_event_) { + switch (cpp_event_) { + case eCAL::eSubscriberEvent::none: return sub_event_none; + case eCAL::eSubscriberEvent::connected: return sub_event_connected; + case eCAL::eSubscriberEvent::disconnected: return sub_event_disconnected; + case eCAL::eSubscriberEvent::dropped: return sub_event_dropped; + case eCAL::eSubscriberEvent::corrupted: return sub_event_corrupted; + case eCAL::eSubscriberEvent::update_connection: return sub_event_update_connection; + default: return sub_event_none; + } + } + + eCAL::eSubscriberEvent enum_to_enum_class(eCAL_Subscriber_Event c_event_) { + switch (c_event_) { + case sub_event_none: return eCAL::eSubscriberEvent::none; + case sub_event_connected: return eCAL::eSubscriberEvent::connected; + case sub_event_disconnected: return eCAL::eSubscriberEvent::disconnected; + case sub_event_dropped: return eCAL::eSubscriberEvent::dropped; + case sub_event_corrupted: return eCAL::eSubscriberEvent::corrupted; + case sub_event_update_connection: return eCAL::eSubscriberEvent::update_connection; + default: return eCAL::eSubscriberEvent::none; + } + } } /****************************************/ @@ -138,7 +190,7 @@ int ecal_set_unit_name(const char* unit_name_) /****************************************/ void ecal_set_process_state(const int severity_, const int level_, const char* info_) { - return(eCAL::Process::SetState(eCAL_Process_eSeverity(severity_), eCAL_Process_eSeverity_Level(level_), info_)); + return(eCAL::Process::SetState(eCAL::Process::eSeverity(severity_), eCAL::Process::eSeverityLevel(level_), info_)); } /****************************************/ @@ -281,7 +333,8 @@ bool ecal_get_description(const char* topic_name_, const char** topic_desc_, int /****************************************/ void log_message(const eCAL_Logging_eLogLevel& log_level_, const char* message_) { - eCAL::Logging::Log(log_level_, message_); + // this is potentially dangerous, but we will hopefully remove this soon anyways + eCAL::Logging::Log(static_cast(log_level_), message_); } @@ -346,7 +399,7 @@ static void g_pub_event_callback(const char* topic_name_, const struct eCAL::v5: { const std::lock_guard lock(g_pub_event_callback_mtx); SPubEventCallbackDataC data{}; - data.type = data_->type; + data.type = enum_class_to_enum(data_->type); data.time = data_->time; data.clock = data_->clock; data.tid = data_->tid.c_str(); @@ -361,7 +414,7 @@ bool pub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_ auto* pub = static_cast(handle_); auto callback = std::bind(g_pub_event_callback, std::placeholders::_1, std::placeholders::_2, callback_, par_); - return(pub->AddEventCallback(type_, callback)); + return(pub->AddEventCallback(enum_to_enum_class(type_), callback)); } /****************************************/ @@ -371,7 +424,7 @@ bool pub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_ { auto* pub = static_cast(handle_); - return(pub->RemEventCallback(type_)); + return(pub->RemEventCallback(enum_to_enum_class(type_))); } @@ -524,7 +577,7 @@ static void g_sub_event_callback(const char* topic_name_, const struct eCAL::v5: { const std::lock_guard lock(g_sub_event_callback_mtx); SSubEventCallbackDataC data{}; - data.type = data_->type; + data.type = enum_class_to_enum(data_->type); data.time = data_->time; data.clock = data_->clock; data.tid = data_->tid.c_str(); @@ -539,7 +592,7 @@ bool sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type auto* sub = static_cast(handle_); auto callback = std::bind(g_sub_event_callback, std::placeholders::_1, std::placeholders::_2, callback_, par_); - return(sub->AddEventCallback(type_, callback)); + return(sub->AddEventCallback(enum_to_enum_class(type_), callback)); } /****************************************/ @@ -549,7 +602,7 @@ bool sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type { auto* sub = static_cast(handle_); - return(sub->RemEventCallback(type_)); + return(sub->RemEventCallback(enum_to_enum_class(type_))); } diff --git a/lang/python/core/src/ecal_wrap.cxx b/lang/python/core/src/ecal_wrap.cxx index 46046cc51b..16ef14eb08 100644 --- a/lang/python/core/src/ecal_wrap.cxx +++ b/lang/python/core/src/ecal_wrap.cxx @@ -806,13 +806,13 @@ static void c_client_callback(const struct eCAL::SServiceResponse& service_respo std::string call_state_s; switch (service_response_.call_state) { - case call_state_none: + case eCAL::eCallState::none: call_state_s = "call_state_none"; break; - case call_state_executed: + case eCAL::eCallState::executed: call_state_s = "call_state_executed"; break; - case call_state_failed: + case eCAL::eCallState::failed: call_state_s = "call_state_failed"; break; default: diff --git a/pyproject.toml b/pyproject.toml index 959256b954..0ab0257897 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,7 @@ sdist.only-include = [ "/ecal/", "/lib/", "/licenses/", + "lang/c/", "lang/python/", "thirdparty/cmakefunctions/", diff --git a/samples/cpp/services/ecalplayer_client/src/ecalplayer_client.cpp b/samples/cpp/services/ecalplayer_client/src/ecalplayer_client.cpp index 7d5913149a..24f8620642 100644 --- a/samples/cpp/services/ecalplayer_client/src/ecalplayer_client.cpp +++ b/samples/cpp/services/ecalplayer_client/src/ecalplayer_client.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ void OnPlayerResponse(const struct eCAL::SServiceResponse& service_response_) switch (service_response_.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { if (service_response_.method_name == "GetConfig") { @@ -69,7 +69,7 @@ void OnPlayerResponse(const struct eCAL::SServiceResponse& service_response_) } break; // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: { eCAL::pb::play::Response response; response.ParseFromString(service_response_.response); diff --git a/samples/cpp/services/ecalplayer_gui_client/src/ecalplayer_gui_client.cpp b/samples/cpp/services/ecalplayer_gui_client/src/ecalplayer_gui_client.cpp index 8e00a3a0cb..0deff751d2 100644 --- a/samples/cpp/services/ecalplayer_gui_client/src/ecalplayer_gui_client.cpp +++ b/samples/cpp/services/ecalplayer_gui_client/src/ecalplayer_gui_client.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -204,7 +204,7 @@ void EcalplayGuiClient::onPlayerResponse(const struct eCAL::SServiceResponse& se switch (service_response_.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { if (service_response_.method_name == "GetConfig") { @@ -226,7 +226,7 @@ void EcalplayGuiClient::onPlayerResponse(const struct eCAL::SServiceResponse& se break; } // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: { eCAL::pb::play::Response response; response.ParseFromString(service_response_.response); diff --git a/samples/cpp/services/ecalsys_client/src/ecalsys_client.cpp b/samples/cpp/services/ecalsys_client/src/ecalsys_client.cpp index 55dac2f1f4..abde99337a 100644 --- a/samples/cpp/services/ecalsys_client/src/ecalsys_client.cpp +++ b/samples/cpp/services/ecalsys_client/src/ecalsys_client.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ void OnSysResponse(const struct eCAL::SServiceResponse& service_response_) switch (service_response_.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { eCAL::pb::sys::Response response; response.ParseFromString(service_response_.response); @@ -47,7 +47,7 @@ void OnSysResponse(const struct eCAL::SServiceResponse& service_response_) } break; // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: { eCAL::pb::sys::Response response; response.ParseFromString(service_response_.response); diff --git a/samples/cpp/services/rec_client_service_cli/src/ecalrecorder_client.cpp b/samples/cpp/services/rec_client_service_cli/src/ecalrecorder_client.cpp index 924d5f85e3..0dedfd997b 100644 --- a/samples/cpp/services/rec_client_service_cli/src/ecalrecorder_client.cpp +++ b/samples/cpp/services/rec_client_service_cli/src/ecalrecorder_client.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ void OnRecorderResponse(const struct eCAL::SServiceResponse& service_response_) switch (service_response_.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { if (service_response_.method_name == "GetConfig") { @@ -58,7 +58,7 @@ void OnRecorderResponse(const struct eCAL::SServiceResponse& service_response_) } break; // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: { if (service_response_.method_name == "GetConfig") { diff --git a/samples/cpp/services/rec_client_service_gui/src/EcalrecGuiClient.cpp b/samples/cpp/services/rec_client_service_gui/src/EcalrecGuiClient.cpp index 5cdc38d143..9249250b0a 100644 --- a/samples/cpp/services/rec_client_service_gui/src/EcalrecGuiClient.cpp +++ b/samples/cpp/services/rec_client_service_gui/src/EcalrecGuiClient.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2018 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -226,7 +226,7 @@ void EcalrecGuiClient::onRecorderResponse(const struct eCAL::SServiceResponse& s switch (service_response_.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { if (service_response_.method_name == "GetConfig") { @@ -257,7 +257,7 @@ void EcalrecGuiClient::onRecorderResponse(const struct eCAL::SServiceResponse& s break; } // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: { eCAL::pb::rec_client::Response response; response.ParseFromString(service_response_.response); diff --git a/samples/cpp/services/rec_server_service_gui/src/rec_server_service_gui.cpp b/samples/cpp/services/rec_server_service_gui/src/rec_server_service_gui.cpp index 30742e78e1..25643262b7 100644 --- a/samples/cpp/services/rec_server_service_gui/src/rec_server_service_gui.cpp +++ b/samples/cpp/services/rec_server_service_gui/src/rec_server_service_gui.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2018 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -239,7 +239,7 @@ void RecServerServiceGui::onRecorderResponse(const struct eCAL::SServiceResponse { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { if ((service_response_.method_name == "StartRecording") || (service_response_.method_name == "SaveBuffer")) @@ -281,7 +281,7 @@ void RecServerServiceGui::onRecorderResponse(const struct eCAL::SServiceResponse } // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: { //eCAL::pb::Response response; //response.ParseFromString(response_); diff --git a/serialization/capnproto/samples/pubsub/addressbook_rec/src/addressbook_rec.cpp b/serialization/capnproto/samples/pubsub/addressbook_rec/src/addressbook_rec.cpp index ccca11db18..262463dbf4 100644 --- a/serialization/capnproto/samples/pubsub/addressbook_rec/src/addressbook_rec.cpp +++ b/serialization/capnproto/samples/pubsub/addressbook_rec/src/addressbook_rec.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,7 +80,7 @@ int main(int argc, char **argv) eCAL::Initialize("addressbook subscriber"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a subscriber (topic name "addressbook") eCAL::capnproto::CSubscriber sub("addressbook"); diff --git a/serialization/capnproto/samples/pubsub/addressbook_rec_cb/src/addressbook_rec_cb.cpp b/serialization/capnproto/samples/pubsub/addressbook_rec_cb/src/addressbook_rec_cb.cpp index d62461b019..5c79e0c3b9 100644 --- a/serialization/capnproto/samples/pubsub/addressbook_rec_cb/src/addressbook_rec_cb.cpp +++ b/serialization/capnproto/samples/pubsub/addressbook_rec_cb/src/addressbook_rec_cb.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,7 +88,7 @@ int main(int argc, char **argv) eCAL::Initialize("addressbook subscriber"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a subscriber (topic name "addressbook") eCAL::capnproto::CSubscriber sub("addressbook"); diff --git a/serialization/capnproto/samples/pubsub/addressbook_rec_dynamic/src/addressbook_rec_dynamic.cpp b/serialization/capnproto/samples/pubsub/addressbook_rec_dynamic/src/addressbook_rec_dynamic.cpp index 8546f2a130..019676b6a2 100644 --- a/serialization/capnproto/samples/pubsub/addressbook_rec_dynamic/src/addressbook_rec_dynamic.cpp +++ b/serialization/capnproto/samples/pubsub/addressbook_rec_dynamic/src/addressbook_rec_dynamic.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -110,7 +110,7 @@ int main(int argc, char** argv) // initialize eCAL API eCAL::Initialize("addressbook subscriber"); - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a subscriber (topic name "addressbook") eCAL::capnproto::CDynamicSubscriber sub("addressbook"); diff --git a/serialization/capnproto/samples/pubsub/addressbook_snd/src/addressbook_snd.cpp b/serialization/capnproto/samples/pubsub/addressbook_snd/src/addressbook_snd.cpp index 830d253988..a058b74f7e 100644 --- a/serialization/capnproto/samples/pubsub/addressbook_snd/src/addressbook_snd.cpp +++ b/serialization/capnproto/samples/pubsub/addressbook_snd/src/addressbook_snd.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ int main(int argc, char **argv) eCAL::Initialize("addressbook publisher"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a publisher (topic name "addressbook") eCAL::capnproto::CPublisher pub("addressbook"); diff --git a/serialization/flatbuffers/samples/pubsub/monster_rec/monster_rec.cpp b/serialization/flatbuffers/samples/pubsub/monster_rec/monster_rec.cpp index 9c5f972aa5..d39ccbfead 100644 --- a/serialization/flatbuffers/samples/pubsub/monster_rec/monster_rec.cpp +++ b/serialization/flatbuffers/samples/pubsub/monster_rec/monster_rec.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +79,7 @@ int main(int argc, char **argv) eCAL::Initialize("monster subscriber"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a subscriber (topic name "monster") eCAL::flatbuffers::CSubscriber sub("monster"); diff --git a/serialization/flatbuffers/samples/pubsub/monster_snd/monster_snd.cpp b/serialization/flatbuffers/samples/pubsub/monster_snd/monster_snd.cpp index 04bb9a16e9..d6305aa108 100644 --- a/serialization/flatbuffers/samples/pubsub/monster_snd/monster_snd.cpp +++ b/serialization/flatbuffers/samples/pubsub/monster_snd/monster_snd.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ int main(int argc, char **argv) eCAL::Initialize("monster publisher"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a publisher (topic name "monster") eCAL::flatbuffers::CPublisher pub("monster"); diff --git a/serialization/protobuf/samples/pubsub/person_events_rec/src/person_events_rec.cpp b/serialization/protobuf/samples/pubsub/person_events_rec/src/person_events_rec.cpp index 0680685696..338ac136bb 100644 --- a/serialization/protobuf/samples/pubsub/person_events_rec/src/person_events_rec.cpp +++ b/serialization/protobuf/samples/pubsub/person_events_rec/src/person_events_rec.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,21 +29,21 @@ void OnEvent(const char* topic_name_, const struct eCAL::v5::SSubEventCallbackDa std::cout << "topic name : " << topic_name_ << std::endl; switch (data_->type) { - case sub_event_connected: - std::cout << "event : " << "sub_event_connected" << std::endl; + case eCAL::eSubscriberEvent::connected: + std::cout << "event : " << "connected" << std::endl; break; - case sub_event_disconnected: - std::cout << "event : " << "sub_event_disconnected" << std::endl; + case eCAL::eSubscriberEvent::disconnected: + std::cout << "event : " << "disconnected" << std::endl; break; - case sub_event_dropped: - std::cout << "event : " << "sub_event_dropped (" << data_->clock << " messages)" << std::endl; + case eCAL::eSubscriberEvent::dropped: + std::cout << "event : " << "dropped (" << data_->clock << " messages)" << std::endl; break; // not implemented yet - case sub_event_corrupted: - std::cout << "event : " << "sub_event_corrupted" << std::endl; + case eCAL::eSubscriberEvent::corrupted: + std::cout << "event : " << "corrupted" << std::endl; break; - case sub_event_update_connection: - std::cout << "event : " << "sub_event_update_connection" << std::endl; + case eCAL::eSubscriberEvent::update_connection: + std::cout << "event : " << "update_connection" << std::endl; std::cout << " topic_id : " << data_->tid << std::endl; std::cout << " topic_encoding : " << data_->tdatatype.encoding << std::endl; std::cout << " topic_type : " << data_->tdatatype.name << std::endl; @@ -62,18 +62,18 @@ int main() eCAL::Initialize("person subscriber events"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a subscriber (topic name "person") eCAL::protobuf::CSubscriber sub("person"); // add event callback function (_1 = topic_name, _2 = event data struct) auto evt_callback = std::bind(OnEvent, std::placeholders::_1, std::placeholders::_2); - sub.AddEventCallback(sub_event_connected, evt_callback); - sub.AddEventCallback(sub_event_disconnected, evt_callback); - sub.AddEventCallback(sub_event_dropped, evt_callback); - sub.AddEventCallback(sub_event_corrupted, evt_callback); - sub.AddEventCallback(sub_event_update_connection, evt_callback); + sub.AddEventCallback(eCAL::eSubscriberEvent::connected, evt_callback); + sub.AddEventCallback(eCAL::eSubscriberEvent::disconnected, evt_callback); + sub.AddEventCallback(eCAL::eSubscriberEvent::dropped, evt_callback); + sub.AddEventCallback(eCAL::eSubscriberEvent::corrupted, evt_callback); + sub.AddEventCallback(eCAL::eSubscriberEvent::update_connection, evt_callback); // start application and wait for events std::cout << "Please start 'person_snd_events sample." << std::endl << std::endl; diff --git a/serialization/protobuf/samples/pubsub/person_events_snd/src/person_events_snd.cpp b/serialization/protobuf/samples/pubsub/person_events_snd/src/person_events_snd.cpp index 13f3efdf31..6e41f3a143 100644 --- a/serialization/protobuf/samples/pubsub/person_events_snd/src/person_events_snd.cpp +++ b/serialization/protobuf/samples/pubsub/person_events_snd/src/person_events_snd.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,18 +29,18 @@ void OnEvent(const char* topic_name_, const struct eCAL::v5::SPubEventCallbackDa std::cout << "topic name : " << topic_name_ << std::endl; switch (data_->type) { - case pub_event_connected: - std::cout << "event : " << "pub_event_connected" << std::endl; + case eCAL::ePublisherEvent::connected: + std::cout << "event : " << "connected" << std::endl; break; - case pub_event_disconnected: - std::cout << "event : " << "pub_event_disconnected" << std::endl; + case eCAL::ePublisherEvent::disconnected: + std::cout << "event : " << "disconnected" << std::endl; break; // not implemented yet - case pub_event_dropped: - std::cout << "event : " << "pub_event_dropped" << std::endl; + case eCAL::ePublisherEvent::dropped: + std::cout << "event : " << "dropped" << std::endl; break; - case pub_event_update_connection: - std::cout << "event : " << "pub_event_update_connection" << std::endl; + case eCAL::ePublisherEvent::update_connection: + std::cout << "event : " << "update_connection" << std::endl; std::cout << " topic_id : " << data_->tid << std::endl; std::cout << " topic_encoding : " << data_->tdatatype.encoding << std::endl; std::cout << " topic_type : " << data_->tdatatype.name << std::endl; @@ -59,16 +59,16 @@ int main() eCAL::Initialize("person publisher events"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a publisher (topic name "person") eCAL::protobuf::CPublisher pub("person"); // add event callback function (_1 = topic_name, _2 = event data struct) auto evt_callback = std::bind(OnEvent, std::placeholders::_1, std::placeholders::_2); - pub.AddEventCallback(pub_event_connected, evt_callback); - pub.AddEventCallback(pub_event_disconnected, evt_callback); - pub.AddEventCallback(pub_event_update_connection, evt_callback); + pub.AddEventCallback(eCAL::ePublisherEvent::connected, evt_callback); + pub.AddEventCallback(eCAL::ePublisherEvent::disconnected, evt_callback); + pub.AddEventCallback(eCAL::ePublisherEvent::update_connection, evt_callback); // generate a class instance of Person pb::People::Person person; diff --git a/serialization/protobuf/samples/pubsub/person_loopback/src/person_loopback.cpp b/serialization/protobuf/samples/pubsub/person_loopback/src/person_loopback.cpp index 38680aea6e..1a91f30fda 100644 --- a/serialization/protobuf/samples/pubsub/person_loopback/src/person_loopback.cpp +++ b/serialization/protobuf/samples/pubsub/person_loopback/src/person_loopback.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ int main() eCAL::Initialize("person publisher"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a publisher (topic name "person") eCAL::protobuf::CPublisher pub("person"); diff --git a/serialization/protobuf/samples/pubsub/person_rec/src/person_rec.cpp b/serialization/protobuf/samples/pubsub/person_rec/src/person_rec.cpp index 9abb00d137..58fd537a6e 100644 --- a/serialization/protobuf/samples/pubsub/person_rec/src/person_rec.cpp +++ b/serialization/protobuf/samples/pubsub/person_rec/src/person_rec.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ int main() eCAL::Initialize("person subscriber"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a subscriber config eCAL::Subscriber::Configuration sub_config; diff --git a/serialization/protobuf/samples/pubsub/person_snd/src/person_snd.cpp b/serialization/protobuf/samples/pubsub/person_snd/src/person_snd.cpp index 093e171cda..4fa3821a7d 100644 --- a/serialization/protobuf/samples/pubsub/person_snd/src/person_snd.cpp +++ b/serialization/protobuf/samples/pubsub/person_snd/src/person_snd.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ int main() eCAL::Initialize("person publisher"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a publisher (topic name "person") eCAL::protobuf::CPublisher pub("person"); diff --git a/serialization/protobuf/samples/pubsub/person_snd_tcp/src/person_snd_tcp.cpp b/serialization/protobuf/samples/pubsub/person_snd_tcp/src/person_snd_tcp.cpp index 7e10d90f8a..8a1f6a32b5 100644 --- a/serialization/protobuf/samples/pubsub/person_snd_tcp/src/person_snd_tcp.cpp +++ b/serialization/protobuf/samples/pubsub/person_snd_tcp/src/person_snd_tcp.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ int main() eCAL::Initialize("person publisher tcp"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a publisher config eCAL::Publisher::Configuration pub_config; diff --git a/serialization/protobuf/samples/pubsub/person_snd_udp/src/person_snd_udp.cpp b/serialization/protobuf/samples/pubsub/person_snd_udp/src/person_snd_udp.cpp index a1004ca69e..fdfe835ec3 100644 --- a/serialization/protobuf/samples/pubsub/person_snd_udp/src/person_snd_udp.cpp +++ b/serialization/protobuf/samples/pubsub/person_snd_udp/src/person_snd_udp.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ int main() eCAL::Initialize("person publisher multicast"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a publisher config eCAL::Publisher::Configuration pub_config; diff --git a/serialization/protobuf/samples/pubsub/proto_dyn_snd/src/proto_dyn_snd.cpp b/serialization/protobuf/samples/pubsub/proto_dyn_snd/src/proto_dyn_snd.cpp index 6b9c243319..f80ecb30c1 100644 --- a/serialization/protobuf/samples/pubsub/proto_dyn_snd/src/proto_dyn_snd.cpp +++ b/serialization/protobuf/samples/pubsub/proto_dyn_snd/src/proto_dyn_snd.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ int main() eCAL::Initialize("person publisher dynamic"); // set process state - eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); + eCAL::Process::SetState(eCAL::Process::eSeverity::healthy, eCAL::Process::eSeverityLevel::level1, "I feel good !"); // create a dynamic publisher (topic name "person") eCAL::protobuf::CDynamicPublisher pub1("person", std::make_shared()); diff --git a/serialization/protobuf/samples/services/math_client/src/math_client.cpp b/serialization/protobuf/samples/services/math_client/src/math_client.cpp index 6579415c29..e1a41bf09e 100644 --- a/serialization/protobuf/samples/services/math_client/src/math_client.cpp +++ b/serialization/protobuf/samples/services/math_client/src/math_client.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,17 +33,17 @@ void OnClientState(const eCAL::v5::SClientEventCallbackData* data_) switch (data_->type) { - case client_event_connected: + case eCAL::eClientEvent::connected: std::cout << "---------------------------------" << std::endl; std::cout << "Client connected to service " << std::endl; std::cout << "---------------------------------" << std::endl; break; - case client_event_disconnected: + case eCAL::eClientEvent::disconnected: std::cout << "---------------------------------" << std::endl; std::cout << "Client disconnected from service " << std::endl; std::cout << "---------------------------------" << std::endl; break; - case client_event_timeout: + case eCAL::eClientEvent::timeout: std::cout << "---------------------------------" << std::endl; std::cout << "Client request timeouted " << std::endl; std::cout << "---------------------------------" << std::endl; @@ -67,7 +67,7 @@ void OnMathResponse(const struct eCAL::SServiceResponse& service_response_) switch(service_response_.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { SFloat response; response.ParseFromString(service_response_.response); @@ -75,7 +75,7 @@ void OnMathResponse(const struct eCAL::SServiceResponse& service_response_) } break; // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: std::cout << "Received error MathService / " << service_response_.method_name << " : " << service_response_.error_msg << " from host " << service_response_.host_name << std::endl; break; default: @@ -96,9 +96,9 @@ int main() math_client.AddResponseCallback(OnMathResponse); // add event callbacks - math_client.AddEventCallback(client_event_connected, std::bind(OnClientState, std::placeholders::_2)); - math_client.AddEventCallback(client_event_disconnected, std::bind(OnClientState, std::placeholders::_2)); - math_client.AddEventCallback(client_event_timeout, std::bind(OnClientState, std::placeholders::_2)); + math_client.AddEventCallback(eCAL::eClientEvent::connected, std::bind(OnClientState, std::placeholders::_2)); + math_client.AddEventCallback(eCAL::eClientEvent::disconnected, std::bind(OnClientState, std::placeholders::_2)); + math_client.AddEventCallback(eCAL::eClientEvent::timeout, std::bind(OnClientState, std::placeholders::_2)); // loop variables int inp1(0); diff --git a/serialization/protobuf/samples/services/math_server/src/math_server.cpp b/serialization/protobuf/samples/services/math_server/src/math_server.cpp index 1cbd9fb0ed..9feaa37f7d 100644 --- a/serialization/protobuf/samples/services/math_server/src/math_server.cpp +++ b/serialization/protobuf/samples/services/math_server/src/math_server.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,12 +68,12 @@ void OnServerEvent(const eCAL::v5::SServerEventCallbackData* data_) switch (data_->type) { - case server_event_connected: + case eCAL::eServerEvent::connected: std::cout << "-----------------------------------" << std::endl; std::cout << "Server connected " << std::endl; std::cout << "-----------------------------------" << std::endl; break; - case server_event_disconnected: + case eCAL::eServerEvent::disconnected: std::cout << "-----------------------------------" << std::endl; std::cout << "Server disconnected " << std::endl; std::cout << "-----------------------------------" << std::endl; @@ -95,8 +95,8 @@ int main() eCAL::protobuf::CServiceServer math_server(math_service); // register event callbacks - math_server.AddEventCallback(server_event_connected, std::bind(OnServerEvent, std::placeholders::_2)); - math_server.AddEventCallback(server_event_disconnected, std::bind(OnServerEvent, std::placeholders::_2)); + math_server.AddEventCallback(eCAL::eServerEvent::connected, std::bind(OnServerEvent, std::placeholders::_2)); + math_server.AddEventCallback(eCAL::eServerEvent::disconnected, std::bind(OnServerEvent, std::placeholders::_2)); while(eCAL::Ok()) { diff --git a/serialization/protobuf/samples/services/ping_client/src/ping_client.cpp b/serialization/protobuf/samples/services/ping_client/src/ping_client.cpp index 5668075c9b..a55d29ce49 100644 --- a/serialization/protobuf/samples/services/ping_client/src/ping_client.cpp +++ b/serialization/protobuf/samples/services/ping_client/src/ping_client.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,7 +61,7 @@ int main() switch (service_response.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { PingResponse ping_response; ping_response.ParseFromString(service_response.response); @@ -69,7 +69,7 @@ int main() } break; // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: std::cout << "Received error PingService / Ping : " << service_response.error_msg << " from host " << service_response.host_name << std::endl; break; default: diff --git a/serialization/protobuf/samples/services/ping_client_dyn/src/ping_client_dyn.cpp b/serialization/protobuf/samples/services/ping_client_dyn/src/ping_client_dyn.cpp index 720a13e98f..26e882aa93 100644 --- a/serialization/protobuf/samples/services/ping_client_dyn/src/ping_client_dyn.cpp +++ b/serialization/protobuf/samples/services/ping_client_dyn/src/ping_client_dyn.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,14 +105,14 @@ int main() switch (service_response.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { const std::string resp_json = GetJSONFromSerialzedMessage(resp_msg.get(), service_response.response); std::cout << "Received response PingService / Ping (JSON) : " << resp_json << " from host " << service_response.service_method_id.service_id.host_name << '\n'; } break; // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: std::cout << "Received error PingService / Ping : " << service_response.error_msg << " from host " << service_response.service_method_id.service_id.host_name << '\n'; break; default: diff --git a/serialization/protobuf/tests/clientserver_proto_test/src/clientserver_test_proto.cpp b/serialization/protobuf/tests/clientserver_proto_test/src/clientserver_test_proto.cpp index 8deab5419a..eb30615ca8 100644 --- a/serialization/protobuf/tests/clientserver_proto_test/src/clientserver_test_proto.cpp +++ b/serialization/protobuf/tests/clientserver_proto_test/src/clientserver_test_proto.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,7 +88,7 @@ TEST(core_cpp_clientserver_proto, ProtoCallback) switch (service_response_.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { SFloat response; response.ParseFromString(service_response_.response); @@ -97,7 +97,7 @@ TEST(core_cpp_clientserver_proto, ProtoCallback) } break; // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: std::cout << "Received error MathService / " << service_response_.method_name << " : " << service_response_.error_msg << " from host " << service_response_.host_name << std::endl; break; default: @@ -180,11 +180,11 @@ TEST(core_cpp_clientserver_proto, ProtoBlocking) std::cout << std::endl << "Ping method called with message : " << ping_request.message() << std::endl; for (const auto& service_response : service_response_vec) { - EXPECT_EQ(call_state_executed, service_response.call_state); + EXPECT_EQ(eCAL::eCallState::executed, service_response.call_state); switch (service_response.call_state) { // service successful executed - case call_state_executed: + case eCAL::eCallState::executed: { PingResponse response; response.ParseFromString(service_response.response); @@ -193,7 +193,7 @@ TEST(core_cpp_clientserver_proto, ProtoBlocking) } break; // service execution failed - case call_state_failed: + case eCAL::eCallState::failed: std::cout << "Received error PingService / Ping : " << service_response.error_msg << " from host " << service_response.host_name << std::endl; break; default: