Skip to content

Commit

Permalink
checked and marked descgate interface functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-schilasky committed Feb 2, 2024
1 parent d00bb41 commit 0de301a
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 19 deletions.
7 changes: 4 additions & 3 deletions src/core/src/pubsub/ecal_pubgate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

namespace
{
bool ApplyTopicToDescGate(const std::string& topic_name_, const eCAL::SDataTypeInformation& topic_info_)
// TODO: remove me with new CDescGate
bool ApplyTopicDescription(const std::string& topic_name_, const eCAL::SDataTypeInformation& topic_info_)
{
if (eCAL::g_descgate() != nullptr)
{
Expand Down Expand Up @@ -149,7 +150,7 @@ namespace eCAL
#endif

// store description
ApplyTopicToDescGate(topic_name, topic_information);
ApplyTopicDescription(topic_name, topic_information);

// register local subscriber
const std::shared_lock<std::shared_timed_mutex> lock(m_topic_name_datawriter_sync);
Expand Down Expand Up @@ -203,7 +204,7 @@ namespace eCAL
#endif

// store description
ApplyTopicToDescGate(topic_name, topic_information);
ApplyTopicDescription(topic_name, topic_information);

// register external subscriber
const std::shared_lock<std::shared_timed_mutex> lock(m_topic_name_datawriter_sync);
Expand Down
7 changes: 4 additions & 3 deletions src/core/src/pubsub/ecal_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

namespace
{
bool ApplyTopicToDescGate(const std::string& topic_name_, const eCAL::SDataTypeInformation& data_type_info_)
// TODO: remove me with new CDescGate
bool ApplyTopicDescription(const std::string& topic_name_, const eCAL::SDataTypeInformation& data_type_info_)
{
if (eCAL::g_descgate() != nullptr)
{
Expand Down Expand Up @@ -140,7 +141,7 @@ namespace eCAL
g_pubgate()->Register(topic_name_, m_datawriter);

// register to description gateway for type / description checking
ApplyTopicToDescGate(topic_name_, data_type_info_);
ApplyTopicDescription(topic_name_, data_type_info_);

// we made it :-)
m_created = true;
Expand Down Expand Up @@ -188,7 +189,7 @@ namespace eCAL
bool CPublisher::SetDataTypeInformation(const SDataTypeInformation& data_type_info_)
{
if (m_datawriter == nullptr) return false;
ApplyTopicToDescGate(m_datawriter->GetTopicName(), data_type_info_);
ApplyTopicDescription(m_datawriter->GetTopicName(), data_type_info_);
return m_datawriter->SetDataTypeInformation(data_type_info_);
}

Expand Down
7 changes: 4 additions & 3 deletions src/core/src/pubsub/ecal_subgate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

namespace
{
bool ApplyTopicToDescGate(const std::string& topic_name_, const eCAL::SDataTypeInformation& topic_info_)
// TODO: remove me with new CDescGate
bool ApplyTopicDescription(const std::string& topic_name_, const eCAL::SDataTypeInformation& topic_info_)
{
if (eCAL::g_descgate() != nullptr)
{
Expand Down Expand Up @@ -245,7 +246,7 @@ namespace eCAL
// store description
const std::string& topic_id = ecal_sample.tid;
const SDataTypeInformation topic_info{ eCALSampleToTopicInformation(ecal_sample_) };
ApplyTopicToDescGate(topic_name, topic_info);
ApplyTopicDescription(topic_name, topic_info);

// get process id
const std::string process_id = std::to_string(ecal_sample_.topic.pid);
Expand Down Expand Up @@ -277,7 +278,7 @@ namespace eCAL

// store description
const SDataTypeInformation topic_info{ eCALSampleToTopicInformation(ecal_sample_) };
ApplyTopicToDescGate(topic_name, topic_info);
ApplyTopicDescription(topic_name, topic_info);

// unregister local publisher
const std::shared_lock<std::shared_timed_mutex> lock(m_topic_name_datareader_sync);
Expand Down
5 changes: 3 additions & 2 deletions src/core/src/pubsub/ecal_subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

namespace
{
bool ApplyTopicToDescGate(const std::string& topic_name_, const eCAL::SDataTypeInformation& topic_info_)
// TODO: remove me with new CDescGate
bool ApplyTopicDescription(const std::string& topic_name_, const eCAL::SDataTypeInformation& topic_info_)
{
if (eCAL::g_descgate() != nullptr)
{
Expand Down Expand Up @@ -135,7 +136,7 @@ namespace eCAL
g_subgate()->Register(topic_name_, m_datareader);

// register to description gateway for type / description checking
ApplyTopicToDescGate(topic_name_, topic_info_);
ApplyTopicDescription(topic_name_, topic_info_);

// we made it :-)
m_created = true;
Expand Down
10 changes: 6 additions & 4 deletions src/core/src/registration/ecal_registration_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@

namespace
{
bool ApplyTopicToDescGate(const std::string& topic_name_, const eCAL::SDataTypeInformation& topic_info_, bool topic_is_a_publisher_)
// TODO: remove me with new CDescGate
bool ApplyTopicDescription(const std::string& topic_name_, const eCAL::SDataTypeInformation& topic_info_, bool topic_is_a_publisher_)
{
if (eCAL::g_descgate() != nullptr)
{
Expand All @@ -59,7 +60,8 @@ namespace
return false;
}

bool ApplyServiceToDescGate(const std::string& service_name_, const std::string& method_name_,
// TODO: remove me with new CDescGate
bool ApplyServiceDescription(const std::string& service_name_, const std::string& method_name_,
const eCAL::SDataTypeInformation& request_type_information_,
const eCAL::SDataTypeInformation& response_type_information_)
{
Expand Down Expand Up @@ -406,7 +408,7 @@ namespace eCAL
topic_info.name = topic_datatype.name;
topic_info.descriptor = topic_datatype.desc;

ApplyTopicToDescGate(topic_name, topic_info, topic_is_a_publisher);
ApplyTopicDescription(topic_name, topic_info, topic_is_a_publisher);

//////////////////////////////////////////////
// send sample to registration layer
Expand Down Expand Up @@ -440,7 +442,7 @@ namespace eCAL
response_type.name = method.resp_type;
response_type.descriptor = method.resp_desc;

ApplyServiceToDescGate(ecal_sample_service.sname, method.mname, request_type, response_type);
ApplyServiceDescription(ecal_sample_service.sname, method.mname, request_type, response_type);
}

//////////////////////////////////////////////
Expand Down
5 changes: 3 additions & 2 deletions src/core/src/service/ecal_clientgate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

namespace
{
bool ApplyServiceToDescGate(const std::string& service_name_, const std::string& method_name_,
// TODO: remove me with new CDescGate
bool ApplyServiceDescription(const std::string& service_name_, const std::string& method_name_,
const eCAL::SDataTypeInformation& request_type_information_,
const eCAL::SDataTypeInformation& response_type_information_)
{
Expand Down Expand Up @@ -140,7 +141,7 @@ namespace eCAL
response_type.name = method.resp_type;
response_type.descriptor = method.resp_desc;

ApplyServiceToDescGate(ecal_sample_service.sname, method.mname, request_type, response_type);
ApplyServiceDescription(ecal_sample_service.sname, method.mname, request_type, response_type);
}

// create service key
Expand Down
5 changes: 3 additions & 2 deletions src/core/src/service/ecal_service_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@

namespace
{
bool ApplyServiceToDescGate(const std::string& service_name_, const std::string& method_name_,
// TODO: remove me with new CDescGate
bool ApplyServiceDescription(const std::string& service_name_, const std::string& method_name_,
const eCAL::SDataTypeInformation& request_type_information_,
const eCAL::SDataTypeInformation& response_type_information_)
{
Expand Down Expand Up @@ -218,7 +219,7 @@ namespace eCAL
}

// update descgate infos
return ApplyServiceToDescGate(m_service_name, method_, request_type_information_, response_type_information_);
return ApplyServiceDescription(m_service_name, method_, request_type_information_, response_type_information_);
}

// add callback function for server method calls
Expand Down

0 comments on commit 0de301a

Please sign in to comment.