Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
RTT::mqueue::Dispatcher Class Reference

#include <Dispatcher.hpp>

Inheritance diagram for RTT::mqueue::Dispatcher:
Inheritance graph
[legend]

Public Types

typedef boost::intrusive_ptr< Dispatchershared_ptr
 
- Public Types inherited from RTT::base::ActivityInterface
typedef boost::shared_ptr< ActivityInterfaceshared_ptr
 

Public Member Functions

void addQueue (mqd_t mqdes, base::ChannelElementBase *chan)
 
bool breakLoop ()
 
bool initialize ()
 
void loop ()
 
void removeQueue (mqd_t mqdes)
 
- Public Member Functions inherited from RTT::Activity
 Activity (base::RunnableInterface *r=0, const std::string &name="Activity")
 Create a not real-time Activity. This creates a not real-time, non-periodic thread, with priority equal to RTT::os::LowestPriority. More...
 
 Activity (int priority, base::RunnableInterface *r=0, const std::string &name="Activity")
 Create a real-time Activity with a given priority. The thread is run in the ORO_SCHED_RT scheduler. More...
 
 Activity (int priority, Seconds period, base::RunnableInterface *r=0, const std::string &name="Activity")
 Create a real-time Activity with a given priority and period. The thread is run in the ORO_SCHED_RT scheduler. More...
 
 Activity (int scheduler, int priority, base::RunnableInterface *r=0, const std::string &name="Activity")
 Create an Activity with a given scheduler type and priority. More...
 
 Activity (int scheduler, int priority, Seconds period, base::RunnableInterface *r=0, const std::string &name="Activity")
 Create an Activity with a given scheduler type, priority and period. More...
 
 Activity (int scheduler, int priority, Seconds period, unsigned cpu_affinity, base::RunnableInterface *r=0, const std::string &name="Activity")
 Create an Activity with a given scheduler type, priority, period and cpu affinity. More...
 
virtual bool execute ()
 
virtual void finalize ()
 
virtual unsigned getCpuAffinity () const
 
virtual Seconds getPeriod () const
 
virtual bool isActive () const
 
virtual bool isPeriodic () const
 
virtual bool isRunning () const
 
virtual bool setCpuAffinity (unsigned cpu)
 
virtual bool setPeriod (Seconds period)
 
void setWaitPeriodPolicy (int p)
 
virtual bool start ()
 
virtual void step ()
 
virtual bool stop ()
 
virtual os::ThreadInterfacethread ()
 
virtual bool timeout ()
 
virtual bool trigger ()
 
virtual void work (base::RunnableInterface::WorkReason reason)
 
virtual ~Activity ()
 
- Public Member Functions inherited from RTT::base::ActivityInterface
 ActivityInterface ()
 
 ActivityInterface (RunnableInterface *run)
 
virtual RunnableInterfacegetRunner () const
 
virtual bool run (RunnableInterface *r)
 
virtual ~ActivityInterface ()
 
- Public Member Functions inherited from RTT::os::Thread
virtual int getMaxOverrun () const
 
virtual const char * getName () const
 
void getPeriod (secs &s, nsecs &ns) const
 
virtual nsecs getPeriodNS () const
 
virtual unsigned int getPid () const
 
virtual int getPriority () const
 
virtual int getScheduler () const
 
Seconds getStopTimeout () const
 
virtual RTOS_TASKgetTask ()
 
virtual const RTOS_TASKgetTask () const
 
virtual void setMaxOverrun (int m)
 
bool setPeriod (Seconds s)
 
bool setPeriod (secs s, nsecs ns)
 
bool setPeriod (TIME_SPEC p)
 
virtual bool setPriority (int priority)
 
virtual bool setScheduler (int sched_type)
 
void setStopTimeout (Seconds s)
 
 Thread (int scheduler, int priority, double period, unsigned cpu_affinity, const std::string &name)
 
virtual void yield ()
 
virtual ~Thread ()
 
- Public Member Functions inherited from RTT::os::ThreadInterface
bool isSelf () const
 
 ThreadInterface ()
 
unsigned int threadNumber () const
 
virtual ~ThreadInterface ()
 

Static Public Member Functions

static Dispatcher::shared_ptr Instance ()
 
- Static Public Member Functions inherited from RTT::os::Thread
static void setLockTimeoutNoPeriod (double timeout_in_s)
 
static void setLockTimeoutPeriodFactor (double factor)
 
static void setStackSize (unsigned int ssize)
 

Private Types

typedef std::map< mqd_t, base::ChannelElementBase * > MQMap
 

Private Member Functions

void build_select_list ()
 
 Dispatcher (const std::string &name)
 
void read_socks ()
 
 ~Dispatcher ()
 

Private Attributes

bool do_exit
 
int highsock
 
os::Mutex maplock
 
MQMap mqmap
 
os::AtomicInt refcount
 
fd_set socks
 

Static Private Attributes

static DispatcherDispatchI = 0
 

Friends

void intrusive_ptr_add_ref (const RTT::mqueue::Dispatcher *p)
 
void intrusive_ptr_release (const RTT::mqueue::Dispatcher *p)
 

Additional Inherited Members

- Protected Member Functions inherited from RTT::base::ActivityInterface
void disableRun (RunnableInterface *caller)
 
- Protected Member Functions inherited from RTT::os::Thread
void emergencyStop ()
 
void terminate ()
 
- Protected Attributes inherited from RTT::Activity
os::Condition msg_cond
 
os::Mutex msg_lock
 
bool mstopRequested
 
bool mtimeout
 
int mwaitpolicy
 
double update_period
 
- Protected Attributes inherited from RTT::base::ActivityInterface
RunnableInterfacerunner
 
- Protected Attributes inherited from RTT::os::Thread
bool active
 
MutexRecursive breaker
 
bool inloop
 
int maxOverRun
 
int msched_type
 
NANO_TIME period
 
bool prepareForExit
 
RTOS_TASK rtos_task
 
bool running
 
rt_sem_t sem
 
double stopTimeout
 
- Protected Attributes inherited from RTT::os::ThreadInterface
int threadnb
 
- Static Protected Attributes inherited from RTT::os::Thread
static unsigned int default_stack_size = 0
 
static double lock_timeout_no_period_in_s = 1.0
 
static double lock_timeout_period_factor = 10.0
 

Detailed Description

This object waits on a set of open message queue file descriptors and signals the channel that has received new data. Reasonably, there should be one dispatcher for each peer component sending us data.

Definition at line 62 of file Dispatcher.hpp.

Member Typedef Documentation

typedef std::map<mqd_t,base::ChannelElementBase*> RTT::mqueue::Dispatcher::MQMap
private

Definition at line 69 of file Dispatcher.hpp.

typedef boost::intrusive_ptr<Dispatcher> RTT::mqueue::Dispatcher::shared_ptr

Definition at line 132 of file Dispatcher.hpp.

Constructor & Destructor Documentation

RTT::mqueue::Dispatcher::Dispatcher ( const std::string &  name)
inlineprivate

Definition at line 80 of file Dispatcher.hpp.

RTT::mqueue::Dispatcher::~Dispatcher ( )
inlineprivate

Definition at line 85 of file Dispatcher.hpp.

Member Function Documentation

void RTT::mqueue::Dispatcher::addQueue ( mqd_t  mqdes,
base::ChannelElementBase chan 
)
inline

Definition at line 142 of file Dispatcher.hpp.

bool RTT::mqueue::Dispatcher::breakLoop ( )
inlinevirtual
See also
base::RunnableInterface::breakLoop()

Reimplemented from RTT::Activity.

Definition at line 211 of file Dispatcher.hpp.

void RTT::mqueue::Dispatcher::build_select_list ( )
inlineprivate

Definition at line 92 of file Dispatcher.hpp.

bool RTT::mqueue::Dispatcher::initialize ( )
inlinevirtual
See also
base::RunnableInterface::initialize()

Reimplemented from RTT::Activity.

Definition at line 166 of file Dispatcher.hpp.

static Dispatcher::shared_ptr RTT::mqueue::Dispatcher::Instance ( )
inlinestatic

Definition at line 134 of file Dispatcher.hpp.

void RTT::mqueue::Dispatcher::loop ( )
inlinevirtual
See also
base::RunnableInterface::loop()

Reimplemented from RTT::Activity.

Definition at line 171 of file Dispatcher.hpp.

void RTT::mqueue::Dispatcher::read_socks ( )
inlineprivate

Definition at line 116 of file Dispatcher.hpp.

void RTT::mqueue::Dispatcher::removeQueue ( mqd_t  mqdes)
inline

Definition at line 156 of file Dispatcher.hpp.

Friends And Related Function Documentation

void intrusive_ptr_add_ref ( const RTT::mqueue::Dispatcher p)
friend

Definition at line 45 of file Dispatcher.cpp.

void intrusive_ptr_release ( const RTT::mqueue::Dispatcher p)
friend

Definition at line 48 of file Dispatcher.cpp.

Member Data Documentation

Dispatcher * RTT::mqueue::Dispatcher::DispatchI = 0
staticprivate

Definition at line 67 of file Dispatcher.hpp.

bool RTT::mqueue::Dispatcher::do_exit
private

Definition at line 76 of file Dispatcher.hpp.

int RTT::mqueue::Dispatcher::highsock
private

Definition at line 74 of file Dispatcher.hpp.

os::Mutex RTT::mqueue::Dispatcher::maplock
private

Definition at line 78 of file Dispatcher.hpp.

MQMap RTT::mqueue::Dispatcher::mqmap
private

Definition at line 70 of file Dispatcher.hpp.

os::AtomicInt RTT::mqueue::Dispatcher::refcount
mutableprivate

Definition at line 66 of file Dispatcher.hpp.

fd_set RTT::mqueue::Dispatcher::socks
private

Definition at line 72 of file Dispatcher.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:45