ros_integration::RosPublishActivity Class Reference

#include <ros_publish_activity.hpp>

List of all members.

Public Types

typedef boost::shared_ptr
< RosPublishActivity
shared_ptr

Public Member Functions

void addPublisher (RosPublisher *pub)
void removePublisher (RosPublisher *pub)
bool requestPublish (RosPublisher *chan)
 ~RosPublishActivity ()

Static Public Member Functions

static shared_ptr Instance ()

Private Types

typedef std::map< RosPublisher
*, bool > 
Publishers
typedef boost::weak_ptr
< RosPublishActivity
weak_ptr

Private Member Functions

void loop ()
 RosPublishActivity (const std::string &name)

Private Attributes

os::Mutex map_lock
Publishers publishers

Static Private Attributes

static weak_ptr ros_pub_act
 This pointer may not be refcounted since it would prevent cleanup.

Detailed Description

A process wide thread that handles all publishing of ROS topics of the current process. There is no strong reason why only one publisher should exist, in later implementations, one publisher thread per channel may exist as well. See the usage recommendations for Instance()

Definition at line 65 of file ros_publish_activity.hpp.


Member Typedef Documentation

A map keeping track of all publishers in the current process. It must be guarded by the mutex since insertion/removal happens concurrently.

Definition at line 76 of file ros_publish_activity.hpp.

Definition at line 67 of file ros_publish_activity.hpp.

Definition at line 69 of file ros_publish_activity.hpp.


Constructor & Destructor Documentation

ros_integration::RosPublishActivity::RosPublishActivity ( const std::string &  name  )  [inline, private]

Definition at line 80 of file ros_publish_activity.hpp.

ros_integration::RosPublishActivity::~RosPublishActivity (  )  [inline]

Definition at line 139 of file ros_publish_activity.hpp.


Member Function Documentation

void ros_integration::RosPublishActivity::addPublisher ( RosPublisher pub  )  [inline]

Definition at line 113 of file ros_publish_activity.hpp.

static shared_ptr ros_integration::RosPublishActivity::Instance (  )  [inline, static]

Returns the single instance of the RosPublisher. This function is not thread-safe when it creates the RosPublisher object. Therefor, it is advised to cache the object which Intance() returns such that, in the unlikely event that two publishers exist, you consistently keep using the same instance, which is fine then.

Definition at line 103 of file ros_publish_activity.hpp.

void ros_integration::RosPublishActivity::loop (  )  [inline, private]

Definition at line 87 of file ros_publish_activity.hpp.

void ros_integration::RosPublishActivity::removePublisher ( RosPublisher pub  )  [inline]

Definition at line 118 of file ros_publish_activity.hpp.

bool ros_integration::RosPublishActivity::requestPublish ( RosPublisher chan  )  [inline]

Requests to publish the data of a given channel. Note that multiple calls to requestPublish may cause only a single call to RosPublisher::publish().

Definition at line 128 of file ros_publish_activity.hpp.


Member Data Documentation

Definition at line 78 of file ros_publish_activity.hpp.

Definition at line 77 of file ros_publish_activity.hpp.

This pointer may not be refcounted since it would prevent cleanup.

Definition at line 71 of file ros_publish_activity.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Defines


rtt_ros_integration
Author(s): Ruben Smits, ruben.smits@mech.kuleuven.be
autogenerated on Fri Jan 11 09:42:49 2013