Skip to content

Commit

Permalink
Merge branch 'master' into feature/ecal_api_config_path_review
Browse files Browse the repository at this point in the history
  • Loading branch information
Peguen authored Jan 2, 2025
2 parents 2d75f8f + 41f1078 commit 0725ea4
Show file tree
Hide file tree
Showing 157 changed files with 4,403 additions and 3,964 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Checks: "-*,
misc-*,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-misc-include-cleaner,
modernize-*,
-modernize-pass-by-value,
Expand All @@ -61,6 +62,7 @@ Checks: "-*,
-readability-redundant-access-specifiers,
-readability-uppercase-literal-suffix,
-readability-use-anyofallof,
-readability-avoid-const-params-in-decls,
"
WarningsAsErrors: ''
HeaderFilterRegex: '^((?!/thirdparty/|/_deps/).)*$'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ jobs:
git submodule deinit thirdparty/curl/curl
git submodule deinit thirdparty/gtest/googletest
git submodule deinit thirdparty/hdf5/hdf5
git submodule deinit thirdparty/libssh2/libssh2
git submodule deinit thirdparty/protobuf/protobuf
git submodule update
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
[submodule "thirdparty/curl"]
path = thirdparty/curl/curl
url = https://github.com/curl/curl.git
[submodule "thirdparty/libssh2"]
path = thirdparty/libssh2/libssh2
url = https://github.com/libssh2/libssh2.git
[submodule "thirdparty/hdf5"]
path = thirdparty/hdf5/hdf5
url = https://github.com/HDFGroup/hdf5.git
Expand Down
8 changes: 4 additions & 4 deletions app/mon/mon_plugins/raw_data_reflection/src/plugin_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ PluginWidget::PluginWidget(const QString& topic_name, const QString&, QWidget* p
ui_.content_layout->addWidget(frame);

// Connect the eCAL Subscriber
subscriber_.AddReceiveCallback([this](const eCAL::Registration::STopicId& /*topic_id*/,
subscriber_.SetReceiveCallback([this](const eCAL::Registration::STopicId& /*topic_id*/,
const eCAL::SDataTypeInformation& /*data_type_info*/,
const eCAL::SReceiveCallbackData& callback_data)
{
Expand All @@ -69,7 +69,7 @@ PluginWidget::PluginWidget(const QString& topic_name, const QString&, QWidget* p

PluginWidget::~PluginWidget()
{
subscriber_.RemReceiveCallback();
subscriber_.RemoveReceiveCallback();
}

void PluginWidget::ecalMessageReceivedCallback(const eCAL::SReceiveCallbackData& callback_data)
Expand Down Expand Up @@ -134,7 +134,7 @@ void PluginWidget::onUpdate()
void PluginWidget::onResume()
{
// (Re)Connect the eCAL Subscriber
subscriber_.AddReceiveCallback([this](const eCAL::Registration::STopicId& /*topic_id*/,
subscriber_.SetReceiveCallback([this](const eCAL::Registration::STopicId& /*topic_id*/,
const eCAL::SDataTypeInformation& /*data_type_info*/,
const eCAL::SReceiveCallbackData& callback_data)
{
Expand All @@ -144,7 +144,7 @@ void PluginWidget::onResume()

void PluginWidget::onPause()
{
subscriber_.RemReceiveCallback();
subscriber_.RemoveReceiveCallback();
}

void PluginWidget::updateRawMessageView()
Expand Down
10 changes: 5 additions & 5 deletions app/mon/mon_tui/src/tui/viewmodel/message_visualization/raw.hpp
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 Down Expand Up @@ -36,12 +36,12 @@ class RawMessageVisualizationViewModel : public MessageVisualizationViewModel
mutable std::mutex message_mtx;
std::string latest_message;

void OnMessage(const struct eCAL::SReceiveCallbackData* callback_data)
void OnMessage(const struct eCAL::SReceiveCallbackData& callback_data)
{
{
std::lock_guard<std::mutex> lock{message_mtx};
latest_message = std::string(static_cast<char *>(callback_data->buf), callback_data->size);
message_timestamp = callback_data->time;
latest_message = std::string(static_cast<char *>(callback_data.buf), callback_data.size);
message_timestamp = callback_data.time;
}

NotifyDataUpdated();
Expand All @@ -52,7 +52,7 @@ class RawMessageVisualizationViewModel : public MessageVisualizationViewModel
: subscriber{topic}
{
using namespace std::placeholders;
subscriber.AddReceiveCallback(std::bind(&RawMessageVisualizationViewModel::OnMessage, this, _2));
subscriber.SetReceiveCallback(std::bind(&RawMessageVisualizationViewModel::OnMessage, this, _3));
}

std::string message() const
Expand Down
3 changes: 2 additions & 1 deletion app/play/play_core/src/measurement_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <memory>

#include <ecal/ecal.h>
#include <ecal/ecal_publisher_v5.h>
#include <ecalhdf5/eh5_meas.h>

#include "continuity_report.h"
Expand Down Expand Up @@ -90,7 +91,7 @@ class MeasurementContainer
private:
struct PublisherInfo
{
eCAL::CPublisher publisher_;
eCAL::v5::CPublisher publisher_;
long long message_counter_;

PublisherInfo(const std::string& topic_name, const eCAL::SDataTypeInformation& info_)
Expand Down
13 changes: 6 additions & 7 deletions app/rec/rec_client_core/src/ecal_rec_impl.cpp
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 Down Expand Up @@ -695,12 +695,12 @@ namespace eCAL
return subscribed_topics;
}

void EcalRecImpl::EcalMessageReceived(const char* topic_name, const eCAL::SReceiveCallbackData* callback_data)
void EcalRecImpl::EcalMessageReceived(const eCAL::Registration::STopicId& topic_id_, const eCAL::SReceiveCallbackData& data_)
{
auto ecal_receive_time = eCAL::Time::ecal_clock::now();
auto system_receive_time = std::chrono::steady_clock::now();

std::shared_ptr<Frame> frame = std::make_shared<Frame>(callback_data, topic_name, ecal_receive_time, system_receive_time);
std::shared_ptr<Frame> frame = std::make_shared<Frame>(&data_, topic_id_.topic_name, ecal_receive_time, system_receive_time);

pre_buffer_.push_back(frame);

Expand Down Expand Up @@ -821,14 +821,14 @@ namespace eCAL
if (subscriber_map_.find(topic) == subscriber_map_.end())
{
EcalRecLogger::Instance()->info("Subscribing to " + topic);
std::unique_ptr<eCAL::CSubscriber> subscriber = std::make_unique<eCAL::CSubscriber>();
if (!subscriber->Create(topic))
std::unique_ptr<eCAL::CSubscriber> subscriber = std::make_unique<eCAL::CSubscriber>(topic);
if (!subscriber)
{
EcalRecLogger::Instance()->error("Error creating subscriber for topic " + topic);
info_ = { false, "Error creating eCAL subsribers" };
continue;
}
if (!subscriber->AddReceiveCallback(std::bind(&EcalRecImpl::EcalMessageReceived, this, std::placeholders::_1, std::placeholders::_2)))
if (!subscriber->SetReceiveCallback(std::bind(&EcalRecImpl::EcalMessageReceived, this, std::placeholders::_1, std::placeholders::_3)))
{
EcalRecLogger::Instance()->error("Error adding callback for subscriber on topic " + topic);
info_ = { false, "Error creating eCAL subsribers" };
Expand All @@ -848,7 +848,6 @@ namespace eCAL
{
EcalRecLogger::Instance()->info("Unsubscribing from " + subscriber_it->first);

subscriber_it->second->Destroy();
subscriber_it = subscriber_map_.erase(subscriber_it);
}
else
Expand Down
4 changes: 2 additions & 2 deletions app/rec/rec_client_core/src/ecal_rec_impl.h
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 Down Expand Up @@ -115,7 +115,7 @@ namespace eCAL

std::set<std::string> GetSubscribedTopics() const;

void EcalMessageReceived(const char* topic_name, const eCAL::SReceiveCallbackData* callback_data);
void EcalMessageReceived(const eCAL::Registration::STopicId& topic_id_, const eCAL::SReceiveCallbackData& data_);

//////////////////////////////////////
//// API for external threads ////
Expand Down
1 change: 1 addition & 0 deletions contrib/ecalhdf5/src/eh5_meas_api_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <ecalhdf5/eh5_meas_api_v2.h>

#include <algorithm>
#include <limits>

#include <ecalhdf5/eh5_meas_api_v3.h>
Expand Down
22 changes: 13 additions & 9 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ set(ecal_config_src
src/config/ecal_config.cpp
src/config/ecal_config_initializer.cpp
src/config/ecal_path_processing.cpp
src/config/transport_layer.cpp
src/types/ecal_custom_data_types.cpp
)
if (ECAL_CORE_CONFIGURATION)
Expand Down Expand Up @@ -207,6 +206,9 @@ endif()
if(ECAL_CORE_PUBLISHER)
set(ecal_pub_src
src/pubsub/ecal_publisher.cpp
src/pubsub/ecal_publisher_impl.cpp
src/pubsub/ecal_publisher_impl.h
src/pubsub/ecal_publisher_v5.cpp
src/pubsub/ecal_pubgate.cpp
src/pubsub/ecal_pubgate.h
)
Expand All @@ -215,6 +217,9 @@ endif()
if(ECAL_CORE_SUBSCRIBER)
set(ecal_sub_src
src/pubsub/ecal_subscriber.cpp
src/pubsub/ecal_subscriber_impl.cpp
src/pubsub/ecal_subscriber_impl.h
src/pubsub/ecal_subscriber_v5.cpp
src/pubsub/ecal_subgate.cpp
src/pubsub/ecal_subgate.h
)
Expand All @@ -229,8 +234,6 @@ set(ecal_readwrite_src

if(ECAL_CORE_PUBLISHER)
set(ecal_writer_src
src/readwrite/ecal_writer.cpp
src/readwrite/ecal_writer.h
src/readwrite/ecal_writer_base.h
src/readwrite/ecal_writer_buffer_payload.h
src/readwrite/ecal_writer_data.h
Expand Down Expand Up @@ -259,8 +262,6 @@ endif()

if(ECAL_CORE_SUBSCRIBER)
set(ecal_reader_src
src/readwrite/ecal_reader.cpp
src/readwrite/ecal_reader.h
src/readwrite/ecal_reader_layer.h
)
if(ECAL_CORE_TRANSPORT_UDP)
Expand Down Expand Up @@ -298,9 +299,7 @@ if (ECAL_CORE_REGISTRATION)
src/registration/ecal_registration_sample_applier.cpp
src/registration/ecal_registration_sample_applier.h
src/registration/ecal_registration_sample_applier_gates.cpp
src/registration/ecal_registration_sample_applier_gates.h
src/registration/ecal_registration_sample_applier_user.cpp
src/registration/ecal_registration_sample_applier_user.h
src/registration/ecal_registration_sample_applier_gates.h
src/registration/ecal_registration_timeout_provider.cpp
src/registration/ecal_registration_timeout_provider.h
src/registration/ecal_registration_sender.h
Expand Down Expand Up @@ -392,6 +391,9 @@ if(ECAL_CORE_SERVICE)
src/service/ecal_service_server.cpp
src/service/ecal_service_server_impl.cpp
src/service/ecal_service_server_impl.h
src/service/ecal_service_server_v5.cpp
src/service/ecal_service_server_v5_impl.cpp
src/service/ecal_service_server_v5_impl.h
src/service/ecal_service_singleton_manager.cpp
src/service/ecal_service_singleton_manager.h
)
Expand Down Expand Up @@ -514,7 +516,6 @@ set(ecal_header_cmn
include/ecal/config/monitoring.h
include/ecal/config/publisher.h
include/ecal/config/registration.h
include/ecal/config/service.h
include/ecal/config/subscriber.h
include/ecal/config/time.h
include/ecal/config/transport_layer.h
Expand All @@ -539,9 +540,12 @@ set(ecal_header_cmn
include/ecal/ecal_process_severity.h
include/ecal/ecal_registration.h
include/ecal/ecal_publisher.h
include/ecal/ecal_publisher_v5.h
include/ecal/ecal_server.h
include/ecal/ecal_server_v5.h
include/ecal/ecal_service_info.h
include/ecal/ecal_subscriber.h
include/ecal/ecal_subscriber_v5.h
include/ecal/ecal_time.h
include/ecal/ecal_timer.h
include/ecal/ecal_tlayer.h
Expand Down
13 changes: 0 additions & 13 deletions ecal/core/include/ecal/cimpl/ecal_callback_cimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,6 @@ enum eCAL_Server_Event
server_event_disconnected = 2,
};

/**
* @brief eCAL common registration event type.
**/
enum eCAL_Registration_Event
{
reg_event_none = 0,
reg_event_publisher = 1,
reg_event_subscriber = 2,
reg_event_service = 3,
reg_event_client = 5,
reg_event_process = 4,
};

#ifdef _MSC_VER
#pragma pack(push, 8)
#endif
Expand Down
8 changes: 4 additions & 4 deletions ecal/core/include/ecal/cimpl/ecal_core_cimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extern "C"
* @param unit_name_ Defines the name of the eCAL unit.
* @param components_ Defines which component to initialize.
*
* @return Zero if succeeded, 1 if already initialized, -1 if failed.
* @return Zero if succeeded.
**/
ECALC_API int eCAL_Initialize(const char *unit_name_, unsigned int components_);

Expand All @@ -83,21 +83,21 @@ extern "C"
/**
* @brief Finalize eCAL API.
*
* @return Zero if succeeded, 1 if already finalized, -1 if failed.
* @return Zero if succeeded.
**/
ECALC_API int eCAL_Finalize();

/**
* @brief Check eCAL initialize state.
*
* @return None zero if eCAL is initialized.
* @return Non-zero if eCAL is initialized.
**/
ECALC_API int eCAL_IsInitialized();

/**
* @brief Return the eCAL process state.
*
* @return None zero if eCAL is in proper state.
* @return Non-zero if eCAL is in proper state.
**/
ECALC_API int eCAL_Ok();

Expand Down
18 changes: 2 additions & 16 deletions ecal/core/include/ecal/cimpl/ecal_log_cimpl.h
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 Down Expand Up @@ -33,26 +33,12 @@
extern "C"
{
#endif /*__cplusplus*/
/**
* @brief Sets the log level.
*
* @param level_ The level.
**/
ECALC_API void eCAL_Logging_SetLogLevel(enum eCAL_Logging_eLogLevel level_);

/**
* @brief Get the current log level.
*
* @return The current log level.
**/
ECALC_API enum eCAL_Logging_eLogLevel eCAL_Logging_GetLogLevel();

/**
* @brief Log a message (with current log level).
*
* @param msg_ The log message string.
**/
ECALC_API void eCAL_Logging_Log(const char* const msg_);
ECALC_API void eCAL_Logging_Log(enum eCAL_Logging_eLogLevel level_, const char* const msg_);

/**
* @brief Get logging string.
Expand Down
2 changes: 0 additions & 2 deletions ecal/core/include/ecal/config/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#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/user_arguments.h>
#include <ecal/config/publisher.h>
Expand All @@ -54,7 +53,6 @@ namespace eCAL
Subscriber::Configuration subscriber;
Publisher::Configuration publisher;
Time::Configuration timesync;
Service::Configuration service;
Application::Configuration application;
Logging::Configuration logging;
Cli::Configuration command_line_arguments;
Expand Down
Loading

0 comments on commit 0725ea4

Please sign in to comment.