iox::roudi::PortIntrospection🔗
This class handles the port introspection for RouDi. It is recommended to use the PortIntrospectionType alias which sets the intended template parameter required for the actual introspection. The class manages a thread that periodically updates a field with port introspection data to which clients may subscribe. More...
#include <port_introspection.hpp>
Public Functions🔗
Name | |
---|---|
PortIntrospection() | |
~PortIntrospection() | |
PortIntrospection(PortIntrospection const & ) | |
PortIntrospection & | operator=(PortIntrospection const & ) |
PortIntrospection(PortIntrospection && ) | |
PortIntrospection & | operator=(PortIntrospection && ) |
bool | addPublisher(typename PublisherPort::MemberType_t & port) add a publisher port to be tracked by introspection |
bool | addSubscriber(typename SubscriberPort::MemberType_t & port) add a subscriber port to be tracked by introspection |
bool | removePublisher(const PublisherPort & port) remove a publisher port from introspection |
bool | removeSubscriber(const SubscriberPort & port) remove a subscriber port from introspection |
void | reportMessage(const capro::CaproMessage & message) report a capro message to introspection (since this could change the state of active connections) |
void | reportMessage(const capro::CaproMessage & message, const UniquePortId & id) report a capro message to introspection (since this could change the state of active connections) |
bool | registerPublisherPort(PublisherPort && publisherPortGeneric, PublisherPort && publisherPortThroughput, PublisherPort && publisherPortSubscriberPortsData) register publisher port used to send introspection |
void | setSendInterval(const units::Duration interval) set the time interval used to send new introspection data |
void | run() start the internal send thread |
void | stop() stop the internal send thread |
Protected Functions🔗
Name | |
---|---|
void | sendPortData() sends the port data; this is used from the unittests |
void | sendThroughputData() sends the throughput data; this is used from the unittests |
void | sendSubscriberPortsData() sends the subscriberport changing data, this is used from the unittests |
void | send() calls the three specific send functions from above, this is used from the periodic task |
Protected Attributes🔗
Name | |
---|---|
cxx::optional< PublisherPort > | m_publisherPort |
cxx::optional< PublisherPort > | m_publisherPortThroughput |
cxx::optional< PublisherPort > | m_publisherPortSubscriberPortsData |
Detailed Description🔗
template <typename PublisherPort ,
typename SubscriberPort >
class iox::roudi::PortIntrospection;
This class handles the port introspection for RouDi. It is recommended to use the PortIntrospectionType alias which sets the intended template parameter required for the actual introspection. The class manages a thread that periodically updates a field with port introspection data to which clients may subscribe.
Public Functions Documentation🔗
function PortIntrospection🔗
inline PortIntrospection()
function ~PortIntrospection🔗
inline ~PortIntrospection()
function PortIntrospection🔗
PortIntrospection(
PortIntrospection const &
)
function operator=🔗
PortIntrospection & operator=(
PortIntrospection const &
)
function PortIntrospection🔗
PortIntrospection(
PortIntrospection &&
)
function operator=🔗
PortIntrospection & operator=(
PortIntrospection &&
)
function addPublisher🔗
inline bool addPublisher(
typename PublisherPort::MemberType_t & port
)
add a publisher port to be tracked by introspection
Parameters:
- port to be added
Return: returns false if the port could not be added and true otherwise
function addSubscriber🔗
inline bool addSubscriber(
typename SubscriberPort::MemberType_t & port
)
add a subscriber port to be tracked by introspection
Parameters:
- port to be added
Return: returns false if the port could not be added and true otherwise
function removePublisher🔗
inline bool removePublisher(
const PublisherPort & port
)
remove a publisher port from introspection
Parameters:
- port publisher port to be removed
Return: returns false if the port could not be removed (since it did not exist) and true otherwise
function removeSubscriber🔗
inline bool removeSubscriber(
const SubscriberPort & port
)
remove a subscriber port from introspection
Parameters:
- port subscriber port to be removed
Return: returns false if the port could not be removed (since it did not exist) and true otherwise
function reportMessage🔗
inline void reportMessage(
const capro::CaproMessage & message
)
report a capro message to introspection (since this could change the state of active connections)
Parameters:
- message capro message to be processed
function reportMessage🔗
inline void reportMessage(
const capro::CaproMessage & message,
const UniquePortId & id
)
report a capro message to introspection (since this could change the state of active connections)
Parameters:
- message capro message to be processed
- id unique port id
Note: introduced for identifying the subscriber port whose connection state has to be updated, e.g. if a subscriber unsubscribes only its connection state should be updated - not the states of all subscribers which are subscribed to the same topic
function registerPublisherPort🔗
inline bool registerPublisherPort(
PublisherPort && publisherPortGeneric,
PublisherPort && publisherPortThroughput,
PublisherPort && publisherPortSubscriberPortsData
)
register publisher port used to send introspection
Parameters:
- publisherPort publisher port to be registered
Return: true if registration was successful, false otherwise
function setSendInterval🔗
inline void setSendInterval(
const units::Duration interval
)
set the time interval used to send new introspection data
Parameters:
- interval duration between two send invocations
function run🔗
inline void run()
start the internal send thread
function stop🔗
inline void stop()
stop the internal send thread
Protected Functions Documentation🔗
function sendPortData🔗
inline void sendPortData()
sends the port data; this is used from the unittests
function sendThroughputData🔗
inline void sendThroughputData()
sends the throughput data; this is used from the unittests
function sendSubscriberPortsData🔗
inline void sendSubscriberPortsData()
sends the subscriberport changing data, this is used from the unittests
function send🔗
inline void send()
calls the three specific send functions from above, this is used from the periodic task
Protected Attributes Documentation🔗
variable m_publisherPort🔗
cxx::optional< PublisherPort > m_publisherPort;
variable m_publisherPortThroughput🔗
cxx::optional< PublisherPort > m_publisherPortThroughput;
variable m_publisherPortSubscriberPortsData🔗
cxx::optional< PublisherPort > m_publisherPortSubscriberPortsData;
Updated on 31 May 2022 at 15:29:16 CEST