Template Class ReceivedMessageAgeCollector< T, std::enable_if_t< !std::is_same< T, rmw_message_info_t >::value > >
Defined in File received_message_age.hpp
Inheritance Relationships
Base Type
public libstatistics_collector::topic_statistics_collector::TopicStatisticsCollector< T >
(Template Class TopicStatisticsCollector)
Class Documentation
-
template<typename T>
class ReceivedMessageAgeCollector<T, std::enable_if_t<!std::is_same<T, rmw_message_info_t>::value>> : public libstatistics_collector::topic_statistics_collector::TopicStatisticsCollector<T> Class used to measure the received message, tparam T, age from a ROS2 subscriber.
- Template Parameters:
T – the message type to receive from the subscriber / listener
Public Functions
-
ReceivedMessageAgeCollector() = default
Construct a ReceivedMessageAgeCollector object.
-
virtual ~ReceivedMessageAgeCollector() = default
-
inline void OnMessageReceived(const T &received_message, const rcl_time_point_value_t now_nanoseconds) override
Handle a new incoming message. Calculate message age if a valid Header is present.
- Parameters:
received_message – the message to calculate age of.
now_nanoseconds – time the message was received in nanoseconds
-
inline virtual std::string GetMetricName() const override
Return message age metric name
- Returns:
a string representing message age metric name
-
inline virtual std::string GetMetricUnit() const override
Return message age metric unit
- Returns:
a string representing messager age metric unit
Protected Functions
-
inline virtual bool SetupStart() override
Override in order to perform necessary starting steps.
- Returns:
true if setup was successful, false otherwise.
-
inline virtual bool SetupStop() override
Override in order to perform necessary teardown.
- Returns:
true if teardown was successful, false otherwise.