Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rc::ThreadedStream Class Referenceabstract

Convenience classes to implement and manage different types of data streams in separate threads. More...

#include <ThreadedStream.h>

Inheritance diagram for rc::ThreadedStream:
Inheritance graph
[legend]

Classes

class  Manager
 

Public Types

typedef std::shared_ptr< ThreadedStreamPtr
 

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
 

Detailed Description

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.

Member Typedef Documentation

typedef std::shared_ptr<ThreadedStream> rc::ThreadedStream::Ptr

Definition at line 62 of file ThreadedStream.h.

Constructor & Destructor Documentation

rc::ThreadedStream::ThreadedStream ( rc::dynamics::RemoteInterface::Ptr  rcdIface,
const std::string &  stream,
ros::NodeHandle nh 
)
protected

Definition at line 42 of file ThreadedStream.cc.

Member Function Documentation

void rc::ThreadedStream::join ( )

Definition at line 61 of file ThreadedStream.cc.

const std::string& rc::ThreadedStream::name ( ) const
inline

Definition at line 97 of file ThreadedStream.h.

const std::atomic_bool& rc::ThreadedStream::requested ( ) const
inline

Definition at line 101 of file ThreadedStream.h.

void rc::ThreadedStream::start ( )

Definition at line 48 of file ThreadedStream.cc.

virtual bool rc::ThreadedStream::startReceivingAndPublishingAsRos ( )
protectedpure virtual
Returns
true, if stopped without fails

Implemented in rc::Protobuf2RosStream.

void rc::ThreadedStream::stop ( )

Definition at line 56 of file ThreadedStream.cc.

const std::atomic_bool& rc::ThreadedStream::succeeded ( ) const
inline

Definition at line 105 of file ThreadedStream.h.

void rc::ThreadedStream::work ( )
protectedvirtual

Definition at line 67 of file ThreadedStream.cc.

Member Data Documentation

Manager::Ptr rc::ThreadedStream::_manager
protected

Definition at line 123 of file ThreadedStream.h.

ros::NodeHandle rc::ThreadedStream::_nh
protected

Definition at line 127 of file ThreadedStream.h.

rc::dynamics::RemoteInterface::Ptr rc::ThreadedStream::_rcdyn
protected

Definition at line 125 of file ThreadedStream.h.

std::atomic_bool rc::ThreadedStream::_requested
protected

Definition at line 120 of file ThreadedStream.h.

std::atomic_bool rc::ThreadedStream::_stop
protected

Definition at line 120 of file ThreadedStream.h.

std::string rc::ThreadedStream::_stream
protected

Definition at line 126 of file ThreadedStream.h.

std::atomic_bool rc::ThreadedStream::_success
protected

Definition at line 120 of file ThreadedStream.h.

std::thread rc::ThreadedStream::_thread
protected

Definition at line 122 of file ThreadedStream.h.


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


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Sat Feb 13 2021 03:42:55