|
Robot Raconteur Core C++ Library
|
Subscription for information about detected services. More...
#include <Subscription.h>
Public Member Functions | |
| std::map< ServiceSubscriptionClientID, ServiceInfo2 > | GetDetectedServiceInfo2 () |
| Returns a map of detected services. | |
| event_connection | AddServiceDetectedListener (boost::function< void(const boost::shared_ptr< ServiceInfo2Subscription > &, const ServiceSubscriptionClientID &, const ServiceInfo2 &)> handler) |
| Add a listener callback that is invoked when a service is detected. | |
| event_connection | AddServiceLostListener (boost::function< void(const boost::shared_ptr< ServiceInfo2Subscription > &, const ServiceSubscriptionClientID &, const ServiceInfo2 &)> handler) |
| Add a listener callback that is invoked when a service is lost. | |
| RR_OVIRTUAL void | Close () RR_OVERRIDE |
| Close the subscription. | |
Subscription for information about detected services.
Created using RobotRaconteurNode::SubscribeServiceInfo2()
The ServiceInfo2Subscription class is used to track services with a specific service type as they are detected on the local network and when they are lost. The currently detected services can also be retrieved. The service information is returned using the ServiceInfo2 structure.
| event_connection RobotRaconteur::ServiceInfo2Subscription::AddServiceDetectedListener | ( | boost::function< void(const boost::shared_ptr< ServiceInfo2Subscription > &, const ServiceSubscriptionClientID &, const ServiceInfo2 &)> | handler | ) |
Add a listener callback that is invoked when a service is detected.
The callback should have the signature:
void cb(ServiceInfo2SubscriptionPtr subscription, const ServiceSubscriptionClientID& client_id, const ServiceInfo2& service_info)
The returned event_connection can be used to modify or close the Boost.Signals2 connection.
| handler | The callback function |
| event_connection RobotRaconteur::ServiceInfo2Subscription::AddServiceLostListener | ( | boost::function< void(const boost::shared_ptr< ServiceInfo2Subscription > &, const ServiceSubscriptionClientID &, const ServiceInfo2 &)> | handler | ) |
Add a listener callback that is invoked when a service is lost.
The callback should have the signature:
void cb(ServiceInfo2SubscriptionPtr subscription, const ServiceSubscriptionClientID& client_id, const ServiceInfo2& service_info)
The returned event_connection can be used to modify or close the Boost.Signals2 connection.
| handler | The callback function |
| RR_OVIRTUAL void RobotRaconteur::ServiceInfo2Subscription::Close | ( | ) |
Close the subscription.
Closes the subscription. Subscriptions are automatically closed when the node is shut down.
| std::map< ServiceSubscriptionClientID, ServiceInfo2 > RobotRaconteur::ServiceInfo2Subscription::GetDetectedServiceInfo2 | ( | ) |
Returns a map of detected services.
The returned map contains the detected nodes as ServiceInfo2. The map is keyed with ServiceSubscriptionClientID.
This function does not block.