diff --git a/doc/rst/configuration/runtime_configuration.rst b/doc/rst/configuration/runtime_configuration.rst index 5a05eed558..19b75e2415 100644 --- a/doc/rst/configuration/runtime_configuration.rst +++ b/doc/rst/configuration/runtime_configuration.rst @@ -35,7 +35,7 @@ The size object can be used like a normal integer. eCAL::Config::ConstrainedInteger<1024, 512, 8192> size_4mb = 1024 + 6 * 512; std::cout << size_4mb << "\n"; -For specifying sizes in the ecal configuration object, refer to the .ini file or "ecal/types/ecal_config_types.h" for the limitations. +For specifying sizes in the ecal configuration object, refer to the .ini file or "ecal/config/ecal_configuration.h" for the limitations. Initialization of the configuration =================================== diff --git a/ecal/core/CMakeLists.txt b/ecal/core/CMakeLists.txt index 5492549390..d976db47cb 100644 --- a/ecal/core/CMakeLists.txt +++ b/ecal/core/CMakeLists.txt @@ -478,7 +478,7 @@ set(ecal_header_cmn include/ecal/ecal_tlayer.h include/ecal/ecal_types.h include/ecal/ecal_util.h - include/ecal/types/ecal_config_types.h + include/ecal/config/ecal_configuration.h ) set(ecal_header_cimpl diff --git a/ecal/core/include/ecal/types/ecal_application_options.h b/ecal/core/include/ecal/config/ecal_application_config.h similarity index 92% rename from ecal/core/include/ecal/types/ecal_application_options.h rename to ecal/core/include/ecal/config/ecal_application_config.h index 42ecd79a38..cdf3574d04 100644 --- a/ecal/core/include/ecal/types/ecal_application_options.h +++ b/ecal/core/include/ecal/config/ecal_application_config.h @@ -18,8 +18,8 @@ */ /** - * @file ecal_application_options.h - * @brief eCAL options for configuration of applications + * @file ecal_application_config.h + * @brief eCAL configuration for applications **/ #pragma once diff --git a/ecal/core/include/ecal/types/ecal_config_types.h b/ecal/core/include/ecal/config/ecal_configuration.h similarity index 69% rename from ecal/core/include/ecal/types/ecal_config_types.h rename to ecal/core/include/ecal/config/ecal_configuration.h index 8c3f6acb1b..dbc2f8a9c0 100644 --- a/ecal/core/include/ecal/types/ecal_config_types.h +++ b/ecal/core/include/ecal/config/ecal_configuration.h @@ -18,23 +18,23 @@ */ /** - * @file ecal_config_types.h - * @brief eCAL config interface using structs + * @file ecal_configuration.h + * @brief eCAL configuration interface **/ #pragma once -#include "ecal_application_options.h" -#include "ecal_custom_data_types.h" -#include "ecal_monitoring_options.h" -#include "ecal_publisher_options.h" -#include "ecal_registration_options.h" -#include "ecal_service_options.h" -#include "ecal_logging_options.h" -#include "ecal_transport_layer_options.h" -#include "user_arg_options.h" -#include "ecal/config/ecal_publisher_config.h" -#include "ecal/config/ecal_subscriber_config.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "ecal/ecal_os.h" #include "ecal/ecal_log_level.h" @@ -49,14 +49,14 @@ namespace eCAL struct Configuration { TransportLayer::Configuration transport_layer{}; - Config::RegistrationOptions registration{}; - Config::MonitoringOptions monitoring{}; + Registration::Configuration registration{}; + Monitoring::Configuration monitoring{}; Subscriber::Configuration subscriber{}; Publisher::Configuration publisher{}; - Config::TimesyncOptions timesync{}; - Config::ServiceOptions service{}; + Service::TimesyncOptions timesync{}; + Service::Configuration service{}; Application::Configuration application{}; - Config::LoggingOptions logging{}; + Logging::Configuration logging{}; Cli::Configuration command_line_arguments{}; ECAL_API Configuration(); diff --git a/ecal/core/include/ecal/types/ecal_logging_options.h b/ecal/core/include/ecal/config/ecal_logging_config.h similarity index 88% rename from ecal/core/include/ecal/types/ecal_logging_options.h rename to ecal/core/include/ecal/config/ecal_logging_config.h index e48c9a70a3..8555abe5ca 100644 --- a/ecal/core/include/ecal/types/ecal_logging_options.h +++ b/ecal/core/include/ecal/config/ecal_logging_config.h @@ -18,8 +18,8 @@ */ /** - * @file ecal_logging_options.h - * @brief eCAL options for logging configuration + * @file ecal_logging_config.h + * @brief eCAL configuration for logging **/ #pragma once @@ -28,9 +28,9 @@ namespace eCAL { - namespace Config + namespace Logging { - struct LoggingOptions + struct Configuration { eCAL_Logging_Filter filter_log_con{}; eCAL_Logging_Filter filter_log_file{}; diff --git a/ecal/core/include/ecal/types/ecal_monitoring_options.h b/ecal/core/include/ecal/config/ecal_monitoring_config.h similarity index 50% rename from ecal/core/include/ecal/types/ecal_monitoring_options.h rename to ecal/core/include/ecal/config/ecal_monitoring_config.h index 9b196c6b14..88382a5bb4 100644 --- a/ecal/core/include/ecal/types/ecal_monitoring_options.h +++ b/ecal/core/include/ecal/config/ecal_monitoring_config.h @@ -18,45 +18,53 @@ */ /** - * @file ecal_monitoring_options.h - * @brief eCAL options for monitoring configuration + * @file ecal_monitoring_config.h + * @brief eCAL configuration for monitoring **/ #pragma once -#include "ecal_custom_data_types.h" +#include namespace eCAL { - namespace Config + namespace Monitoring { - enum MonitoringMode + namespace Types { - none = 0, - udp_monitoring = 1 << 0, - shm_monitoring = 1 << 1 - }; + enum Mode + { + none = 0, + udp_monitoring = 1 << 0, + shm_monitoring = 1 << 1 + }; - using eCAL_MonitoringMode_Filter = char; + using Mode_Filter = char; + } - struct UDPMonitoringOptions + namespace UDP { - // Here? - }; + struct Configuration + { + }; + } - struct SHMMonitoringOptions + namespace SHM { - std::string shm_monitoring_domain{}; - size_t shm_monitoring_queue_size{}; - }; + struct Configuration + { + std::string shm_monitoring_domain{}; + size_t shm_monitoring_queue_size{}; + }; + } - struct MonitoringOptions + struct Configuration { - eCAL_MonitoringMode_Filter monitoring_mode{}; - ConstrainedInteger<1000, 1000> monitoring_timeout{}; - bool network_monitoring{}; - UDPMonitoringOptions udp_options{}; - SHMMonitoringOptions shm_options{}; + Types::Mode_Filter monitoring_mode{}; + eCAL::Types::ConstrainedInteger<1000, 1000> monitoring_timeout{}; + bool network_monitoring{}; + UDP::Configuration udp_options{}; + SHM::Configuration shm_options{}; std::string filter_excl{}; std::string filter_incl{}; diff --git a/ecal/core/include/ecal/config/ecal_publisher_config.h b/ecal/core/include/ecal/config/ecal_publisher_config.h index c6167a6350..7f5363d6ff 100644 --- a/ecal/core/include/ecal/config/ecal_publisher_config.h +++ b/ecal/core/include/ecal/config/ecal_publisher_config.h @@ -105,9 +105,9 @@ namespace eCAL bool zero_copy_mode; //!< enable zero copy shared memory transport mode unsigned int acknowledge_timeout_ms; /*!< force connected subscribers to send acknowledge event after processing the message the publisher send call is blocked on this event with this timeout (0 == no handshake) */ - Config::ConstrainedInteger<4096, 4096> memfile_min_size_bytes; //!< default memory file size for new publisher - Config::ConstrainedInteger<50, 1, 100> memfile_reserve_percent; //!< dynamic file size reserve before recreating memory file if topic size changes - Config::ConstrainedInteger<1, 1> memfile_buffer_count; //!< maximum number of used buffers (needs to be greater than 1, default = 1) + Types::ConstrainedInteger<4096, 4096> memfile_min_size_bytes; //!< default memory file size for new publisher + Types::ConstrainedInteger<50, 1, 100> memfile_reserve_percent; //!< dynamic file size reserve before recreating memory file if topic size changes + Types::ConstrainedInteger<1, 1> memfile_buffer_count; //!< maximum number of used buffers (needs to be greater than 1, default = 1) }; } @@ -117,7 +117,7 @@ namespace eCAL { bool enable; //!< enable layer bool loopback; //!< enable to receive udp messages on the same local machine - Config::ConstrainedInteger<5242880, 1024> sndbuf_size_bytes; //!< udp send buffer size in bytes (default 5MB) + Types::ConstrainedInteger<5242880, 1024> sndbuf_size_bytes; //!< udp send buffer size in bytes (default 5MB) }; } diff --git a/ecal/core/include/ecal/types/ecal_registration_options.h b/ecal/core/include/ecal/config/ecal_registration_config.h similarity index 85% rename from ecal/core/include/ecal/types/ecal_registration_options.h rename to ecal/core/include/ecal/config/ecal_registration_config.h index 131fff26bb..777eeb3370 100644 --- a/ecal/core/include/ecal/types/ecal_registration_options.h +++ b/ecal/core/include/ecal/config/ecal_registration_config.h @@ -18,8 +18,8 @@ */ /** - * @file ecal_registration_options.h - * @brief eCAL options for configuration of the registration layer + * @file ecal_registration_config.h + * @brief eCAL configuration for the registration layer **/ #pragma once @@ -31,7 +31,7 @@ namespace eCAL { - namespace Config + namespace Registration { /** * @brief Struct for storing RegistrationOptions. @@ -44,11 +44,11 @@ namespace eCAL * * @throws std::invalid_argument exception. **/ - struct RegistrationOptions + struct Configuration { public: - ECAL_API RegistrationOptions(); - ECAL_API RegistrationOptions(unsigned int reg_timeout_, unsigned int reg_refresh_); + ECAL_API Configuration(); + ECAL_API Configuration(unsigned int reg_timeout_, unsigned int reg_refresh_); ECAL_API unsigned int getTimeoutMS() const; ECAL_API unsigned int getRefreshMS() const; diff --git a/ecal/core/include/ecal/types/ecal_service_options.h b/ecal/core/include/ecal/config/ecal_service_config.h similarity index 88% rename from ecal/core/include/ecal/types/ecal_service_options.h rename to ecal/core/include/ecal/config/ecal_service_config.h index 802eecc17a..a77abc0f0b 100644 --- a/ecal/core/include/ecal/types/ecal_service_options.h +++ b/ecal/core/include/ecal/config/ecal_service_config.h @@ -18,8 +18,8 @@ */ /** - * @file ecal_service_options.h - * @brief eCAL options for configuration of services + * @file ecal_service_config.h + * @brief eCAL configuration for services **/ #pragma once @@ -28,9 +28,9 @@ namespace eCAL { - namespace Config + namespace Service { - struct ServiceOptions + struct Configuration { bool protocol_v0{}; bool protocol_v1{}; diff --git a/ecal/core/include/ecal/types/ecal_transport_layer_options.h b/ecal/core/include/ecal/config/ecal_transport_layer_config.h similarity index 67% rename from ecal/core/include/ecal/types/ecal_transport_layer_options.h rename to ecal/core/include/ecal/config/ecal_transport_layer_config.h index 72cc2b9d65..9261812bb0 100644 --- a/ecal/core/include/ecal/types/ecal_transport_layer_options.h +++ b/ecal/core/include/ecal/config/ecal_transport_layer_config.h @@ -18,13 +18,14 @@ */ /** - * @file ecal_transport_layer_options.h - * @brief eCAL options for configuration of the transport layer + * @file ecal_transport_layer_config.h + * @brief eCAL configuration for the transport layer **/ +// TODO PG: Deprecated? #pragma once -#include "ecal_custom_data_types.h" +#include namespace eCAL { @@ -40,25 +41,25 @@ namespace eCAL struct SHMOptions { std::string host_group_name{}; - Config::ConstrainedInteger<4096, 4096> memfile_minsize{}; - Config::ConstrainedInteger<50, 1, 100> memfile_reserve{}; + Types::ConstrainedInteger<4096, 4096> memfile_minsize{}; + Types::ConstrainedInteger<50, 1, 100> memfile_reserve{}; int memfile_ack_timeout{}; - Config::ConstrainedInteger<0, 1> memfile_buffer_count{}; + Types::ConstrainedInteger<0, 1> memfile_buffer_count{}; bool drop_out_of_order_messages{}; bool memfile_zero_copy{}; }; struct UdpMulticastOptions { - Config::UdpConfigVersion config_version{}; - Config::IpAddressV4 group{}; - Config::IpAddressV4 mask{}; - Config::ConstrainedInteger<14000, 10> port{}; - unsigned int ttl{}; + Types::UdpConfigVersion config_version{}; + Types::IpAddressV4 group{}; + Types::IpAddressV4 mask{}; + Types::ConstrainedInteger<14000, 10> port{}; + unsigned int ttl{}; // TODO PG: are these minimum limits correct? - Config::ConstrainedInteger<5242880, 1024> sndbuf{}; - Config::ConstrainedInteger<5242880, 1024> recbuf{}; - bool join_all_interfaces{}; + Types::ConstrainedInteger<5242880, 1024> sndbuf{}; + Types::ConstrainedInteger<5242880, 1024> recbuf{}; + bool join_all_interfaces{}; int bandwidth_max_udp{}; bool npcap_enabled{}; diff --git a/ecal/core/include/ecal/types/user_arg_options.h b/ecal/core/include/ecal/config/user_arguments.h similarity index 93% rename from ecal/core/include/ecal/types/user_arg_options.h rename to ecal/core/include/ecal/config/user_arguments.h index 591f847f15..d2ce561374 100644 --- a/ecal/core/include/ecal/types/user_arg_options.h +++ b/ecal/core/include/ecal/config/user_arguments.h @@ -18,8 +18,8 @@ */ /** - * @file user_arg_options.h - * @brief Options specified by the user via command line + * @file user_arguments.h + * @brief Arguments given by the user via command line **/ #pragma once diff --git a/ecal/core/include/ecal/ecal.h b/ecal/core/include/ecal/ecal.h index d341077808..813dfa4ee2 100644 --- a/ecal/core/include/ecal/ecal.h +++ b/ecal/core/include/ecal/ecal.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2024 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,4 +42,4 @@ #include #include #include -#include +#include diff --git a/ecal/core/include/ecal/ecal_config.h b/ecal/core/include/ecal/ecal_config.h index d86f7ee3ca..003f93dc30 100644 --- a/ecal/core/include/ecal/ecal_config.h +++ b/ecal/core/include/ecal/ecal_config.h @@ -23,7 +23,7 @@ #include #include #include -#include "ecal/types/ecal_config_types.h" +#include "ecal/config/ecal_configuration.h" #include @@ -38,100 +38,100 @@ namespace eCAL // common ///////////////////////////////////// - ECAL_API std::string GetLoadedEcalIniPath (); - ECAL_API int GetRegistrationTimeoutMs (); - ECAL_API int GetRegistrationRefreshMs (); + ECAL_API std::string GetLoadedEcalIniPath (); + ECAL_API int GetRegistrationTimeoutMs (); + ECAL_API int GetRegistrationRefreshMs (); ///////////////////////////////////// // network ///////////////////////////////////// - ECAL_API bool IsNetworkEnabled (); - ECAL_API UdpConfigVersion GetUdpMulticastConfigVersion (); - ECAL_API std::string GetUdpMulticastGroup (); - ECAL_API std::string GetUdpMulticastMask (); - ECAL_API int GetUdpMulticastPort (); - ECAL_API int GetUdpMulticastTtl (); + ECAL_API bool IsNetworkEnabled (); + ECAL_API Types::UdpConfigVersion GetUdpMulticastConfigVersion (); + ECAL_API std::string GetUdpMulticastGroup (); + ECAL_API std::string GetUdpMulticastMask (); + ECAL_API int GetUdpMulticastPort (); + ECAL_API int GetUdpMulticastTtl (); - ECAL_API int GetUdpMulticastSndBufSizeBytes (); - ECAL_API int GetUdpMulticastRcvBufSizeBytes (); + ECAL_API int GetUdpMulticastSndBufSizeBytes (); + ECAL_API int GetUdpMulticastRcvBufSizeBytes (); - ECAL_API bool IsUdpMulticastJoinAllIfEnabled (); + ECAL_API bool IsUdpMulticastJoinAllIfEnabled (); - ECAL_API bool IsUdpMulticastRecEnabled (); - ECAL_API bool IsShmRecEnabled (); - ECAL_API bool IsTcpRecEnabled (); + ECAL_API bool IsUdpMulticastRecEnabled (); + ECAL_API bool IsShmRecEnabled (); + ECAL_API bool IsTcpRecEnabled (); - ECAL_API bool IsNpcapEnabled (); + ECAL_API bool IsNpcapEnabled (); - ECAL_API int GetTcpPubsubReaderThreadpoolSize (); - ECAL_API int GetTcpPubsubWriterThreadpoolSize (); - ECAL_API int GetTcpPubsubMaxReconnectionAttemps (); + ECAL_API int GetTcpPubsubReaderThreadpoolSize (); + ECAL_API int GetTcpPubsubWriterThreadpoolSize (); + ECAL_API int GetTcpPubsubMaxReconnectionAttemps (); - ECAL_API std::string GetHostGroupName (); + ECAL_API std::string GetHostGroupName (); ///////////////////////////////////// // time ///////////////////////////////////// - ECAL_API std::string GetTimesyncModuleName (); - ECAL_API std::string GetTimesyncModuleReplay (); + ECAL_API std::string GetTimesyncModuleName (); + ECAL_API std::string GetTimesyncModuleReplay (); ///////////////////////////////////// // process ///////////////////////////////////// - ECAL_API std::string GetTerminalEmulatorCommand (); + ECAL_API std::string GetTerminalEmulatorCommand (); ///////////////////////////////////// // monitoring ///////////////////////////////////// - ECAL_API int GetMonitoringTimeoutMs (); - ECAL_API std::string GetMonitoringFilterExcludeList (); - ECAL_API std::string GetMonitoringFilterIncludeList (); - ECAL_API eCAL_Logging_Filter GetConsoleLogFilter (); - ECAL_API eCAL_Logging_Filter GetFileLogFilter (); - ECAL_API eCAL_Logging_Filter GetUdpLogFilter (); + ECAL_API int GetMonitoringTimeoutMs (); + ECAL_API std::string GetMonitoringFilterExcludeList (); + ECAL_API std::string GetMonitoringFilterIncludeList (); + ECAL_API eCAL_Logging_Filter GetConsoleLogFilter (); + ECAL_API eCAL_Logging_Filter GetFileLogFilter (); + ECAL_API eCAL_Logging_Filter GetUdpLogFilter (); ///////////////////////////////////// // sys ///////////////////////////////////// - ECAL_API std::string GetEcalSysFilterExcludeList (); + ECAL_API std::string GetEcalSysFilterExcludeList (); ///////////////////////////////////// // publisher ///////////////////////////////////// - ECAL_API bool GetPublisherShmMode (); - ECAL_API bool GetPublisherTcpMode (); - ECAL_API bool GetPublisherUdpMulticastMode (); + ECAL_API bool GetPublisherShmMode (); + ECAL_API bool GetPublisherTcpMode (); + ECAL_API bool GetPublisherUdpMulticastMode (); - ECAL_API size_t GetMemfileMinsizeBytes (); - ECAL_API size_t GetMemfileOverprovisioningPercentage (); - ECAL_API int GetMemfileAckTimeoutMs (); - ECAL_API bool IsMemfileZerocopyEnabled (); - ECAL_API size_t GetMemfileBufferCount (); + ECAL_API size_t GetMemfileMinsizeBytes (); + ECAL_API size_t GetMemfileOverprovisioningPercentage (); + ECAL_API int GetMemfileAckTimeoutMs (); + ECAL_API bool IsMemfileZerocopyEnabled (); + ECAL_API size_t GetMemfileBufferCount (); - ECAL_API bool IsTopicTypeSharingEnabled (); - ECAL_API bool IsTopicDescriptionSharingEnabled (); + ECAL_API bool IsTopicTypeSharingEnabled (); + ECAL_API bool IsTopicDescriptionSharingEnabled (); ///////////////////////////////////// // service ///////////////////////////////////// - ECAL_API bool IsServiceProtocolV0Enabled (); - ECAL_API bool IsServiceProtocolV1Enabled (); + ECAL_API bool IsServiceProtocolV0Enabled (); + ECAL_API bool IsServiceProtocolV1Enabled (); ///////////////////////////////////// // experimental ///////////////////////////////////// namespace Experimental { - ECAL_API bool IsShmMonitoringEnabled (); - ECAL_API bool IsNetworkMonitoringDisabled (); - ECAL_API size_t GetShmMonitoringQueueSize (); - ECAL_API std::string GetShmMonitoringDomain (); - ECAL_API bool GetDropOutOfOrderMessages (); + ECAL_API bool IsShmMonitoringEnabled (); + ECAL_API bool IsNetworkMonitoringDisabled (); + ECAL_API size_t GetShmMonitoringQueueSize (); + ECAL_API std::string GetShmMonitoringDomain (); + ECAL_API bool GetDropOutOfOrderMessages (); } } } diff --git a/ecal/core/include/ecal/ecal_core.h b/ecal/core/include/ecal/ecal_core.h index 743e5d82a1..f8c714b03e 100644 --- a/ecal/core/include/ecal/ecal_core.h +++ b/ecal/core/include/ecal/ecal_core.h @@ -31,7 +31,7 @@ #include #include -#include +#include namespace eCAL { diff --git a/ecal/core/include/ecal/types/ecal_custom_data_types.h b/ecal/core/include/ecal/types/ecal_custom_data_types.h index bf7ffb0d57..671ceb9b73 100644 --- a/ecal/core/include/ecal/types/ecal_custom_data_types.h +++ b/ecal/core/include/ecal/types/ecal_custom_data_types.h @@ -33,7 +33,7 @@ namespace eCAL { - namespace Config + namespace Types { /** * @brief Class for evaluation and storing an IPv4/IPv6 address. diff --git a/ecal/core/include/ecal/types/ecal_publisher_options.h b/ecal/core/include/ecal/types/ecal_publisher_options.h deleted file mode 100644 index 9d3a24f86d..0000000000 --- a/ecal/core/include/ecal/types/ecal_publisher_options.h +++ /dev/null @@ -1,40 +0,0 @@ -/* =========================== LICENSE ================================= - * - * Copyright (C) 2016 - 2024 Continental Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * =========================== LICENSE ================================= - */ - -/** - * @file ecal_publisher_options.h - * @brief eCAL options for configuration of the publisher -**/ - -#pragma once - -#include - -namespace eCAL -{ - namespace Config - { - struct PublisherOptions - { - TLayer::eSendMode use_shm{}; - TLayer::eSendMode use_tcp{}; - TLayer::eSendMode use_udp_mc{}; - }; - } -} \ No newline at end of file diff --git a/ecal/core/src/config/ecal_cmd_parser.h b/ecal/core/src/config/ecal_cmd_parser.h index e723083b8c..ee4fc87dee 100644 --- a/ecal/core/src/config/ecal_cmd_parser.h +++ b/ecal/core/src/config/ecal_cmd_parser.h @@ -23,7 +23,7 @@ #pragma once -#include "ecal/types/user_arg_options.h" +#include #include #include diff --git a/ecal/core/src/config/ecal_config.cpp b/ecal/core/src/config/ecal_config.cpp index aa010a99ae..14f23cf803 100644 --- a/ecal/core/src/config/ecal_config.cpp +++ b/ecal/core/src/config/ecal_config.cpp @@ -99,7 +99,7 @@ namespace eCAL ECAL_API bool IsNetworkEnabled () { return GetConfiguration().transport_layer.network_enabled; } - ECAL_API UdpConfigVersion GetUdpMulticastConfigVersion () { return GetConfiguration().transport_layer.mc_options.config_version; } + ECAL_API Types::UdpConfigVersion GetUdpMulticastConfigVersion () { return GetConfiguration().transport_layer.mc_options.config_version; } ECAL_API std::string GetUdpMulticastGroup () { return GetConfiguration().transport_layer.mc_options.group; } ECAL_API std::string GetUdpMulticastMask () { return GetConfiguration().transport_layer.mc_options.mask; } @@ -181,7 +181,7 @@ namespace eCAL namespace Experimental { - ECAL_API bool IsShmMonitoringEnabled () { return (GetConfiguration().monitoring.monitoring_mode & MonitoringMode::shm_monitoring) != 0; } + ECAL_API bool IsShmMonitoringEnabled () { return (GetConfiguration().monitoring.monitoring_mode & Monitoring::Types::Mode::shm_monitoring) != 0; } ECAL_API bool IsNetworkMonitoringDisabled () { return !GetConfiguration().monitoring.network_monitoring; } ECAL_API size_t GetShmMonitoringQueueSize () { return GetConfiguration().monitoring.shm_options.shm_monitoring_queue_size; } ECAL_API std::string GetShmMonitoringDomain () { return GetConfiguration().monitoring.shm_options.shm_monitoring_domain;} diff --git a/ecal/core/src/config/ecal_config_initializer.cpp b/ecal/core/src/config/ecal_config_initializer.cpp index 9428afcf30..12235fac44 100644 --- a/ecal/core/src/config/ecal_config_initializer.cpp +++ b/ecal/core/src/config/ecal_config_initializer.cpp @@ -118,9 +118,9 @@ namespace eCAL const std::string udp_config_version_string = iniConfig.get(NETWORK, "multicast_config_version", "v1"); if (udp_config_version_string == "v1") - multicastOptions.config_version = Config::UdpConfigVersion::V1; + multicastOptions.config_version = Types::UdpConfigVersion::V1; if (udp_config_version_string == "v2") - multicastOptions.config_version = Config::UdpConfigVersion::V2; + multicastOptions.config_version = Types::UdpConfigVersion::V2; multicastOptions.group = iniConfig.get(NETWORK, "multicast_group", NET_UDP_MULTICAST_GROUP); multicastOptions.mask = iniConfig.get(NETWORK, "multicast_mask", NET_UDP_MULTICAST_MASK); @@ -149,15 +149,15 @@ namespace eCAL // registration options auto registrationTimeout = iniConfig.get(COMMON, "registration_timeout", CMN_REGISTRATION_TO); auto registrationRefresh = iniConfig.get(COMMON, "registration_refresh", CMN_REGISTRATION_REFRESH); - registration = Config::RegistrationOptions(registrationTimeout, registrationRefresh); + registration = Registration::Configuration(registrationTimeout, registrationRefresh); auto& registrationOptions = registration; registrationOptions.share_tdesc = iniConfig.get(PUBLISHER, "share_tdesc", PUB_SHARE_TDESC); registrationOptions.share_ttype = iniConfig.get(PUBLISHER, "share_ttype", PUB_SHARE_TTYPE); // monitoring options auto& monitoringOptions = monitoring; - auto monitoringMode = iniConfig.get(EXPERIMENTAL, "shm_monitoring_enabled", false) ? Config::MonitoringMode::shm_monitoring : Config::MonitoringMode::none; - monitoringOptions.monitoring_mode = static_cast(monitoringMode); + auto monitoringMode = iniConfig.get(EXPERIMENTAL, "shm_monitoring_enabled", false) ? Monitoring::Types::Mode::shm_monitoring : Monitoring::Types::Mode::none; + monitoringOptions.monitoring_mode = static_cast(monitoringMode); monitoringOptions.monitoring_timeout = iniConfig.get(MONITORING, "timeout", MON_TIMEOUT);; monitoringOptions.network_monitoring = iniConfig.get(EXPERIMENTAL, "network_monitoring", EXP_NETWORK_MONITORING_ENABLED); monitoringOptions.filter_excl = iniConfig.get(MONITORING, "filter_excl", MON_FILTER_EXCL); diff --git a/ecal/core/src/ecal_def.h b/ecal/core/src/ecal_def.h index 606996f2c1..1af986b6a3 100644 --- a/ecal/core/src/ecal_def.h +++ b/ecal/core/src/ecal_def.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2024 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,8 @@ #pragma once -#include +#include +#include #include #include @@ -68,7 +69,7 @@ constexpr const char* SYS_FILTER_EXCL = "^eCALSysClient$|^eCALSysGUI$|^eCALS constexpr bool NET_ENABLED = false; /* eCAL udp multicast defines */ -constexpr eCAL::Config::UdpConfigVersion NET_UDP_MULTICAST_CONFIG_VERSION = eCAL::Config::UdpConfigVersion::V1; +constexpr eCAL::Types::UdpConfigVersion NET_UDP_MULTICAST_CONFIG_VERSION = eCAL::Types::UdpConfigVersion::V1; constexpr const char* NET_UDP_MULTICAST_GROUP = "239.0.0.1"; constexpr const char* NET_UDP_MULTICAST_MASK = "0.0.0.15"; constexpr unsigned int NET_UDP_MULTICAST_PORT = 14000U; @@ -106,9 +107,9 @@ constexpr const char* NET_HOST_GROUP_NAME = ""; /* use shared memory transport layer [auto = 2, on = 1, off = 0] */ constexpr eCAL::TLayer::eSendMode PUB_USE_SHM = eCAL::TLayer::eSendMode::smode_auto; /* use tcp transport layer [auto = 2, on = 1, off = 0] */ -constexpr eCAL::TLayer::eSendMode PUB_USE_TCP = eCAL::TLayer::eSendMode::smode_off; +constexpr eCAL::TLayer::eSendMode PUB_USE_TCP = eCAL::TLayer::eSendMode::smode_off; /* use udp multicast transport layer [auto = 2, on = 1, off = 0] */ -constexpr eCAL::TLayer::eSendMode PUB_USE_UDP_MC = eCAL::TLayer::eSendMode::smode_auto; +constexpr eCAL::TLayer::eSendMode PUB_USE_UDP_MC = eCAL::TLayer::eSendMode::smode_auto; /* share topic type [ on = 1, off = 0] */ constexpr bool PUB_SHARE_TTYPE = true; @@ -200,4 +201,4 @@ constexpr unsigned int EXP_MEMFILE_ACCESS_TIMEOUT = 100U; /* enable dropping of payload messages that arrive out of order */ constexpr bool EXP_DROP_OUT_OF_ORDER_MESSAGES = false; -constexpr eCAL::Config::MonitoringMode EXP_MONITORING_MODE = eCAL::Config::MonitoringMode::none; +constexpr eCAL::Monitoring::Types::Mode EXP_MONITORING_MODE = eCAL::Monitoring::Types::Mode::none; diff --git a/ecal/core/src/ecal_global_accessors.cpp b/ecal/core/src/ecal_global_accessors.cpp index c85f33d416..dd2c8f0a48 100644 --- a/ecal/core/src/ecal_global_accessors.cpp +++ b/ecal/core/src/ecal_global_accessors.cpp @@ -24,7 +24,7 @@ #include "ecal_global_accessors.h" #include "ecal_def.h" #include "ecal_globals.h" -#include "ecal/types/ecal_config_types.h" +#include "ecal/config/ecal_configuration.h" #include #include diff --git a/ecal/core/src/io/udp/ecal_udp_configurations.cpp b/ecal/core/src/io/udp/ecal_udp_configurations.cpp index 589da3874b..d3e81cf46a 100644 --- a/ecal/core/src/io/udp/ecal_udp_configurations.cpp +++ b/ecal/core/src/io/udp/ecal_udp_configurations.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2024 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -140,7 +140,7 @@ namespace eCAL } // determine the UDP multicast configuration version - if (Config::GetUdpMulticastConfigVersion() == Config::UdpConfigVersion::V1) + if (Config::GetUdpMulticastConfigVersion() == Types::UdpConfigVersion::V1) { // retrieve the corresponding multicast address based on the topic name using v1 implementation return UDP::V1::topic2mcast(topic_name, Config::GetUdpMulticastGroup(), Config::GetUdpMulticastMask()); diff --git a/ecal/core/src/types/ecal_custom_data_types.cpp b/ecal/core/src/types/ecal_custom_data_types.cpp index ae462fae6b..af9e778b64 100644 --- a/ecal/core/src/types/ecal_custom_data_types.cpp +++ b/ecal/core/src/types/ecal_custom_data_types.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2024 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ namespace{ namespace eCAL { - namespace Config + namespace Types { // IpAddressV4 definitions diff --git a/ecal/core/src/types/ecal_registration_options.cpp b/ecal/core/src/types/ecal_registration_options.cpp index b3ddec7b1b..9a47d2a4ac 100644 --- a/ecal/core/src/types/ecal_registration_options.cpp +++ b/ecal/core/src/types/ecal_registration_options.cpp @@ -26,16 +26,16 @@ namespace eCAL { - namespace Config + namespace Registration { - RegistrationOptions::RegistrationOptions() + Configuration::Configuration() : share_ttype(PUB_SHARE_TTYPE) , share_tdesc(PUB_SHARE_TDESC) , m_registration_timeout(CMN_REGISTRATION_TO) , m_registration_refresh(CMN_REGISTRATION_REFRESH) {} - RegistrationOptions::RegistrationOptions(unsigned int reg_timeout_, unsigned int reg_refresh_) + Configuration::Configuration(unsigned int reg_timeout_, unsigned int reg_refresh_) : share_ttype(PUB_SHARE_TTYPE) , share_tdesc(PUB_SHARE_TDESC) { @@ -50,7 +50,7 @@ namespace eCAL } } - unsigned int RegistrationOptions::getTimeoutMS() const { return m_registration_timeout; } - unsigned int RegistrationOptions::getRefreshMS() const { return m_registration_refresh; } + unsigned int Configuration::getTimeoutMS() const { return m_registration_timeout; } + unsigned int Configuration::getRefreshMS() const { return m_registration_refresh; } } } \ No newline at end of file diff --git a/ecal/tests/cpp/config_test/src/config_test.cpp b/ecal/tests/cpp/config_test/src/config_test.cpp index ece057d464..7733689831 100644 --- a/ecal/tests/cpp/config_test/src/config_test.cpp +++ b/ecal/tests/cpp/config_test/src/config_test.cpp @@ -52,7 +52,7 @@ TEST(core_cpp_config, user_config_passing) const unsigned int mon_timeout = 6000U; const std::string mon_filter_excl = "_A.*"; const eCAL_Logging_Filter mon_log_filter_con = log_level_warning; - const eCAL::Config::eCAL_MonitoringMode_Filter monitoring_mode = eCAL::Config::MonitoringMode::udp_monitoring; + const eCAL::Monitoring::Types::Mode monitoring_mode = eCAL::Monitoring::Types::Mode::udp_monitoring; // Publisher options const bool pub_use_shm = true; @@ -60,7 +60,7 @@ TEST(core_cpp_config, user_config_passing) // Registration options const unsigned int registration_timeout = 80000U; const unsigned int registration_refresh = 2000U; - const eCAL::Config::RegistrationOptions registration = eCAL::Config::RegistrationOptions(registration_timeout, registration_refresh); + const eCAL::Registration::Configuration registration = eCAL::Registration::Configuration(registration_timeout, registration_refresh); try{ custom_config.transport_layer.network_enabled = network_enabled; @@ -102,7 +102,7 @@ TEST(core_cpp_config, user_config_passing) // Test monitoring console log assignment, default is (log_level_info | log_level_warning | log_level_error | log_level_fatal) EXPECT_EQ(mon_log_filter_con, eCAL::GetConfiguration().logging.filter_log_con); - // Test monitoring mode assignment, default is eCAL::Config::MonitoringMode::none + // Test monitoring mode assignment, default is eCAL::Types::MonitoringMode::none EXPECT_EQ(monitoring_mode, eCAL::GetConfiguration().monitoring.monitoring_mode); // Test publisher sendmode assignment, default is eCAL::TLayer::eSendMode::smode_auto @@ -181,26 +181,26 @@ TEST(ConfigDeathTest, user_config_death_test) // Test the registration option limits // Refresh timeout > registration timeout ASSERT_THROW( - eCAL::Config::RegistrationOptions(2000U, 3000U), std::invalid_argument); + eCAL::Registration::Configuration(2000U, 3000U), std::invalid_argument); // Refresh timeout = registration timeout ASSERT_THROW( - eCAL::Config::RegistrationOptions(2000U, 2000U), std::invalid_argument); + eCAL::Registration::Configuration(2000U, 2000U), std::invalid_argument); } TEST(core_cpp_config, config_custom_datatypes_tests) { // test custom datatype assignment operators - eCAL::Config::IpAddressV4 ip1; - eCAL::Config::IpAddressV4 ip2; + eCAL::Types::IpAddressV4 ip1; + eCAL::Types::IpAddressV4 ip2; EXPECT_EQ(static_cast(ip1), static_cast(ip2)); ip1 = "192.168.0.2"; ip2 = ip1; EXPECT_EQ(static_cast(ip1), static_cast(ip2)); - eCAL::Config::ConstrainedInteger<0,1,10> s1; - eCAL::Config::ConstrainedInteger<0,1,10> s2; + eCAL::Types::ConstrainedInteger<0,1,10> s1; + eCAL::Types::ConstrainedInteger<0,1,10> s2; EXPECT_EQ(static_cast(s1), static_cast(s2)); s1 = 5;