Convenience classes to implement and manage different types of data streams in separate threads. More...
#include <ThreadedStream.h>
Classes | |
class | Manager |
Public Types | |
typedef std::shared_ptr< ThreadedStream > | Ptr |
Public Member Functions | |
void | join () |
const std::string & | name () const |
const std::atomic_bool & | requested () const |
void | start () |
void | stop () |
const std::atomic_bool & | succeeded () const |
Protected Member Functions | |
virtual bool | startReceivingAndPublishingAsRos ()=0 |
ThreadedStream (rc::dynamics::RemoteInterface::Ptr rcdIface, const std::string &stream, ros::NodeHandle &nh) | |
virtual void | work () |
Protected Attributes | |
Manager::Ptr | _manager |
ros::NodeHandle | _nh |
rc::dynamics::RemoteInterface::Ptr | _rcdyn |
std::atomic_bool | _requested |
std::atomic_bool | _stop |
std::string | _stream |
std::atomic_bool | _success |
std::thread | _thread |
Convenience classes to implement and manage different types of data streams in separate threads.
Intended use: 1 - create a manager 2 - create different types of threaded streams 3 - add them to the manager 4 - start the threads 5 - let the threaded streams to their work and supervise their state 6 - stop the threads and join them 7 - destroy manager (Re-use after joining some threads is not intended!!!)
Definition at line 59 of file ThreadedStream.h.
typedef std::shared_ptr<ThreadedStream> rc::ThreadedStream::Ptr |
Definition at line 62 of file ThreadedStream.h.
|
protected |
Definition at line 42 of file ThreadedStream.cc.
void rc::ThreadedStream::join | ( | ) |
Definition at line 61 of file ThreadedStream.cc.
|
inline |
Definition at line 97 of file ThreadedStream.h.
|
inline |
Definition at line 101 of file ThreadedStream.h.
void rc::ThreadedStream::start | ( | ) |
Definition at line 48 of file ThreadedStream.cc.
|
protectedpure virtual |
Implemented in rc::DynamicsStream, rc::PoseStream, and rc::Protobuf2RosStream.
void rc::ThreadedStream::stop | ( | ) |
Definition at line 56 of file ThreadedStream.cc.
|
inline |
Definition at line 105 of file ThreadedStream.h.
|
protectedvirtual |
Definition at line 67 of file ThreadedStream.cc.
|
protected |
Definition at line 123 of file ThreadedStream.h.
|
protected |
Definition at line 127 of file ThreadedStream.h.
|
protected |
Definition at line 125 of file ThreadedStream.h.
|
protected |
Definition at line 120 of file ThreadedStream.h.
|
protected |
Definition at line 120 of file ThreadedStream.h.
|
protected |
Definition at line 126 of file ThreadedStream.h.
|
protected |
Definition at line 120 of file ThreadedStream.h.
|
protected |
Definition at line 122 of file ThreadedStream.h.