Public Member Functions
TopicManager Class Reference

Manages topics and their subscriptions. More...

#include <TopicManager.hh>

Inheritance diagram for TopicManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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

Detailed Description

Manages topics and their subscriptions.


Member Function Documentation

PublisherPtr Advertise ( const std::string &  _topic,
unsigned int  _queueLimit,
bool  _latch 
) [inline]

Advertise on a topic.

Parameters:
topicThe name of the topic

References gzthrow, SingletonT< T >::Instance(), and TopicManager::UpdatePublications().

bool 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 Publish ( const std::string &  topic,
const google::protobuf::Message &  message,
const boost::function< void()> &  cb = 0 
)

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 Unsubscribe ( const std::string &  topic,
const CallbackHelperPtr &  _sub 
)

Unsubscribe from a topic.

Use a Subscriber rather than calling this function directly

PublicationPtr 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 TopicManager::Advertise().


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