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

Feature/topic info header 2 #1157

Merged
merged 3 commits into from
Jul 21, 2023
Merged
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
8 changes: 4 additions & 4 deletions app/mon/mon_cli/src/ecal_mon_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,11 @@ 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;
std::cout << "could not get type name 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
5 changes: 2 additions & 3 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,6 @@ set(ecal_header_cmn
include/ecal/ecal_log.h
include/ecal/ecal_log_level.h
include/ecal/ecal_monitoring.h
include/ecal/ecal_monitoring_entity.h
include/ecal/ecal_monitoring_struct.h
include/ecal/ecal_os.h
include/ecal/ecal_payload_writer.h
include/ecal/ecal_process.h
Expand All @@ -345,7 +343,8 @@ 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
include/ecal/types/monitoring.h
)

set(ecal_header_cimpl
Expand Down
1 change: 0 additions & 1 deletion ecal/core/include/ecal/ecal.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <ecal/ecal_log.h>
#include <ecal/ecal_process.h>
#include <ecal/ecal_monitoring.h>
#include <ecal/ecal_monitoring_struct.h>
#include <ecal/ecal_publisher.h>
#include <ecal/ecal_qos.h>
#include <ecal/ecal_server.h>
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
13 changes: 12 additions & 1 deletion ecal/core/include/ecal/ecal_monitoring.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_deprecate.h>
#include <ecal/ecal_monitoring_entity.h>
#include <ecal/types/monitoring.h>
#include <string>

namespace eCAL
Expand Down Expand Up @@ -78,6 +78,17 @@ namespace eCAL
* @return Zero if succeeded.
**/
ECAL_API int GetMonitoring(std::string& mon_, unsigned int entities_);

/**
* @brief Get monitoring as a struct.
*
* @param [out] mon_ Target struct to store monitoring information.
* @param entities_ Entities definition.
*
* @return Number of struct elements if succeeded.
**/
ECAL_API int GetMonitoring(eCAL::Monitoring::SMonitoring& mon_, unsigned int entities_ = Entity::All);


/**
* @brief Get logging as serialized protobuf string.
Expand Down
50 changes: 0 additions & 50 deletions ecal/core/include/ecal/ecal_monitoring_entity.h

This file was deleted.

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
Loading
Loading