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

[core] new-pub-sub-matching #1615

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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 ecal/core/include/ecal/ecal_subscriber.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace eCAL
* @brief Constructor.
*
* @param topic_name_ Unique topic name.
* @param data_type_info_ Topic data type information (encoding, type, descriptor).
* @param config_ Optional configuration parameters.
**/
ECAL_API explicit CSubscriber(const std::string& topic_name_, const Subscriber::Configuration& config_ = {});

Expand Down
8 changes: 3 additions & 5 deletions ecal/core/include/ecal/msg/subscriber.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,13 @@ namespace eCAL
* @brief Constructor.
*
* @param topic_name_ Unique topic name.
* @param config_ Optional configuration parameters.
**/
CMessageSubscriber(const std::string& topic_name_) : CSubscriber()
CMessageSubscriber(const std::string& topic_name_, const Subscriber::Configuration& config_ = {}) : CSubscriber()
, m_deserializer()
{
SDataTypeInformation topic_info = m_deserializer.GetDataTypeInformation();
CSubscriber::Create(topic_name_, topic_info);
CSubscriber::Create(topic_name_, topic_info, config_);
}

~CMessageSubscriber() noexcept
Expand Down Expand Up @@ -418,7 +419,4 @@ namespace eCAL
MsgReceiveCallbackT m_cb_callback;
Deserializer m_deserializer;
};



}
8 changes: 4 additions & 4 deletions ecal/core/src/pubsub/ecal_pubgate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,18 @@ namespace eCAL
CDataWriter::SLayerStates layer_states;
for (const auto& layer : ecal_topic.tlayer)
{
if (layer.confirmed)
if (layer.enabled)
{
switch (layer.type)
{
case TLayer::tlayer_udp_mc:
layer_states.udp = true;
layer_states.udp.read_enabled = true;
break;
case TLayer::tlayer_shm:
layer_states.shm = true;
layer_states.shm.read_enabled = true;
break;
case TLayer::tlayer_tcp:
layer_states.tcp = true;
layer_states.tcp.read_enabled = true;
break;
default:
break;
Expand Down
14 changes: 7 additions & 7 deletions ecal/core/src/pubsub/ecal_subgate.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 @@ -166,7 +166,7 @@ namespace eCAL
const auto& ecal_sample_content = ecal_sample.content;
for (const auto& reader : readers_to_apply)
{
applied_size = reader->AddSample(
applied_size = reader->ApplySample(
ecal_sample.topic.tid,
payload_addr,
payload_size,
Expand Down Expand Up @@ -207,7 +207,7 @@ namespace eCAL

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

return (applied_size > 0);
Expand All @@ -232,18 +232,18 @@ namespace eCAL
CDataReader::SLayerStates layer_states;
for (const auto& layer : ecal_topic.tlayer)
{
if (layer.confirmed)
if (layer.enabled)
{
switch (layer.type)
{
case TLayer::tlayer_udp_mc:
layer_states.udp = true;
layer_states.udp.write_enabled = true;
break;
case TLayer::tlayer_shm:
layer_states.shm = true;
layer_states.shm.write_enabled = true;
break;
case TLayer::tlayer_tcp:
layer_states.tcp = true;
layer_states.tcp.write_enabled = true;
break;
default:
break;
Expand Down
4 changes: 2 additions & 2 deletions ecal/core/src/pubsub/ecal_subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace eCAL
if (topic_name_.empty()) return(false);

// create datareader
m_datareader = std::make_shared<CDataReader>(topic_name_, data_type_info_);
m_datareader = std::make_shared<CDataReader>(topic_name_, data_type_info_, config_);

// register datareader
g_subgate()->Register(topic_name_, m_datareader);
Expand Down Expand Up @@ -143,7 +143,7 @@ namespace eCAL
bool CSubscriber::ReceiveBuffer(std::string& buf_, long long* time_ /* = nullptr */, int rcv_timeout_ /* = 0 */) const
{
if (!m_created) return(false);
return(m_datareader->Receive(buf_, time_, rcv_timeout_));
return(m_datareader->Read(buf_, time_, rcv_timeout_));
}

bool CSubscriber::AddReceiveCallback(ReceiveCallbackT callback_)
Expand Down
Loading
Loading