Skip to content

Commit

Permalink
Now buildable.
Browse files Browse the repository at this point in the history
  • Loading branch information
KerstinKeller committed Jan 7, 2025
1 parent 2c5c714 commit 1080444
Show file tree
Hide file tree
Showing 21 changed files with 135 additions and 108 deletions.
1 change: 1 addition & 0 deletions app/mon/mon_cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ create_targets_protobuf()
target_link_libraries(${PROJECT_NAME}
tclap::tclap
eCAL::protobuf_core
eCAL::string_core
eCAL::core_pb)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)

Expand Down
4 changes: 2 additions & 2 deletions app/mon/mon_plugins/capnproto_reflection/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -61,7 +61,7 @@ ecal_add_mon_plugin(${PROJECT_NAME}
target_link_libraries (${PROJECT_NAME}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Widgets
eCAL::core
eCAL::capnproto_core
CapnProto::capnp
CustomQt
eCAL::mon_plugin_lib
Expand Down
4 changes: 2 additions & 2 deletions app/mon/mon_plugins/string_reflection/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 - 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.
Expand Down Expand Up @@ -58,7 +58,7 @@ create_targets_protobuf()
target_link_libraries (${PROJECT_NAME}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Widgets
eCAL::core
eCAL::string_core
eCAL::mon_plugin_lib
)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
Expand Down
1 change: 1 addition & 0 deletions app/mon/mon_tui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ target_link_libraries(${PROJECT_NAME}
protobuf::libprotobuf
tclap::tclap
eCAL::protobuf_core
eCAL::string_core
eCAL::core_pb
ftxui::screen
ftxui::dom
Expand Down
4 changes: 2 additions & 2 deletions ecal/samples/cpp/benchmarks/datarate_rec/src/datarate_rec.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -25,7 +25,7 @@
#include <tclap/CmdLine.h>

#include <ecal/ecal.h>
#include <ecal/msg/string/subscriber.h>
#include <ecal/ecal_subscriber.h>

// main entry
int main(int argc, char** argv)
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -18,7 +18,7 @@
*/

#include <ecal/ecal.h>
#include <ecal/msg/string/subscriber.h>
#include <ecal/ecal_subscriber.h>

#include <iostream>
#include <sstream>
Expand Down
6 changes: 3 additions & 3 deletions ecal/samples/cpp/misc/timer/src/timer.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 - 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.
Expand All @@ -18,7 +18,7 @@
*/

#include <ecal/ecal.h>
#include <ecal/msg/string/publisher.h>
#include <ecal/ecal_publisher.h>

#include <iostream>
#include <functional>
Expand All @@ -32,7 +32,7 @@ int main()
// set process state
eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !");

eCAL::string::CPublisher<std::string> pub("hello");
eCAL::CPublisher pub("hello");
eCAL::CTimer timer;

timer.Start(timout_ms, [&pub](){
Expand Down
17 changes: 9 additions & 8 deletions ecal/tests/cpp/pubsub_test/src/pubsub_acknowledge.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -19,8 +19,8 @@

#include <chrono>
#include <ecal/ecal.h>
#include <ecal/msg/string/publisher.h>
#include <ecal/msg/string/subscriber.h>
#include <ecal/ecal_publisher.h>
#include <ecal/ecal_subscriber.h>

#include <functional>
#include <memory>
Expand Down Expand Up @@ -59,15 +59,16 @@ TEST(core_cpp_pubsub, TimeoutAcknowledgment)
pub_config.layer.shm.acknowledge_timeout_ms = 500;

// create publisher
eCAL::string::CPublisher<std::string> pub("topic", pub_config);
auto sub1 = std::make_shared< eCAL::string::CSubscriber<std::string>>("topic");
auto sleeper_variable_time = [](const char* /*topic_name_*/, const std::string& msg_, long long /*time_*/, long long /*clock_*/, long long /*id_*/)
eCAL::CPublisher pub("topic", {}, pub_config);
auto sub1 = std::make_shared< eCAL::CSubscriber>("topic");
auto sleeper_variable_time = [](const eCAL::Registration::STopicId& topic_id_, const eCAL::SDataTypeInformation& data_type_info_, const eCAL::SReceiveCallbackData& data_)
{
int sleep = std::stoi(msg_);
std::string sleep_time((const char*)data_.buf, data_.size);
int sleep = std::stoi(sleep_time);
std::this_thread::sleep_for(std::chrono::milliseconds(sleep));
};

sub1->AddReceiveCallback(sleeper_variable_time);
sub1->SetReceiveCallback(sleeper_variable_time);

// Registration activities
std::this_thread::sleep_for(std::chrono::seconds(2));
Expand Down
6 changes: 3 additions & 3 deletions ecal/tests/cpp/pubsub_test/src/pubsub_callback_topicid.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -19,8 +19,8 @@

#include <chrono>
#include <ecal/ecal.h>
#include <ecal/msg/string/publisher.h>
#include <ecal/msg/string/subscriber.h>
#include <ecal/ecal_publisher.h>
#include <ecal/ecal_subscriber.h>

#include <gtest/gtest.h>
#include <ostream>
Expand Down
6 changes: 3 additions & 3 deletions ecal/tests/cpp/pubsub_test/src/pubsub_connection_test.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -18,8 +18,8 @@
*/

#include <ecal/ecal.h>
#include <ecal/msg/string/publisher.h>
#include <ecal/msg/string/subscriber.h>
#include <ecal/ecal_publisher.h>
#include <ecal/ecal_subscriber.h>

#include <atomic>
#include <chrono>
Expand Down
30 changes: 15 additions & 15 deletions ecal/tests/cpp/pubsub_test/src/pubsub_receive_test.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -18,8 +18,8 @@
*/

#include <ecal/ecal.h>
#include <ecal/msg/string/publisher.h>
#include <ecal/msg/string/subscriber.h>
#include <ecal/ecal_publisher_v5.h>
#include <ecal/ecal_subscriber_v5.h>

#include <atomic>
#include <chrono>
Expand Down Expand Up @@ -72,8 +72,8 @@ TEST(core_cpp_pubsub, TimingSubscriberReceive)
EXPECT_EQ(true, eCAL::Initialize("subscriber_receive_timing"));

// create simple string publisher
eCAL::string::CPublisher<std::string> pub("CLOCK");
eCAL::string::CSubscriber<std::string> sub("CLOCK");
eCAL::v5::CPublisher pub("CLOCK");
eCAL::v5::CSubscriber sub("CLOCK");

// let's match them
eCAL::Process::SleepMS(2 * CMN_REGISTRATION_REFRESH_MS);
Expand All @@ -83,7 +83,7 @@ TEST(core_cpp_pubsub, TimingSubscriberReceive)
// return with immediately
measure_execution_within_range(
"ReturnImmediate",
[&sub, &received]() {sub.Receive(received); },
[&sub, &received]() {sub.ReceiveBuffer(received); },
0ms,
10ms
);
Expand All @@ -93,7 +93,7 @@ TEST(core_cpp_pubsub, TimingSubscriberReceive)
measure_execution_within_range(
"Return500ms",
[&sub, &received]() {
auto res = sub.Receive(received, nullptr, 500);
auto res = sub.ReceiveBuffer(received, nullptr, 500);
EXPECT_FALSE(res);
},
500ms,
Expand All @@ -106,7 +106,7 @@ TEST(core_cpp_pubsub, TimingSubscriberReceive)
measure_execution_within_range(
"ReceiveImmediate",
[&sub, &received]() {
auto res = sub.Receive(received);
auto res = sub.ReceiveBuffer(received);
EXPECT_TRUE(res);
},
0ms,
Expand All @@ -116,7 +116,7 @@ TEST(core_cpp_pubsub, TimingSubscriberReceive)
measure_execution_within_range(
"Return500ms_2",
[&sub, &received]() {
auto res = sub.Receive(received, nullptr, 500);
auto res = sub.ReceiveBuffer(received, nullptr, 500);
EXPECT_FALSE(res);
},
500ms,
Expand All @@ -127,7 +127,7 @@ TEST(core_cpp_pubsub, TimingSubscriberReceive)
measure_execution_within_range(
"ReceiveImmediateInfinite",
[&sub, &received]() {
auto res = sub.Receive(received, nullptr, -1);
auto res = sub.ReceiveBuffer(received, nullptr, -1);
EXPECT_TRUE(res);
},
0ms,
Expand All @@ -137,7 +137,7 @@ TEST(core_cpp_pubsub, TimingSubscriberReceive)
measure_execution_within_range(
"Return500ms_3",
[&sub, &received]() {
auto res = sub.Receive(received, nullptr, 500);
auto res = sub.ReceiveBuffer(received, nullptr, 500);
EXPECT_FALSE(res);
},
500ms,
Expand All @@ -148,7 +148,7 @@ TEST(core_cpp_pubsub, TimingSubscriberReceive)
measure_execution_within_range(
"ReceiveImmediate500ms",
[&sub, &received]() {
auto res = sub.Receive(received, nullptr, 500);
auto res = sub.ReceiveBuffer(received, nullptr, 500);
EXPECT_TRUE(res);
},
0ms,
Expand All @@ -166,8 +166,8 @@ TEST(core_cpp_pubsub, SporadicEmptyReceives)
EXPECT_EQ(true, eCAL::Initialize("sporadic_empty_receives"));

// create simple string publisher
eCAL::string::CPublisher<std::string> pub("CLOCK");
eCAL::string::CSubscriber<std::string> sub("CLOCK");
eCAL::v5::CPublisher pub("CLOCK");
eCAL::v5::CSubscriber sub("CLOCK");

// let's match them
eCAL::Process::SleepMS(2 * CMN_REGISTRATION_REFRESH_MS);
Expand All @@ -189,7 +189,7 @@ TEST(core_cpp_pubsub, SporadicEmptyReceives)
while (!sub_stop)
{
// we define a maximum timeout of 10 sec to not get locked forever here in worst case
const bool got_data = sub.Receive(received, nullptr, 10*1000);
const bool got_data = sub.ReceiveBuffer(received, nullptr, 10*1000);
if (got_data && received.empty())
{
FAIL() << "received empty string";
Expand Down
Loading

0 comments on commit 1080444

Please sign in to comment.