Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

SEDAStage< In, void > Class Template Reference

Inherits seda_stage_base.

List of all members.


Detailed Description

template<class In>
class SEDAStage< In, void >

A stage in a SEDA (staged, event-driven application) decomposition.

A SEDAStage must always take, as input, an object of the type specified as the first template argument. (Generally a server will define a "work unit" type that includes a reference to the client Socket.) If always generates a particular kind of output element, consider using the SEDAStage<In, Out> construction that lets the user of your component specify a particular "next" stage.


Public Methods

 SEDAStage (string name=string())
 Constructor.

virtual ~SEDAStage ()
 Destructor.

void scan ()
 Periodic scan to see whether to kill a Thread.

void set_nthreads (unsigned int min, unsigned int max)
 Sets the minimum and maximum number of threads (inclusive) which may be assigned to this stage.

void inject (In &in)
 Injects an element into the queue.

virtual void handle (In &in)=0
 Called on some handler Thread for each input element.

virtual void clogged (In &in)
 Called when someone tries to inject an element into the queue, but there are no handlers available to service it.


Protected Methods

void add_threads ()

Friends

class my_thread


Constructor & Destructor Documentation

template<class In>
virtual SEDAStage< In, void >::~SEDAStage   [virtual]
 

Destructor.

Joins all active handler threads, so this will not complete until all handlers exit (this is necessary because the handler threads may invoke methods on this class).


Member Function Documentation

template<class In>
void SEDAStage< In, void >::add_threads   [protected]
 

template<class In>
virtual void SEDAStage< In, void >::clogged In &    in [virtual]
 

Called when someone tries to inject an element into the queue, but there are no handlers available to service it.

This is invoked on the same Thread which calls inject (before inject returns) so it must return very quickly.

template<class In>
virtual void SEDAStage< In, void >::handle In &    in [pure virtual]
 

Called on some handler Thread for each input element.

template<class In>
void SEDAStage< In, void >::inject In &    in
 

Injects an element into the queue.

template<class In>
void SEDAStage< In, void >::scan   [virtual]
 

Periodic scan to see whether to kill a Thread.

Implements seda_stage_base.

template<class In>
SEDAStage< In, void >::SEDAStage string    name = string()
 

Constructor.

template<class In>
void SEDAStage< In, void >::set_nthreads unsigned int    min,
unsigned int    max
[virtual]
 

Sets the minimum and maximum number of threads (inclusive) which may be assigned to this stage.

Implements seda_stage_base.


Friends And Related Function Documentation

template<class In>
friend class my_thread [friend]
 


The documentation for this class was generated from the following file:
Generated on Fri Dec 20 13:35:11 2002 for NMSTL