Skip to content

Commit

Permalink
Core: Final API renaming for 5.12
Browse files Browse the repository at this point in the history
GetTopicInformation -> GetDataTypeInformation
SetTopicInformation -> SetDataTypeInformation
SDataTypeInformation
  • Loading branch information
KerstinKeller committed Jul 20, 2023
1 parent 579644a commit 19b2b7f
Show file tree
Hide file tree
Showing 60 changed files with 582 additions and 541 deletions.
6 changes: 3 additions & 3 deletions app/mon/mon_cli/src/ecal_mon_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ void ProcProto(const std::string& topic_name, int msg_count)
std::this_thread::sleep_for(std::chrono::milliseconds(1000));

// get topic type
eCAL::STopicInformation topic_info;
eCAL::Util::GetTopicInformation(topic_name, topic_info);
if(topic_info.type.empty())
eCAL::SDataTypeInformation topic_info;
eCAL::Util::GetTopicDataTypeInformation(topic_name, topic_info);
if(topic_info.name.empty())
{
std::cout << "could not get type for topic " << topic_name << std::endl;
return;
Expand Down
16 changes: 8 additions & 8 deletions app/mon/mon_gui/src/widgets/models/topic_tree_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const
{
// When the monitor didn't tell us the topic encoding, we ask eCAL::Util instead
// Why this logic only for type, not descriptor? (and thus encoding?)
const std::string monitor_topic_encoding = topic_.tinfo().encoding();
const std::string monitor_topic_encoding = topic_.tdatatype().encoding();
if (!monitor_topic_encoding.empty())
{
return monitor_topic_encoding.c_str();
Expand All @@ -94,8 +94,8 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const
const std::string monitor_topic_name = topic_.tname();
if (!monitor_topic_name.empty())
{
eCAL::STopicInformation topic_info;
eCAL::Util::GetTopicInformation(monitor_topic_name, topic_info);
eCAL::SDataTypeInformation topic_info;
eCAL::Util::GetTopicDataTypeInformation(monitor_topic_name, topic_info);
return topic_info.encoding.c_str();
}
}
Expand All @@ -104,7 +104,7 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const
{
// When the monitor didn't tell us the topic type, we ask eCAL::Util instead
// Why this logic only for type, not descriptor? (and thus encoding?)
const std::string monitor_topic_type = topic_.tinfo().type();
const std::string monitor_topic_type = topic_.tdatatype().name();
if (!monitor_topic_type.empty())
{
return monitor_topic_type.c_str();
Expand All @@ -114,15 +114,15 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const
const std::string monitor_topic_name = topic_.tname();
if (!monitor_topic_name.empty())
{
eCAL::STopicInformation topic_info;
eCAL::Util::GetTopicInformation(monitor_topic_name, topic_info);
return topic_info.type.c_str();
eCAL::SDataTypeInformation topic_info;
eCAL::Util::GetTopicDataTypeInformation(monitor_topic_name, topic_info);
return topic_info.name.c_str();
}
}
}
else if (column == Columns::TDESC)
{
return topic_.tinfo().desc().c_str();
return topic_.tdatatype().desc().c_str();
}
else if (column == Columns::TQOS)
{
Expand Down
2 changes: 1 addition & 1 deletion ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ set(ecal_header_cmn
include/ecal/ecal_util.h
include/ecal/ecalc.h
include/ecal/ecalc_types.h
include/ecal/types/topic_information.h
include/ecal/ecal_types.h
)

set(ecal_header_cimpl
Expand Down
38 changes: 19 additions & 19 deletions ecal/core/include/ecal/ecal_callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <ecal/ecal_deprecate.h>
#include <ecal/cimpl/ecal_callback_cimpl.h>
#include <ecal/types/topic_information.h>
#include <ecal/ecal_types.h>

#include <functional>
#include <string>
Expand Down Expand Up @@ -64,15 +64,15 @@ namespace eCAL
time = 0;
clock = 0;
};
eCAL_Publisher_Event type; //!< publisher event type
long long time; //!< publisher event time in µs
long long clock; //!< publisher event clock
std::string tid; //!< topic id of the of the connected subscriber (for pub_event_update_connection only)
ECAL_DEPRECATE_SINCE_5_13("Use the separate infos encoding and type in member tinfo instead of ttype.")
std::string ttype; //!< topic type information of the connected publisher (for sub_event_update_connection only)
ECAL_DEPRECATE_SINCE_5_13("Use the tinfo.descriptor instead of tdesc.")
std::string tdesc; //!< topic descriptor information of the connected publisher (for sub_event_update_connection only)
STopicInformation tinfo; //!< topic information of the connected subscriber (for pub_event_update_connection only)
eCAL_Publisher_Event type; //!< publisher event type
long long time; //!< publisher event time in µs
long long clock; //!< publisher event clock
std::string tid; //!< topic id of the of the connected subscriber (for pub_event_update_connection only)
ECAL_DEPRECATE_SINCE_5_13("Use the separate infos encoding and type in member tdatatype instead of ttype.")
std::string ttype; //!< topic type information of the connected publisher (for sub_event_update_connection only)
ECAL_DEPRECATE_SINCE_5_13("Use the tdatatype.descriptor instead of tdesc.")
std::string tdesc; //!< topic descriptor information of the connected publisher (for sub_event_update_connection only)
SDataTypeInformation tdatatype; //!< datatype description of the connected subscriber (for pub_event_update_connection only)
};

/**
Expand All @@ -86,15 +86,15 @@ namespace eCAL
time = 0;
clock = 0;
};
eCAL_Subscriber_Event type; //!< subscriber event type
long long time; //!< subscriber event time in µs
long long clock; //!< subscriber event clock
std::string tid; //!< topic id of the of the connected publisher (for sub_event_update_connection only)
ECAL_DEPRECATE_SINCE_5_13("Use the separate infos encoding and type in member tinfo instead of ttype.")
std::string ttype; //!< topic type information of the connected publisher (for sub_event_update_connection only)
ECAL_DEPRECATE_SINCE_5_13("Use the tinfo.descriptor instead of tdesc.")
std::string tdesc; //!< topic descriptor information of the connected publisher (for sub_event_update_connection only)
STopicInformation tinfo; //!< topic information of the connected subscriber (for pub_event_update_connection only)
eCAL_Subscriber_Event type; //!< subscriber event type
long long time; //!< subscriber event time in µs
long long clock; //!< subscriber event clock
std::string tid; //!< topic id of the of the connected publisher (for sub_event_update_connection only)
ECAL_DEPRECATE_SINCE_5_13("Use the separate infos encoding and type in member tdatatype instead of ttype.")
std::string ttype; //!< topic type information of the connected publisher (for sub_event_update_connection only)
ECAL_DEPRECATE_SINCE_5_13("Use the tdatatype.descriptor instead of tdesc.")
std::string tdesc; //!< topic descriptor information of the connected publisher (for sub_event_update_connection only)
SDataTypeInformation tdatatype; //!< topic information of the connected subscriber (for pub_event_update_connection only)
};

/**
Expand Down
4 changes: 2 additions & 2 deletions ecal/core/include/ecal/ecal_monitoring_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <ecal/ecal_os.h>
#include <ecal/ecal_monitoring_entity.h>
#include <ecal/types/topic_information.h>
#include <ecal/ecal_types.h>

#include <map>
#include <string>
Expand Down Expand Up @@ -66,7 +66,7 @@ namespace eCAL
std::string tid; //!< topic id
std::string tname; //!< topic name
std::string direction; //!< direction (publisher, subscriber)
STopicInformation tinfo; //!< topic information (encoding, type, descriptor)
SDataTypeInformation tdatatype; //!< topic datatype description (encoding, type, descriptor)
int tsize; //!< topic size

bool tlayer_ecal_udp_mc; //!< transport layer udp active
Expand Down
27 changes: 13 additions & 14 deletions ecal/core/include/ecal/ecal_publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <ecal/ecal_payload_writer.h>
#include <ecal/ecal_qos.h>
#include <ecal/ecal_tlayer.h>
#include <ecal/types/topic_information.h>
#include <ecal/ecal_types.h>

#include <chrono>
#include <memory>
Expand Down Expand Up @@ -86,7 +86,7 @@ namespace eCAL
* @param topic_type_ Type name.
* @param topic_desc_ Type description (optional).
**/
ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CPublisher(const std::string& topic_name_, const STopicInformation& topic_info_) instead. This function will be removed in eCAL6.")
ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CPublisher(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6.")
ECAL_API CPublisher(const std::string& topic_name_, const std::string& topic_type_, const std::string& topic_desc_ = "");

/**
Expand All @@ -95,7 +95,7 @@ namespace eCAL
* @param topic_name_ Unique topic name.
* @param topic_info_ Topic information (encoding, type, descriptor)
**/
ECAL_API CPublisher(const std::string& topic_name_, const STopicInformation& topic_info_);
ECAL_API CPublisher(const std::string& topic_name_, const SDataTypeInformation& topic_info_);

/**
* @brief Constructor.
Expand Down Expand Up @@ -139,7 +139,7 @@ namespace eCAL
*
* @return True if it succeeds, false if it fails.
**/
ECAL_DEPRECATE_SINCE_5_13("Please use the create method bool Create(const std::string& topic_name_, const STopicInformation& topic_info_) instead. This function will be removed in eCAL6.")
ECAL_DEPRECATE_SINCE_5_13("Please use the create method bool Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6.")
ECAL_API bool Create(const std::string& topic_name_, const std::string& topic_type_, const std::string& topic_desc_ = "");

/**
Expand All @@ -150,7 +150,7 @@ namespace eCAL
*
* @return True if it succeeds, false if it fails.
**/
ECAL_API bool Create(const std::string& topic_name_, const STopicInformation& topic_info_);
ECAL_API bool Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_);

/**
* @brief Creates this object.
Expand All @@ -162,10 +162,9 @@ namespace eCAL
**/
ECAL_API bool Create(const std::string& topic_name_)
{
return Create(topic_name_, STopicInformation());
return Create(topic_name_, SDataTypeInformation());
}


/**
* @brief Destroys this object.
*
Expand All @@ -180,7 +179,7 @@ namespace eCAL
*
* @return True if it succeeds, false if it fails.
**/
ECAL_DEPRECATE_SINCE_5_13("Please use the method bool SetTopicInformation(const STopicInformation& topic_info_) instead. This function will be removed in eCAL6")
ECAL_DEPRECATE_SINCE_5_13("Please use the method bool SetDataTypeInformation(const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6")
ECAL_API bool SetTypeName(const std::string& topic_type_name_);

/**
Expand All @@ -190,7 +189,7 @@ namespace eCAL
*
* @return True if it succeeds, false if it fails.
**/
ECAL_DEPRECATE_SINCE_5_13("Please use the method bool SetTopicInformation(const STopicInformation& topic_info_) instead. This function will be removed in eCAL6")
ECAL_DEPRECATE_SINCE_5_13("Please use the method bool SetDataTypeInformation(const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6")
ECAL_API bool SetDescription(const std::string& topic_desc_);

/**
Expand All @@ -200,7 +199,7 @@ namespace eCAL
*
* @return True if it succeeds, false if it fails.
**/
ECAL_API bool SetTopicInformation(const STopicInformation& topic_info_);
ECAL_API bool SetDataTypeInformation(const SDataTypeInformation& topic_info_);

/**
* @brief Sets publisher attribute.
Expand Down Expand Up @@ -507,23 +506,23 @@ namespace eCAL
*
* @return The type name.
**/
ECAL_DEPRECATE_SINCE_5_13("Please use the method STopicInformation GetTopicInformation() instead. You can extract the typename from the STopicInformation variable. This function will be removed in eCAL6.")
ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the STopicInformation variable. This function will be removed in eCAL6.")
ECAL_API std::string GetTypeName() const;

/**
* @brief Gets description of the connected topic.
*
* @return The description.
**/
ECAL_DEPRECATE_SINCE_5_13("Please use the method STopicInformation GetTopicInformation() instead. You can extract the descriptor from the STopicInformation variable. This function will be removed in eCAL6.")
ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the descriptor from the STopicInformation variable. This function will be removed in eCAL6.")
ECAL_API std::string GetDescription() const;

/**
* @brief Gets description of the connected topic.
*
* @return The topic information.
**/
ECAL_API STopicInformation GetTopicInformation() const;
ECAL_API SDataTypeInformation GetDataTypeInformation() const;

/**
* @brief Dump the whole class state into a string.
Expand All @@ -537,7 +536,7 @@ namespace eCAL
protected:
void InitializeQOS();
void InitializeTLayer();
bool ApplyTopicToDescGate(const std::string& topic_name_, const STopicInformation& topic_info_);
bool ApplyTopicToDescGate(const std::string& topic_name_, const SDataTypeInformation& topic_info_);

// class members
std::shared_ptr<CDataWriter> m_datawriter;
Expand Down
1 change: 1 addition & 0 deletions ecal/core/include/ecal/ecal_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#pragma once

#include <ecal/ecal_deprecate.h>
#include <ecal/ecal_os.h>
#include <ecal/ecal_callback.h>
#include <ecal/ecal_service_info.h>
Expand Down
18 changes: 9 additions & 9 deletions ecal/core/include/ecal/ecal_subscriber.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <ecal/ecal_deprecate.h>
#include <ecal/ecal_callback.h>
#include <ecal/ecal_qos.h>
#include <ecal/types/topic_information.h>
#include <ecal/ecal_types.h>

#include <memory>
#include <set>
Expand Down Expand Up @@ -96,7 +96,7 @@ namespace eCAL
* @param topic_type_ Type name (optional for type checking).
* @param topic_desc_ Type description (optional for description checking).
**/
ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CSubscriber(const std::string& topic_name_, const STopicInformation& topic_info_) instead. This function will be removed in eCAL6.")
ECAL_DEPRECATE_SINCE_5_13("Please use the constructor CSubscriber(const std::string& topic_name_, const SDataTypeInformation& topic_info_) instead. This function will be removed in eCAL6.")
ECAL_API CSubscriber(const std::string& topic_name_, const std::string& topic_type_, const std::string& topic_desc_ = "");

/**
Expand All @@ -105,7 +105,7 @@ namespace eCAL
* @param topic_name_ Unique topic name.
* @param topic_info_ Topic information (encoding, type, descriptor)
**/
ECAL_API CSubscriber(const std::string& topic_name_, const STopicInformation& topic_info_);
ECAL_API CSubscriber(const std::string& topic_name_, const SDataTypeInformation& topic_info_);

/**
* @brief Constructor.
Expand Down Expand Up @@ -159,7 +159,7 @@ namespace eCAL
* @return True if it succeeds, false if it fails.
**/
ECAL_API bool Create(const std::string& topic_name_) {
return Create(topic_name_, STopicInformation{});
return Create(topic_name_, SDataTypeInformation{});
}

/**
Expand All @@ -170,7 +170,7 @@ namespace eCAL
*
* @return True if it succeeds, false if it fails.
**/
ECAL_API bool Create(const std::string& topic_name_, const STopicInformation& topic_info_);
ECAL_API bool Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_);

/**
* @brief Destroys this object.
Expand Down Expand Up @@ -309,23 +309,23 @@ namespace eCAL
*
* @return The type name.
**/
ECAL_DEPRECATE_SINCE_5_13("Please use the method STopicInformation GetTopicInformation() instead. You can extract the typename from the STopicInformation variable. This function will be removed in eCAL6.")
ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the typename from the STopicInformation variable. This function will be removed in eCAL6.")
ECAL_API std::string GetTypeName() const;

/**
* @brief Gets description of the connected topic.
*
* @return The description.
**/
ECAL_DEPRECATE_SINCE_5_13("Please use the method STopicInformation GetTopicInformation() instead. You can extract the descriptor from the STopicInformation variable. This function will be removed in eCAL6.")
ECAL_DEPRECATE_SINCE_5_13("Please use the method SDataTypeInformation GetDataTypeInformation() instead. You can extract the descriptor from the STopicInformation variable. This function will be removed in eCAL6.")
ECAL_API std::string GetDescription() const;

/**
* @brief Gets description of the connected topic.
*
* @return The topic information.
**/
ECAL_API STopicInformation GetTopicInformation() const;
ECAL_API SDataTypeInformation GetDataTypeInformation() const;

/**
* @brief Set the timeout parameter for triggering
Expand All @@ -348,7 +348,7 @@ namespace eCAL

protected:
void InitializeQOS();
bool ApplyTopicToDescGate(const std::string& topic_name_, const STopicInformation& topic_info_);
bool ApplyTopicToDescGate(const std::string& topic_name_, const SDataTypeInformation& topic_info_);

// class members
std::shared_ptr<CDataReader> m_datareader;
Expand Down
Loading

0 comments on commit 19b2b7f

Please sign in to comment.