Class PortIntrospection::PortData
Defined in File port_introspection.hpp
Nested Relationships
This class is a nested type of Template Class PortIntrospection.
Nested Types
Class Documentation
-
class PortData
Public Functions
-
PortData() noexcept
-
bool addPublisher(typename PublisherPort::MemberType_t &port) noexcept
add a publisher port to be tracked by introspection
- Parameters:
port – [in] to be added
- Returns:
returns false if the port could not be added and true otherwise
-
bool addSubscriber(typename SubscriberPort::MemberType_t &portData) noexcept
add a subscriber port to be tracked by introspection
- Parameters:
portData – [in] to be added
- Returns:
returns false if the port could not be added and true otherwise
-
bool removePublisher(const PublisherPort &port) noexcept
remove a publisher port from introspection
- Parameters:
port – [in] publisher port to be removed
- Returns:
returns false if the port could not be removed (since it did not exist) and true otherwise
-
bool removeSubscriber(const SubscriberPort &port) noexcept
remove a subscriber port from introspection
- Parameters:
port – [in] subscriber port to be removed
- Returns:
returns false if the port could not be removed (since it did not exist) and true otherwise
-
bool updateConnectionState(const capro::CaproMessage &message) noexcept
update the state of any connection identified by the capro id of a given message according to the message type (e.g. capro::SUB for a subscription request)
- Parameters:
message – [in] capro message to be processed
- Returns:
returns false there is no corresponding capro service and true otherwise
-
bool updateSubscriberConnectionState(const capro::CaproMessage &message, const popo::UniquePortId &id) noexcept
update the subscriber connection state identified by the unique port id and the capro id of a given message according to the message type (e.g. capro::SUB for a subscription request)
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
- Parameters:
message – [in] capro message to be processed
id – [in] unique port id
- Returns:
false if there is no corresponding capro service or unique port id, otherwise true
-
void prepareTopic(PortIntrospectionTopic &topic) noexcept
prepare the topic to be send based on the internal connection state of all tracked ports
- Parameters:
topic – [out] data structure to be prepared for sending
-
void prepareTopic(PortThroughputIntrospectionTopic &topic) noexcept
-
void prepareTopic(SubscriberPortChangingIntrospectionFieldTopic &topic) noexcept
-
template<typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
PortIntrospection::ConnectionState getNextState(ConnectionState currentState, capro::CaproMessageType messageType) noexcept compute the next connection state based on the current connection state and a capro message type when the communication policy is OneToMany
- Parameters:
currentState – [in] current connection state (e.g. CONNECTED)
messageType – [in] capro message type
- Returns:
returns the new connection state
-
template<typename T, std::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>* = nullptr>
PortIntrospection::ConnectionState getNextState(ConnectionState currentState, capro::CaproMessageType messageType) noexcept compute the next connection state based on the current connection state and a capro message type when the communication policy is ManyToMany
- Parameters:
currentState – [in] current connection state (e.g. CONNECTED)
messageType – [in] capro message type
- Returns:
returns the new connection state
-
bool isNew() const noexcept
indicates whether the logical object state has changed (i.e. the data is new)
- Returns:
returns true if the data is new(e.g. new connections were established), false otherwise
-
void setNew(bool value) noexcept
sets the internal flag indicating new data
- Parameters:
value – [in] value to be set
-
PortData() noexcept