Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync-with-eclipse-ecal-2024-07-17 #73

Merged
merged 7 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ endif()
# --------------------------------------------------------
# utils (needs to get a thirdparty)
# --------------------------------------------------------
add_subdirectory(lib/ecalutils)
add_subdirectory(lib/ecal_utils)

# --------------------------------------------------------
# debscripts
Expand Down
4 changes: 3 additions & 1 deletion ecal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ========================= eCAL LICENSE =================================
#
# Copyright (C) 2016 - 2019 Continental Corporation
# Copyright (C) 2016 - 2024 Continental Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,8 @@

cmake_minimum_required(VERSION 3.13)

set(ECAL_CORE_PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR})

# --------------------------------------------------------
# core
# --------------------------------------------------------
Expand Down
17 changes: 14 additions & 3 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ endif()
# config
######################################
set(ecal_config_src
src/config/ecal_cmd_parser.cpp
src/config/ecal_config.cpp
src/config/ecal_config_initializer.cpp
src/config/ecal_config_reader.cpp
src/config/ecal_config_reader.h
src/config/ecal_config_reader_hlp.h
src/types/ecal_custom_data_types.cpp
src/types/ecal_registration_options.cpp
)

######################################
Expand Down Expand Up @@ -274,15 +278,22 @@ endif()
######################################
if (ECAL_CORE_REGISTRATION)
set(ecal_registration_src
src/registration/ecal_process_registration.cpp
src/registration/ecal_process_registration.h
src/registration/ecal_registration_provider.cpp
src/registration/ecal_registration_provider.h
src/registration/ecal_registration_receiver.cpp
src/registration/ecal_registration_receiver.h
src/registration/ecal_registration_sender.h
src/registration/ecal_registration_sender_udp.cpp
src/registration/ecal_registration_sender_udp.h
)
if(ECAL_CORE_REGISTRATION_SHM)
list(APPEND ecal_registration_src
src/registration/ecal_registration_receiver_shm.cpp
src/registration/ecal_registration_receiver_shm.h
src/registration/ecal_registration_sender_shm.cpp
src/registration/ecal_registration_sender_shm.h
src/registration/shm/ecal_memfile_broadcast.cpp
src/registration/shm/ecal_memfile_broadcast.h
src/registration/shm/ecal_memfile_broadcast_reader.cpp
Expand Down Expand Up @@ -450,10 +461,11 @@ endif()
set(ecal_header_cmn
include/ecal/types/logging.h
include/ecal/types/monitoring.h
include/ecal/config/publisher.h
include/ecal/config/subscriber.h
include/ecal/ecal.h
include/ecal/ecal_callback.h
include/ecal/ecal_client.h
include/ecal/ecal_config.h
include/ecal/ecal_core.h
include/ecal/ecal_deprecate.h
include/ecal/ecal_init.h
Expand All @@ -465,16 +477,15 @@ set(ecal_header_cmn
include/ecal/ecal_process.h
include/ecal/ecal_process_severity.h
include/ecal/ecal_publisher.h
include/ecal/ecal_publisher_config.h
include/ecal/ecal_server.h
include/ecal/ecal_service_info.h
include/ecal/ecal_subscriber.h
include/ecal/ecal_subscriber_config.h
include/ecal/ecal_time.h
include/ecal/ecal_timer.h
include/ecal/ecal_tlayer.h
include/ecal/ecal_types.h
include/ecal/ecal_util.h
include/ecal/config/configuration.h
)

set(ecal_header_cimpl
Expand Down
9 changes: 3 additions & 6 deletions ecal/core/cfg/ecal.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
; --------------------------------------------------
; NETWORK SETTINGS
; --------------------------------------------------
; network_enabled = true / false true = all eCAL components communicate over network boundaries
; false = local host only communication
; network_enabled = true / false true = all eCAL components communicate over network boundaries (registration over udp)
; false = local host only communication (registration over shm)
;
; multicast_config_version = v1 / v2 UDP configuration version (Since eCAL 5.12.)
; v1: default behavior
Expand Down Expand Up @@ -43,6 +43,7 @@

[network]
network_enabled = false
shm_registration_enabled = false
multicast_config_version = v1
multicast_group = 239.0.0.1
multicast_mask = 0.0.0.15
Expand Down Expand Up @@ -175,16 +176,12 @@ filter_excl = ^eCALSysClient$|^eCALSysGUI$|^eCALSys$
; --------------------------------------------------
; EXPERIMENTAL SETTINGS
; --------------------------------------------------
; shm_monitoring_enabled = false Enable distribution of monitoring/registration information via shared memory
; shm_monitoring_domain = ecal_monitoring Domain name for shared memory based monitoring/registration
; shm_monitoring_queue_size = 1024 Queue size of monitoring/registration events
; network_monitoring_disabled = false Disable distribution of monitoring/registration information via network
;
; drop_out_of_order_messages = false Enable dropping of payload messages that arrive out of order
; --------------------------------------------------
[experimental]
shm_monitoring_enabled = false
shm_monitoring_domain = ecal_mon
shm_monitoring_queue_size = 1024
network_monitoring_disabled = false
drop_out_of_order_messages = false
57 changes: 57 additions & 0 deletions ecal/core/include/ecal/config/application.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* =========================== 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_application_config.h
* @brief eCAL configuration for applications
**/

#pragma once

#include <string>
#include <ecal/ecal_os.h>
#include <cstddef>

namespace eCAL
{
namespace Application
{
namespace Sys
{
struct Configuration
{
std::string filter_excl; //!<
};
}

namespace Startup
{
struct Configuration
{
std::string terminal_emulator; //!<
};
}

struct Configuration
{
Sys::Configuration sys; //!<
Startup::Configuration startup; //!<
};
}
}
80 changes: 80 additions & 0 deletions ecal/core/include/ecal/config/configuration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* =========================== 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 configuration.h
* @brief eCAL configuration interface
**/

#pragma once

#include <ecal/config/application.h>
#include <ecal/config/monitoring.h>
#include <ecal/config/registration.h>
#include <ecal/config/service.h>
#include <ecal/config/logging.h>
#include <ecal/config/transport_layer.h>
#include <ecal/config/user_arguments.h>
#include <ecal/config/publisher.h>
#include <ecal/config/subscriber.h>
#include <ecal/config/time.h>
#include <ecal/types/ecal_custom_data_types.h>


#include "ecal/ecal_os.h"
#include "ecal/ecal_log_level.h"

#include <string>
#include <vector>
#include <iostream>
#include <chrono>

namespace eCAL
{
struct Configuration
{
Registration::Configuration registration{};
TransportLayer::Configuration transport_layer{};
Monitoring::Configuration monitoring{};
Subscriber::Configuration subscriber{};
Publisher::Configuration publisher{};
Time::Configuration timesync{};
Service::Configuration service{};
Application::Configuration application{};
Logging::Configuration logging{};
Cli::Configuration command_line_arguments{};

ECAL_API Configuration();
ECAL_API Configuration(int argc_, char** argv_);
ECAL_API Configuration(std::vector<std::string>& args_);

ECAL_API void InitConfigWithDefaultIni();
ECAL_API void InitConfig(std::string ini_path_ = std::string(""));

ECAL_API std::string GetIniFilePath();

friend class CmdParser;

protected:
std::string ecal_ini_file_path{};

private:
ECAL_API void Init(std::vector<std::string>& args_);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'eCAL::Configuration::Init' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

    ECAL_API void Init(std::vector<std::string>& args_);
                  ^
Additional context

ecal/core/src/config/ecal_config_initializer.cpp:229: the definition seen here

    void Configuration::Init(std::vector<std::string>& arguments_)
                        ^

ecal/core/include/ecal/config/configuration.h:77: differing parameters are named here: ('args_'), in definition: ('arguments_')

    ECAL_API void Init(std::vector<std::string>& args_);
                  ^

};
}
41 changes: 41 additions & 0 deletions ecal/core/include/ecal/config/logging.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* =========================== 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_logging_config.h
* @brief eCAL configuration for logging
**/

#pragma once

#include <ecal/ecal_log_level.h>

namespace eCAL
{
namespace Logging
{
struct Configuration
{
eCAL_Logging_Filter filter_log_con{}; /*!< Log messages logged to console (all, info, warning, error, fatal, debug1, debug2, debug3, debug4)
(Default: info, warning, error, fatal)*/
eCAL_Logging_Filter filter_log_file{}; //!< Log messages to logged into file system (Default: "")
eCAL_Logging_Filter filter_log_udp{}; //!< Log messages logged via udp network (Default: info, warning, error, fatal)
};
}
}
59 changes: 59 additions & 0 deletions ecal/core/include/ecal/config/monitoring.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* =========================== 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_monitoring_config.h
* @brief eCAL configuration for monitoring
**/

#pragma once

#include <ecal/types/ecal_custom_data_types.h>

namespace eCAL
{
namespace Monitoring
{
namespace UDP
{
struct Configuration
{
};
}

namespace SHM
{
struct Configuration
{
std::string shm_monitoring_domain{}; //!< Domain name for shared memory based monitoring/registration (Default: ecal_mon)
size_t shm_monitoring_queue_size{}; //!< Queue size of monitoring/registration events (Default: 1024)
};
}

struct Configuration
{
eCAL::Types::ConstrainedInteger<1000, 1000> monitoring_timeout{}; //!< Timeout for topic monitoring in ms (Default: 5000)
UDP::Configuration udp_options{};
SHM::Configuration shm_options{};

std::string filter_excl{}; //!< Topics blacklist as regular expression (will not be monitored) (Default: "__.*")
std::string filter_incl{}; //!< Topics whitelist as regular expression (will be monitored only) (Default: "")
};
}
}
Loading
Loading