All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
gazebo::transport::TopicManager Class Reference

Manages topics and their subscriptions. More...

#include <TopicManager.hh>

Inheritance diagram for gazebo::transport::TopicManager:
Inheritance graph
[legend]

Public Types

typedef std::map< std::string,
std::list< NodePtr > > 
SubNodeMap
 

Public Member Functions

void AddNode (NodePtr _node)
 
template<typename M >
PublisherPtr Advertise (const std::string &_topic, unsigned int _queueLimit, bool _latch)
 Advertise on a topic.
 
void ClearBuffers ()
 
void ConnectPubToSub (const std::string &topic, const SubscriptionTransportPtr &sublink)
 Connection a local Publisher to a remote Subscriber.
 
void ConnectSubscribers (const std::string &topic)
 Connect all subscribers on a topic to known publishers.
 
void ConnectSubToPub (const msgs::Publish &_pub)
 Connect a local Subscriber to a remote Publisher.
 
void DisconnectPubFromSub (const std::string &topic, const std::string &host, unsigned int port)
 Disconnect a local publisher from a remote subscriber.
 
void DisconnectSubFromPub (const std::string &topic, const std::string &host, unsigned int port)
 Disconnection all local subscribers from a remote publisher.
 
PublicationPtr FindPublication (const std::string &topic)
 
void Fini ()
 
void GetTopicNamespaces (std::list< std::string > &_namespaces)
 Get all the topic namespaces.
 
void Init ()
 
bool IsAdvertised (const std::string &_topic)
 Returns true if the topic has been advertised.
 
void PauseIncoming (bool _pause)
 
void ProcessNodes (bool _onlyOut=false)
 
void Publish (const std::string &topic, const google::protobuf::Message &message, const boost::function< void()> &cb=NULL)
 Send a message.
 
void RegisterTopicNamespace (const std::string &_name)
 Register a new topic namespace.
 
void RemoveNode (unsigned int _id)
 
SubscriberPtr Subscribe (const SubscribeOptions &options)
 Subscribe to a topic.
 
void Unadvertise (const std::string &topic)
 Stop advertising on a topic.
 
void Unsubscribe (const std::string &_topic, const NodePtr &_sub)
 Unsubscribe from a topic.
 
PublicationPtr UpdatePublications (const std::string &topic, const std::string &msgType)
 Update our list of advertised topics.
 

Additional Inherited Members

- Static Public Member Functions inherited from SingletonT< T >
static T * Instance ()
 Get an instance of the singleton.
 
- Protected Member Functions inherited from SingletonT< T >
 SingletonT ()
 Constructor.
 
virtual ~SingletonT ()
 Destructor.
 

Detailed Description

Manages topics and their subscriptions.

Member Typedef Documentation

typedef std::map<std::string, std::list<NodePtr> > gazebo::transport::TopicManager::SubNodeMap

Member Function Documentation

void gazebo::transport::TopicManager::AddNode ( NodePtr  _node)
template<typename M >
PublisherPtr gazebo::transport::TopicManager::Advertise ( const std::string &  _topic,
unsigned int  _queueLimit,
bool  _latch 
)
inline
void gazebo::transport::TopicManager::ClearBuffers ( )
void gazebo::transport::TopicManager::ConnectPubToSub ( const std::string &  topic,
const SubscriptionTransportPtr sublink 
)

Connection a local Publisher to a remote Subscriber.

void gazebo::transport::TopicManager::ConnectSubscribers ( const std::string &  topic)

Connect all subscribers on a topic to known publishers.

void gazebo::transport::TopicManager::ConnectSubToPub ( const msgs::Publish &  _pub)

Connect a local Subscriber to a remote Publisher.

void gazebo::transport::TopicManager::DisconnectPubFromSub ( const std::string &  topic,
const std::string &  host,
unsigned int  port 
)

Disconnect a local publisher from a remote subscriber.

void gazebo::transport::TopicManager::DisconnectSubFromPub ( const std::string &  topic,
const std::string &  host,
unsigned int  port 
)

Disconnection all local subscribers from a remote publisher.

PublicationPtr gazebo::transport::TopicManager::FindPublication ( const std::string &  topic)

Referenced by Advertise().

void gazebo::transport::TopicManager::Fini ( )
void gazebo::transport::TopicManager::GetTopicNamespaces ( std::list< std::string > &  _namespaces)

Get all the topic namespaces.

void gazebo::transport::TopicManager::Init ( )
bool gazebo::transport::TopicManager::IsAdvertised ( const std::string &  _topic)

Returns true if the topic has been advertised.

Parameters
_topicThe name of the topic to check
Returns
True if the topic has been advertised
void gazebo::transport::TopicManager::PauseIncoming ( bool  _pause)
void gazebo::transport::TopicManager::ProcessNodes ( bool  _onlyOut = false)
Parameters
_onlyOutTrue means only outbound messages on nodes will be sent. False means nodes process both outbound and inbound messages
void gazebo::transport::TopicManager::Publish ( const std::string &  topic,
const google::protobuf::Message &  message,
const boost::function< void()> &  cb = NULL 
)

Send a message.

Use a Publisher instead of calling this function directly.

Parameters
topicName of the topic
messageThe message to send.
cbCallback, used when the publish is completed.
void gazebo::transport::TopicManager::RegisterTopicNamespace ( const std::string &  _name)

Register a new topic namespace.

void gazebo::transport::TopicManager::RemoveNode ( unsigned int  _id)
SubscriberPtr gazebo::transport::TopicManager::Subscribe ( const SubscribeOptions options)

Subscribe to a topic.

void gazebo::transport::TopicManager::Unadvertise ( const std::string &  topic)

Stop advertising on a topic.

void gazebo::transport::TopicManager::Unsubscribe ( const std::string &  _topic,
const NodePtr _sub 
)

Unsubscribe from a topic.

Use a Subscriber rather than calling this function directly

PublicationPtr gazebo::transport::TopicManager::UpdatePublications ( const std::string &  topic,
const std::string &  msgType 
)

Update our list of advertised topics.

Returns
True if the provided params define a new publisher.

Referenced by Advertise().


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