Robot Raconteur Core C++ Library
Public Member Functions | List of all members
RobotRaconteur::ServiceSubscriptionManager Class Reference

Class to manage multiple subscriptions to services. More...

Public Member Functions

 ServiceSubscriptionManager (const boost::shared_ptr< RobotRaconteurNode > &node=RobotRaconteurNode::sp())
 Construct a new ServiceSubscriptionManager object. More...
 
void Init (const std::vector< ServiceSubscriptionManagerDetails > &details)
 Initialize the subscription manager with a list of subscriptions. More...
 
void AddSubscription (const ServiceSubscriptionManagerDetails &details)
 Add a subscription to the manager. More...
 
void RemoveSubscription (const boost::string_ref &name, bool close=true)
 Remove a subscription from the manager. More...
 
void EnableSubscription (const boost::string_ref &name)
 Enable a subscription. More...
 
void DisableSubscription (const boost::string_ref &name, bool close=true)
 Disable a subscription. More...
 
boost::shared_ptr< ServiceSubscriptionGetSubscription (const boost::string_ref &name, bool force_create=true)
 Get a subscription by name. More...
 
bool IsConnected (const boost::string_ref &name)
 Get if a subscription is connected. More...
 
bool IsEnabled (const boost::string_ref &name)
 Get if a subscription is enabled. More...
 
void Close (bool close_subscriptions=true)
 Close the subscription manager. More...
 
std::vector< std::string > GetSubscriptionNames ()
 Get the names of all subscriptions. More...
 
std::vector< ServiceSubscriptionManagerDetailsGetSubscriptionDetails ()
 Get the details of all subscriptions. More...
 
boost::shared_ptr< RobotRaconteurNodeGetNode ()
 Get the node used by the subscription manager. More...
 

Detailed Description

Class to manage multiple subscriptions to services.

ServiceSubscriptionManager is used to manage multiple subscriptions to services. Subscriptions are created using information contained in ServiceSubscriptionManagerDetails structures. The subscriptions can connect using URLs or service types. The subscriptions can be enabled or disabled, and can be closed.

Constructor & Destructor Documentation

◆ ServiceSubscriptionManager()

RobotRaconteur::ServiceSubscriptionManager::ServiceSubscriptionManager ( const boost::shared_ptr< RobotRaconteurNode > &  node = RobotRaconteurNode::sp())

Construct a new ServiceSubscriptionManager object.

Parameters
node(optional) The node to use for the subscription manager

Member Function Documentation

◆ AddSubscription()

void RobotRaconteur::ServiceSubscriptionManager::AddSubscription ( const ServiceSubscriptionManagerDetails details)

Add a subscription to the manager.

Parameters
detailsThe subscription to add

◆ Close()

void RobotRaconteur::ServiceSubscriptionManager::Close ( bool  close_subscriptions = true)

Close the subscription manager.

Parameters
close_subscriptions(optional) If true, close all subscriptions

◆ DisableSubscription()

void RobotRaconteur::ServiceSubscriptionManager::DisableSubscription ( const boost::string_ref &  name,
bool  close = true 
)

Disable a subscription.

Parameters
nameThe local name of the subscription to disable
close(optional) If true, close subscription if connected

◆ EnableSubscription()

void RobotRaconteur::ServiceSubscriptionManager::EnableSubscription ( const boost::string_ref &  name)

Enable a subscription.

Parameters
nameThe local name of the subscription to enable

◆ GetNode()

boost::shared_ptr<RobotRaconteurNode> RobotRaconteur::ServiceSubscriptionManager::GetNode ( )

Get the node used by the subscription manager.

Returns
RR_SHARED_PTR<RobotRaconteurNode> The node

◆ GetSubscription()

boost::shared_ptr<ServiceSubscription> RobotRaconteur::ServiceSubscriptionManager::GetSubscription ( const boost::string_ref &  name,
bool  force_create = true 
)

Get a subscription by name.

Parameters
nameThe local name of the subscription
force_create(optional) If true, create the subscription if it does not exist
Returns
RR_SHARED_PTR<ServiceSubscription> The subscription

◆ GetSubscriptionDetails()

std::vector<ServiceSubscriptionManagerDetails> RobotRaconteur::ServiceSubscriptionManager::GetSubscriptionDetails ( )

Get the details of all subscriptions.

Returns
std::vector<ServiceSubscriptionManagerDetails> The list of subscription details

◆ GetSubscriptionNames()

std::vector<std::string> RobotRaconteur::ServiceSubscriptionManager::GetSubscriptionNames ( )

Get the names of all subscriptions.

Returns
std::vector<std::string> The list of subscription names

◆ Init()

void RobotRaconteur::ServiceSubscriptionManager::Init ( const std::vector< ServiceSubscriptionManagerDetails > &  details)

Initialize the subscription manager with a list of subscriptions.

Parameters
detailsThe list of subscriptions to initialize

◆ IsConnected()

bool RobotRaconteur::ServiceSubscriptionManager::IsConnected ( const boost::string_ref &  name)

Get if a subscription is connected.

Parameters
nameThe local name of the subscription
Returns
bool True if the subscription is connected

◆ IsEnabled()

bool RobotRaconteur::ServiceSubscriptionManager::IsEnabled ( const boost::string_ref &  name)

Get if a subscription is enabled.

Parameters
nameThe local name of the subscription
Returns
bool True if the subscription is enabled

◆ RemoveSubscription()

void RobotRaconteur::ServiceSubscriptionManager::RemoveSubscription ( const boost::string_ref &  name,
bool  close = true 
)

Remove a subscription from the manager.

Parameters
nameThe local name of the subscription to remove
close(optional) If true, close the subscription

The documentation for this class was generated from the following file: