ot::ThreadContext Class Reference
[Core Classes]

#include <ThreadContext.h>

Inheritance diagram for ot::ThreadContext:

Inheritance graph
[legend]
Collaboration diagram for ot::ThreadContext:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class represents a threaded verion of the context class.

Author:
Gerhard Reitmayr


Public Member Functions

 ThreadContext (int init=0)
virtual ~ThreadContext ()
virtual void run ()
virtual void runAtRate (double rate)
virtual void runOnDemand ()

Protected Types

enum  ActionType { POLL = 0, RATE = 1, DEMAND = 2, QUIT = 255 }

Protected Member Functions

void thlock ()
void thunlock ()
void runDispatcher ()

Static Protected Member Functions

static void thread_func (void *data)

Protected Attributes

int action_type
double action_rate
bool inloop
void * thread
thread_mutex_type * thread_mutex
mutex_type * action_mutex
condition_type * action_cond
mutex_type * loopend_mutex
condition_type * loopend_cond

Friends

class ConfigurationParser


Member Enumeration Documentation

enum ot::ThreadContext::ActionType [protected]
 

Enumerator:
POLL 
RATE 
DEMAND 
QUIT 


Constructor & Destructor Documentation

ot::ThreadContext::ThreadContext int  init = 0  ) 
 

a constructor method.

Parameters:
init If init is not equal to 0, it instantiates all known modules and factories, adds them to its local containers and also takes care of removing them again in the destructor.

ot::ThreadContext::~ThreadContext  )  [virtual]
 

destructor method clears containers and removes any modules instantiated in the default setup, if cleanUp is st.


Member Function Documentation

void ot::ThreadContext::run  )  [virtual]
 

This method implements the main loop and runs until it is stopped somehow. Then it calls close() on all modules.

Reimplemented from ot::Context.

void ot::ThreadContext::runAtRate double  rate  )  [virtual]
 

This method a main loop at a fixed rate until it is stopped somehow. Then it calls close() on all modules.

Reimplemented from ot::Context.

void ot::ThreadContext::runDispatcher  )  [protected]
 

This method implements the dispatcher, which runs one of the maint loops in the thread.

void ot::ThreadContext::runOnDemand  )  [virtual]
 

This is a data-driven implementation of the main loop

Reimplemented from ot::Context.

void ot::ThreadContext::thlock  )  [protected]
 

enters a critical section. Use this method to protect your operations from another thread. This is not a recursive lock, do not call it several times without unlocking !

static void ot::ThreadContext::thread_func void *  data  )  [inline, static, protected]
 

void ot::ThreadContext::thunlock  )  [protected]
 

leaves a critical section. Use this method to release the protection.


Friends And Related Function Documentation

friend class ConfigurationParser [friend]
 

Reimplemented from ot::Context.


Member Data Documentation

condition_type* ot::ThreadContext::action_cond [protected]
 

mutex_type* ot::ThreadContext::action_mutex [protected]
 

double ot::ThreadContext::action_rate [protected]
 

int ot::ThreadContext::action_type [protected]
 

bool ot::ThreadContext::inloop [protected]
 

condition_type* ot::ThreadContext::loopend_cond [protected]
 

mutex_type* ot::ThreadContext::loopend_mutex [protected]
 

void* ot::ThreadContext::thread [protected]
 

thread_mutex_type* ot::ThreadContext::thread_mutex [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 15:29:14 2007 for NaviTrack by  doxygen 1.4.6