#include <rtt_rostopic_ros_publish_activity.hpp>
Public Types | |
typedef boost::shared_ptr < RosPublishActivity > | shared_ptr |
Public Member Functions | |
void | addPublisher (RosPublisher *pub) |
void | removePublisher (RosPublisher *pub) |
~RosPublishActivity () | |
Static Public Member Functions | |
static shared_ptr | Instance () |
Private Types | |
typedef Publishers::iterator | iterator |
typedef std::set< RosPublisher * > | Publishers |
typedef boost::weak_ptr < RosPublishActivity > | weak_ptr |
Private Member Functions | |
void | loop () |
RosPublishActivity (const std::string &name) | |
Private Attributes | |
Publishers | publishers |
RTT::os::Mutex | publishers_lock |
Static Private Attributes | |
static weak_ptr | ros_pub_act |
This pointer may not be refcounted since it would prevent cleanup. |
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 66 of file rtt_rostopic_ros_publish_activity.hpp.
typedef Publishers::iterator rtt_roscomm::RosPublishActivity::iterator [private] |
Definition at line 79 of file rtt_rostopic_ros_publish_activity.hpp.
typedef std::set< RosPublisher* > rtt_roscomm::RosPublishActivity::Publishers [private] |
A set keeping track of all publishers in the current process. It must be guarded by the mutex since insertion/removal happens concurrently.
Definition at line 78 of file rtt_rostopic_ros_publish_activity.hpp.
typedef boost::shared_ptr<RosPublishActivity> rtt_roscomm::RosPublishActivity::shared_ptr |
Reimplemented from RTT::base::ActivityInterface.
Definition at line 69 of file rtt_rostopic_ros_publish_activity.hpp.
typedef boost::weak_ptr<RosPublishActivity> rtt_roscomm::RosPublishActivity::weak_ptr [private] |
Definition at line 71 of file rtt_rostopic_ros_publish_activity.hpp.
rtt_roscomm::RosPublishActivity::RosPublishActivity | ( | const std::string & | name | ) | [private] |
Definition at line 38 of file rtt_rostopic_ros_publish_activity.cpp.
Definition at line 72 of file rtt_rostopic_ros_publish_activity.cpp.
void rtt_roscomm::RosPublishActivity::addPublisher | ( | RosPublisher * | pub | ) |
Definition at line 62 of file rtt_rostopic_ros_publish_activity.cpp.
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 52 of file rtt_rostopic_ros_publish_activity.cpp.
void rtt_roscomm::RosPublishActivity::loop | ( | ) | [private, virtual] |
Reimplemented from RTT::Activity.
Definition at line 45 of file rtt_rostopic_ros_publish_activity.cpp.
void rtt_roscomm::RosPublishActivity::removePublisher | ( | RosPublisher * | pub | ) |
Definition at line 67 of file rtt_rostopic_ros_publish_activity.cpp.
Definition at line 80 of file rtt_rostopic_ros_publish_activity.hpp.
Definition at line 81 of file rtt_rostopic_ros_publish_activity.hpp.
RosPublishActivity::weak_ptr rtt_roscomm::RosPublishActivity::ros_pub_act [static, private] |
This pointer may not be refcounted since it would prevent cleanup.
Definition at line 73 of file rtt_rostopic_ros_publish_activity.hpp.