Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Process Class Reference

System independent base class for Processes. More...

#include <Process.h>

Inheritance diagram for Process:

Inheritance graph
[legend]
Collaboration diagram for Process:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Process (MessageQueue &debugIn, MessageQueue &debugOut)
 Constructor.

int processMain ()
 The main function is called from the process framework once in each frame.

virtual int main ()=0
 The main funtion is called once in each frame.

virtual void init ()
 That function is called once before the first main().

virtual bool handleMessage (InMessage &message)
 Is called for every incoming debug message.


Protected Attributes

ModuleHandler moduleHandler
 A module handler for managing runtime exchangeable modules.

DebugKeyTable debugKeyTable
 A table of debug keys for runtime debug requests.

MessageQueuedebugIn
 A queue for incoming debug messages.

MessageQueuedebugOut
 A queue for outgoing debug messages.


Private Attributes

bool initialized
 Determines if the process is already initialized.


Detailed Description

System independent base class for Processes.

Process is the common base for processes in the GT2002 Project. The embedding into the system environment is done by system dependent frameworks that use derivates of the Process class.

Definition at line 24 of file Process.h.


Constructor & Destructor Documentation

Process::Process MessageQueue debugIn,
MessageQueue debugOut
 

Constructor.

Parameters:
debugIn A reference to an incoming debug queue
debugOut A reference to an outgoing debug queue

Definition at line 13 of file Process.cpp.

References debugKeyTable, debugOut, getPlayer(), getRobotConfiguration(), initDebugging(), initialized, RobotConfiguration::load(), and Player::load().

Here is the call graph for this function:


Member Function Documentation

int Process::processMain  ) 
 

The main function is called from the process framework once in each frame.

It does the debug handling and calls the main function in the derivates.

Returns:
If 0 is returned, the function main will not be called on a timed basis again. A positive number specifies the minimum number of microseconds to wait before the next frame starts. A negative number specifies a cycle time, i.e. the time between two activations of the main() function.

Definition at line 26 of file Process.cpp.

References DebugKeyTable::activate(), MessageQueue::clear(), debugIn, debugKeyTable, debugOut, getPlayer(), MessageQueue::handleAllMessages(), init(), initialized, main(), and MessageQueue::setPlayerForNewMessages().

Here is the call graph for this function:

virtual int Process::main  )  [pure virtual]
 

The main funtion is called once in each frame.

It must be implemented.

Returns:
If 0 is returned, the function main will not be called on a timed basis again. A positive number specifies the minimum number of microseconds to wait before the next frame starts. A negative number specifies a cycle time, i.e. the time between two activations of the main() function.

Implemented in Cognition, Debug, Logger, and Motion.

Referenced by processMain().

virtual void Process::init  )  [inline, virtual]
 

That function is called once before the first main().

It can be used for things that can't be done in the constructor.

Reimplemented in Cognition, Debug, and Logger.

Definition at line 59 of file Process.h.

Referenced by processMain().

bool Process::handleMessage InMessage message  )  [virtual]
 

Is called for every incoming debug message.

Parameters:
message An interface to read the message from the queue
Returns:
true if message was handled

Implements MessageHandler.

Reimplemented in Cognition, Debug, Logger, and Motion.

Definition at line 46 of file Process.cpp.

References InMessage::bin, debugKeyTable, InMessage::getMessageID(), ModuleHandler::handleMessage(), idDebugKeyTable, idSolutionRequest, idText, moduleHandler, OUTPUT, and ModuleHandler::selectSolutions().

Referenced by Motion::handleMessage(), Logger::handleMessage(), Debug::handleMessage(), and Cognition::handleMessage().

Here is the call graph for this function:


Member Data Documentation

bool Process::initialized [private]
 

Determines if the process is already initialized.

Becomes true short before the first call of main()

Definition at line 73 of file Process.h.

Referenced by Process(), and processMain().

ModuleHandler Process::moduleHandler [protected]
 

A module handler for managing runtime exchangeable modules.

Definition at line 78 of file Process.h.

Referenced by handleMessage().

DebugKeyTable Process::debugKeyTable [protected]
 

A table of debug keys for runtime debug requests.

Definition at line 81 of file Process.h.

Referenced by handleMessage(), Process(), and processMain().

MessageQueue& Process::debugIn [protected]
 

A queue for incoming debug messages.

Definition at line 84 of file Process.h.

Referenced by processMain().

MessageQueue& Process::debugOut [protected]
 

A queue for outgoing debug messages.

Definition at line 87 of file Process.h.

Referenced by Cognition::Cognition(), Debug::Debug(), Cognition::handleMessage(), Logger::Logger(), Logger::main(), Debug::main(), Motion::Motion(), and processMain().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:10:53 2004 for GT2004 by doxygen 1.3.6