Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion app/mon/mon_tui/src/model/data/topic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ struct Topic
int32_t local_connections_count;
int32_t external_connections_count;
int32_t message_drops;
int64_t data_id;
int64_t data_clock;
int32_t data_frequency_mhz;
std::map<std::string, std::string> attributes;
Expand Down
1 change: 0 additions & 1 deletion app/mon/mon_tui/src/model/monitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ class MonitorModel
topic.local_connections_count = t.connections_local();
topic.external_connections_count = t.connections_external();
topic.message_drops = t.message_drops();
topic.data_id = t.data_id();
topic.data_clock = t.data_clock();
topic.data_frequency_mhz = t.data_frequency();
}
Expand Down
1 change: 1 addition & 0 deletions ecal/core/include/ecal/types/monitoring.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ namespace eCAL
int32_t connections_external{0}; //!< number of external connected entities
int32_t message_drops{0}; //!< dropped messages

[[deprecated("The data_id field is deprecated and will always be zero")]]
int64_t data_id{0}; //!< data send id (publisher setid)
int64_t data_clock{0}; //!< data clock (send / receive action)
int32_t data_frequency{0}; //!< data frequency (send / receive samples per second) [mHz]
Expand Down
3 changes: 2 additions & 1 deletion ecal/core/src/io/shm/ecal_memfile_header.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 - 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 @@ -31,6 +31,7 @@ namespace eCAL
{ //-V802
uint16_t hdr_size = sizeof(SMemFileHeader);
uint64_t data_size = 0;
[[deprecated("This field is deprecated, but must be kept for compatibility reasons")]]
uint64_t id = 0;
uint64_t clock = 0;
int64_t time = 0;
Expand Down
6 changes: 3 additions & 3 deletions ecal/core/src/io/shm/ecal_memfile_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ namespace eCAL
// calculate user payload address
data_buf = static_cast<const char*>(buf) + mfile_hdr.hdr_size;
// call user callback function
m_data_callback(data_buf, mfile_hdr.data_size, (long long)mfile_hdr.id, (long long)mfile_hdr.clock, (long long)mfile_hdr.time, (size_t)mfile_hdr.hash);
m_data_callback(data_buf, mfile_hdr.data_size, (long long)mfile_hdr.clock, (long long)mfile_hdr.time, (size_t)mfile_hdr.hash);
}
}
else
{
// call user callback function
m_data_callback(data_buf, mfile_hdr.data_size, (long long)mfile_hdr.id, (long long)mfile_hdr.clock, (long long)mfile_hdr.time, (size_t)mfile_hdr.hash);
m_data_callback(data_buf, mfile_hdr.data_size, (long long)mfile_hdr.clock, (long long)mfile_hdr.time, (size_t)mfile_hdr.hash);
}
}
}
Expand Down Expand Up @@ -264,7 +264,7 @@ namespace eCAL
if (post_process_buffer)
{
// add sample to data reader (and call user callback function)
if (m_data_callback) m_data_callback(receive_buffer.data(), receive_buffer.size(), (long long)mfile_hdr.id, (long long)mfile_hdr.clock, (long long)mfile_hdr.time, (size_t)mfile_hdr.hash);
if (m_data_callback) m_data_callback(receive_buffer.data(), receive_buffer.size(), (long long)mfile_hdr.clock, (long long)mfile_hdr.time, (size_t)mfile_hdr.hash);
}

// send acknowledge event
Expand Down
4 changes: 2 additions & 2 deletions ecal/core/src/io/shm/ecal_memfile_pool.h
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 @@ -42,7 +42,7 @@

namespace eCAL
{
using MemFileDataCallbackT = std::function<size_t (const char *, size_t, long long, long long, long long, size_t)>;
using MemFileDataCallbackT = std::function<size_t (const char *, size_t, long long, long long, size_t)>;

////////////////////////////////////////
// CMemFileObserver
Expand Down
2 changes: 0 additions & 2 deletions ecal/core/src/io/shm/ecal_memfile_sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ namespace eCAL
struct SMemFileHeader memfile_hdr;
// set data size
memfile_hdr.data_size = static_cast<uint64_t>(data_.len);
// set header id
memfile_hdr.id = static_cast<uint64_t>(data_.id);
// set header clock
memfile_hdr.clock = static_cast<uint64_t>(data_.clock);
// set header time
Expand Down
2 changes: 0 additions & 2 deletions ecal/core/src/monitoring/ecal_monitoring_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ namespace eCAL
}
const int32_t connections_local = sample_topic.connections_local;
const int32_t connections_external = sample_topic.connections_external;
const int64_t data_id = sample_topic.data_id;
const int64_t data_clock = sample_topic.data_clock;
const int32_t message_drops = sample_topic.message_drops;
const int32_t data_frequency = sample_topic.data_frequency;
Expand Down Expand Up @@ -237,7 +236,6 @@ namespace eCAL
TopicInfo.topic_size = static_cast<int>(topic_size);
TopicInfo.connections_local = static_cast<int>(connections_local);
TopicInfo.connections_external = static_cast<int>(connections_external);
TopicInfo.data_id = data_id;
TopicInfo.data_clock = data_clock;
TopicInfo.message_drops = message_drops;
TopicInfo.data_frequency = data_frequency;
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/pubsub/ecal_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace eCAL

// send content via data writer layer
const long long write_time = (time_ == DEFAULT_TIME_ARGUMENT) ? eCAL::Time::GetMicroSeconds() : time_;
return m_publisher_impl->Write(payload_, write_time, 0);
return m_publisher_impl->Write(payload_, write_time);
}

bool CPublisher::Send(const std::string& payload_, long long time_)
Expand Down
13 changes: 3 additions & 10 deletions ecal/core/src/pubsub/ecal_publisher_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ namespace eCAL
Unregister();
}

bool CPublisherImpl::Write(CPayloadWriter& payload_, long long time_, long long filter_id_)
bool CPublisherImpl::Write(CPayloadWriter& payload_, long long time_)
{
// get payload buffer size (one time, to avoid multiple computations)
const size_t payload_buf_size(payload_.GetSize());
Expand All @@ -174,7 +174,7 @@ namespace eCAL
}

// prepare counter and internal states
const size_t snd_hash = PrepareWrite(filter_id_, payload_buf_size);
const size_t snd_hash = PrepareWrite(payload_buf_size);

// did we write anything
bool written(false);
Expand All @@ -195,7 +195,6 @@ namespace eCAL
// fill writer data
struct SWriterAttr wattr;
wattr.len = payload_buf_size;
wattr.id = m_id;
wattr.clock = m_clock;
wattr.hash = snd_hash;
wattr.time = time_;
Expand Down Expand Up @@ -258,7 +257,6 @@ namespace eCAL
// fill writer data
struct SWriterAttr wattr;
wattr.len = payload_buf_size;
wattr.id = m_id;
wattr.clock = m_clock;
wattr.hash = snd_hash;
wattr.time = time_;
Expand Down Expand Up @@ -307,7 +305,6 @@ namespace eCAL
// fill writer data
struct SWriterAttr wattr;
wattr.len = payload_buf_size;
wattr.id = m_id;
wattr.clock = m_clock;
wattr.hash = snd_hash;
wattr.time = time_;
Expand Down Expand Up @@ -630,7 +627,6 @@ namespace eCAL

ecal_reg_sample_topic.process_name = m_attributes.process_name;
ecal_reg_sample_topic.unit_name = m_attributes.unit_name;
ecal_reg_sample_topic.data_id = m_id;
ecal_reg_sample_topic.data_clock = m_clock;
ecal_reg_sample_topic.data_frequency = GetFrequency();

Expand Down Expand Up @@ -818,11 +814,8 @@ namespace eCAL
#endif
}

size_t CPublisherImpl::PrepareWrite(long long id_, size_t len_)
size_t CPublisherImpl::PrepareWrite(size_t len_)
{
// store id
m_id = id_;

// handle write counters
RefreshSendCounter();

Expand Down
5 changes: 2 additions & 3 deletions ecal/core/src/pubsub/ecal_publisher_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace eCAL
CPublisherImpl(const SDataTypeInformation& topic_info_, const eCAL::eCALWriter::SAttributes& attr_);
~CPublisherImpl();

bool Write(CPayloadWriter& payload_, long long time_, long long filter_id_);
bool Write(CPayloadWriter& payload_, long long time_);

bool SetDataTypeInformation(const SDataTypeInformation& topic_info_);

Expand Down Expand Up @@ -120,7 +120,7 @@ namespace eCAL

size_t GetConnectionCount();

size_t PrepareWrite(long long id_, size_t len_);
size_t PrepareWrite(size_t len_);

TransportLayer::eType DetermineTransportLayer2Start(const std::vector<eTLayerType>& enabled_pub_layer_, const std::vector<eTLayerType>& enabled_sub_layer_, bool same_host_);

Expand Down Expand Up @@ -148,7 +148,6 @@ namespace eCAL
std::mutex m_event_id_callback_mutex;
PubEventCallbackT m_event_id_callback;

long long m_id = 0;
long long m_clock = 0;

std::mutex m_frequency_calculator_mutex;
Expand Down
5 changes: 2 additions & 3 deletions ecal/core/src/pubsub/ecal_subgate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ namespace eCAL
ecal_sample.topic_info,
payload_addr,
payload_size,
ecal_sample_content.id,
ecal_sample_content.clock,
ecal_sample_content.time,
static_cast<size_t>(ecal_sample_content.hash),
Expand All @@ -178,7 +177,7 @@ namespace eCAL
return (applied_size > 0);
}

bool CSubGate::ApplySample(const Payload::TopicInfo& topic_info_, const char* buf_, size_t len_, long long id_, long long clock_, long long time_, size_t hash_, eTLayerType layer_)
bool CSubGate::ApplySample(const Payload::TopicInfo& topic_info_, const char* buf_, size_t len_, long long clock_, long long time_, size_t hash_, eTLayerType layer_)
{
if (!m_created) return false;

Expand All @@ -199,7 +198,7 @@ namespace eCAL

for (const auto& reader : readers_to_apply)
{
applied_size = reader->ApplySample(topic_info_, buf_, len_, id_, clock_, time_, hash_, layer_);
applied_size = reader->ApplySample(topic_info_, buf_, len_, clock_, time_, hash_, layer_);
}

return (applied_size > 0);
Expand Down
4 changes: 2 additions & 2 deletions ecal/core/src/pubsub/ecal_subgate.h
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 @@ -49,7 +49,7 @@ namespace eCAL
bool HasSample(const std::string& sample_name_);

bool ApplySample(const char* serialized_sample_data_, size_t serialized_sample_size_, eTLayerType layer_);
bool ApplySample(const Payload::TopicInfo& topic_info_, const char* buf_, size_t len_, long long id_, long long clock_, long long time_, size_t hash_, eTLayerType layer_);
bool ApplySample(const Payload::TopicInfo& topic_info_, const char* buf_, size_t len_, long long clock_, long long time_, size_t hash_, eTLayerType layer_);

void ApplyPublisherRegistration(const Registration::Sample& ecal_sample_);
void ApplyPublisherUnregistration(const Registration::Sample& ecal_sample_);
Expand Down
28 changes: 1 addition & 27 deletions ecal/core/src/pubsub/ecal_subscriber_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,6 @@ namespace eCAL
return true;
}

void CSubscriberImpl::SetFilterIDs(const std::set<long long>& filter_ids_)
{
#ifndef NDEBUG
Logging::Log(Logging::log_level_debug2, m_attributes.topic_name + "::CSubscriberImpl::SetFilterIDs");
#endif

m_id_set = filter_ids_;
}

void CSubscriberImpl::ApplyPublisherRegistration(const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_, const SLayerStates& pub_layer_states_)
{
// flag write enabled from publisher side (information not used yet)
Expand Down Expand Up @@ -370,7 +361,7 @@ namespace eCAL
#endif
}

size_t CSubscriberImpl::ApplySample(const Payload::TopicInfo& topic_info_, const char* payload_, size_t size_, long long id_, long long clock_, long long time_, size_t /*hash_*/, eTLayerType layer_)
size_t CSubscriberImpl::ApplySample(const Payload::TopicInfo& topic_info_, const char* payload_, size_t size_, long long clock_, long long time_, size_t /*hash_*/, eTLayerType layer_)
{
// ensure thread safety
const std::lock_guard<std::mutex> lock(m_receive_callback_mutex);
Expand All @@ -391,12 +382,6 @@ namespace eCAL
return size_;
}

// We might not want to apply samples sent with a given ID (deprecated!)
if (!ShouldApplySampleBasedOnId(id_))
{
return 0;
}

// store receive layer
m_layers.udp.active |= layer_ == tl_ecal_udp;
m_layers.shm.active |= layer_ == tl_ecal_shm;
Expand Down Expand Up @@ -774,17 +759,6 @@ namespace eCAL
return true;
}

bool CSubscriberImpl::ShouldApplySampleBasedOnId(long long id_) const
{
//
if (!m_id_set.empty() && (m_id_set.find(id_) == m_id_set.end()))
{
return false;
}

return true;
}

void CSubscriberImpl::TriggerFrequencyUpdate()
{
const auto receive_time = std::chrono::steady_clock::now();
Expand Down
7 changes: 1 addition & 6 deletions ecal/core/src/pubsub/ecal_subscriber_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ namespace eCAL
bool SetEventCallback(const SubEventCallbackT& callback_);
bool RemoveEventCallback();

void SetFilterIDs(const std::set<long long>& filter_ids_);

void ApplyPublisherRegistration(const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_, const SLayerStates& pub_layer_states_);
void ApplyPublisherUnregistration(const SPublicationInfo& publication_info_, const SDataTypeInformation& data_type_info_);

Expand All @@ -103,7 +101,7 @@ namespace eCAL
const SDataTypeInformation& GetDataTypeInformation() const { return(m_topic_info); }

void InitializeLayers();
size_t ApplySample(const Payload::TopicInfo& topic_info_, const char* payload_, size_t size_, long long id_, long long clock_, long long time_, size_t hash_, eTLayerType layer_);
size_t ApplySample(const Payload::TopicInfo& topic_info_, const char* payload_, size_t size_, long long clock_, long long time_, size_t hash_, eTLayerType layer_);

protected:
void Register();
Expand All @@ -127,7 +125,6 @@ namespace eCAL

bool ShouldApplySampleBasedOnClock(const SPublicationInfo& publication_info_, long long clock_) const;
bool ShouldApplySampleBasedOnLayer(eTLayerType layer_) const;
bool ShouldApplySampleBasedOnId(long long id_) const;

void TriggerFrequencyUpdate();
void TriggerMessageDropUdate(const SPublicationInfo& publication_info_, uint64_t message_counter);
Expand Down Expand Up @@ -177,8 +174,6 @@ namespace eCAL

using CounterCacheMapT = CounterCacheMap<SPublicationInfo>;
CounterCacheMapT m_publisher_message_counter_map;

std::set<long long> m_id_set;

SLayerStates m_layers;
std::atomic<bool> m_created;
Expand Down
3 changes: 1 addition & 2 deletions ecal/core/src/readwrite/ecal_writer_data.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 - 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 @@ -30,7 +30,6 @@ namespace eCAL
struct SWriterAttr
{
size_t len = 0;
long long id = 0;
long long clock = 0;
size_t hash = 0;
long long time = 0;
Expand Down
8 changes: 4 additions & 4 deletions ecal/core/src/readwrite/shm/ecal_reader_shm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@ namespace eCAL
topic_info.topic_id = par_.topic_id;
topic_info.process_id = par_.process_id;

auto data_callback = [this, topic_info](const char* buf_, size_t len_, long long id_, long long clock_, long long time_, size_t hash_)->size_t
auto data_callback = [this, topic_info](const char* buf_, size_t len_, long long clock_, long long time_, size_t hash_)->size_t
{
return OnNewShmFileContent(topic_info, buf_, len_, id_, clock_, time_, hash_);
return OnNewShmFileContent(topic_info, buf_, len_, clock_, time_, hash_);
};
g_memfile_pool()->ObserveFile(memfile_name, memfile_event, m_attributes.registration_timeout_ms, data_callback);
}
}
}

size_t CSHMReaderLayer::OnNewShmFileContent(const Payload::TopicInfo& topic_info_, const char* buf_, size_t len_, long long id_, long long clock_, long long time_, size_t hash_)
size_t CSHMReaderLayer::OnNewShmFileContent(const Payload::TopicInfo& topic_info_, const char* buf_, size_t len_, long long clock_, long long time_, size_t hash_)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: method 'OnNewShmFileContent' can be made static [readability-convert-member-functions-to-static]

ecal/core/src/readwrite/shm/ecal_reader_shm.h:52:

-     size_t OnNewShmFileContent(const Payload::TopicInfo& topic_info_, const char* buf_, size_t len_, long long clock_, long long time_, size_t hash_);
+     static size_t OnNewShmFileContent(const Payload::TopicInfo& topic_info_, const char* buf_, size_t len_, long long clock_, long long time_, size_t hash_);

{
if (g_subgate() != nullptr)
{
if (g_subgate()->ApplySample(topic_info_, buf_, len_, id_, clock_, time_, hash_, tl_ecal_shm))
if (g_subgate()->ApplySample(topic_info_, buf_, len_, clock_, time_, hash_, tl_ecal_shm))
{
return len_;
}
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/src/readwrite/shm/ecal_reader_shm.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace eCAL
void SetConnectionParameter(SReaderLayerPar& par_) override;

private:
size_t OnNewShmFileContent(const Payload::TopicInfo& topic_info_, const char* buf_, size_t len_, long long id_, long long clock_, long long time_, size_t hash_);
size_t OnNewShmFileContent(const Payload::TopicInfo& topic_info_, const char* buf_, size_t len_, long long clock_, long long time_, size_t hash_);

eCAL::eCALReader::SHM::SAttributes m_attributes;
};
Expand Down
1 change: 0 additions & 1 deletion ecal/core/src/readwrite/tcp/ecal_reader_tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ namespace eCAL
ecal_header_topic_info,
data_payload,
static_cast<size_t>(ecal_header_content.size),
ecal_header_content.id,
ecal_header_content.clock,
ecal_header_content.time,
ecal_header_content.hash,
Expand Down
Loading
Loading