From cafb41986c1ef851886c1737999f78668919cd06 Mon Sep 17 00:00:00 2001 From: Peguen <73380451+Peguen@users.noreply.github.com> Date: Wed, 22 May 2024 11:17:07 +0200 Subject: [PATCH] Use custom types in publisher config. --- .../ecal/config/ecal_publisher_config.h | 37 ++++++++++--------- .../ecal/config/ecal_subscriber_config.h | 10 ++--- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/ecal/core/include/ecal/config/ecal_publisher_config.h b/ecal/core/include/ecal/config/ecal_publisher_config.h index d4b3a04ad6..c6167a6350 100644 --- a/ecal/core/include/ecal/config/ecal_publisher_config.h +++ b/ecal/core/include/ecal/config/ecal_publisher_config.h @@ -89,6 +89,7 @@ #pragma once #include +#include #include @@ -98,46 +99,46 @@ namespace eCAL { namespace SHM { - struct ECAL_API Configuration + struct Configuration { - bool enable; //!< enable layer - bool zero_copy_mode; //!< enable zero copy shared memory transport mode - 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) */ - size_t memfile_min_size_bytes; //!< default memory file size for new publisher - size_t memfile_reserve_percent; //!< dynamic file size reserve before recreating memory file if topic size changes - size_t memfile_buffer_count; //!< maximum number of used buffers (needs to be greater than 1, default = 1) + bool enable; //!< enable layer + 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) }; } namespace UDP { - struct ECAL_API Configuration + struct Configuration { - bool enable; //!< enable layer - bool loopback; //!< enable to receive udp messages on the same local machine - int sndbuf_size_bytes; //!< udp send buffer size in bytes (default 5MB) + 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) }; } namespace TCP { - struct ECAL_API Configuration + struct Configuration { - bool enable; //!< enable layer + bool enable; //!< enable layer }; } - struct ECAL_API Configuration + struct Configuration { - Configuration(); + ECAL_API Configuration(); SHM::Configuration shm; UDP::Configuration udp; TCP::Configuration tcp; - bool share_topic_type; //!< share topic type via registration - bool share_topic_description; //!< share topic description via registration + bool share_topic_type; //!< share topic type via registration + bool share_topic_description; //!< share topic description via registration }; } } diff --git a/ecal/core/include/ecal/config/ecal_subscriber_config.h b/ecal/core/include/ecal/config/ecal_subscriber_config.h index e885b5382b..d306250d43 100644 --- a/ecal/core/include/ecal/config/ecal_subscriber_config.h +++ b/ecal/core/include/ecal/config/ecal_subscriber_config.h @@ -34,7 +34,7 @@ namespace eCAL { namespace SHM { - struct ECAL_API Configuration + struct Configuration { bool enable; //!< enable layer }; @@ -42,7 +42,7 @@ namespace eCAL namespace UDP { - struct ECAL_API Configuration + struct Configuration { bool enable; //!< enable layer }; @@ -50,15 +50,15 @@ namespace eCAL namespace TCP { - struct ECAL_API Configuration + struct Configuration { bool enable; //!< enable layer }; } - struct ECAL_API Configuration + struct Configuration { - Configuration(); + ECAL_API Configuration(); SHM::Configuration shm; UDP::Configuration udp;