pion::platform::ReactionScheduler Class Reference

#include <ReactionScheduler.hpp>

Inherits pion::PionSingleServiceScheduler.

List of all members.


Detailed Description

ReactionScheduler: scheduler used to route Events for the ReactionEngine

Definition at line 39 of file ReactionScheduler.hpp.

Public Member Functions

 ReactionScheduler (void)
 constructs a new ReactionScheduler
virtual ~ReactionScheduler ()
 virtual destructor
virtual void startup (void)
 Starts the thread scheduler (this is called automatically when necessary).
virtual void stopThreads (void)
 stops all threads used to perform work
virtual void finishThreads (void)
 finishes all threads used to perform work
virtual void post (boost::function0< void > work_func)
std::size_t getQueueSize (void) const
 returns the number of events queued in ReactionScheduler

Protected Types

typedef boost::function0<
void > 
Reaction
 data type for a Reaction (when an Event is delivered to a Reactor)
typedef PionLockedQueue< ReactionReactionQueue
 data type for a thread-safe queue of Reactions
typedef boost::shared_ptr<
ReactionQueue::ConsumerThread > 
ThreadInfoPtr
 typedef for a collection of consumer thread info objects
typedef std::vector< ThreadInfoPtrThreadInfoVector
 typedef for a collection of consumer thread info objects

Protected Member Functions

ThreadInfoPtr getThreadInfo (void)
 creates and returns a new queue info object for Reaction consumer threads
void stopThreadInfo (void)
 sets all thread info objects to stop (forces return for pop())
void processReactionQueue (void)
 processes work in the reaction queue while running

Protected Attributes

ReactionQueue m_reaction_queue
 a queue of Events that are scheduled to be delivered to Reactors
boost::shared_ptr< boost::thread > m_service_thread
 thread that is used to handle io_service requests
ThreadInfoVector m_thread_info
 info objects for consumer threads used to manage signaling
boost::mutex m_thread_info_mutex
 used to provide thread safety for the thread info vector

Classes

class  NoServiceException
 exception thrown if getIOService() is called More...


Member Function Documentation

virtual void pion::platform::ReactionScheduler::post ( boost::function0< void >  work_func  )  [inline, virtual]

schedules work to be performed by one of the pooled threads

Parameters:
work_func work function to be executed

Reimplemented from pion::PionScheduler.

Definition at line 107 of file ReactionScheduler.hpp.

References m_reaction_queue, and pion::PionLockedQueue< T, MaxSize, SleepMilliSec >::push().


The documentation for this class was generated from the following file:
Generated on Wed Apr 13 16:38:36 2011 for pion-platform by  doxygen 1.4.7