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:

[legend]
Collaboration diagram for Process:

[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.
## Static Public Member Functions
unsigned long | getFrameNumber ()
| The function returns the current frame number.
## Protected Attributes
ModuleHandler | moduleHandler
| A module handler for managing runtime exchangeable modules.
DebugDataTable | debugDataTable
| A datastructure for generic streaming of data.
unsigned long | frameNumber
| process wide framenumber
MessageQueue & | debugIn
| A queue for incoming debug messages.
MessageQueue & | debugOut
| A queue for outgoing debug messages.
unsigned int | frameCounter
| RunTime.
double | averageRunTime
| RunTime.
unsigned long | maxRunTime
| RunTime.
unsigned long | minRunTime
| RunTime.
## Private Attributes
bool | initialized
| Determines if the process is already initialized.
RobotConfiguration | robotConfiguration
| The configuration of this robot.
Player | player
| The player configuration of this robot.
DebugKeyTable | debugKeyTable
| A table of debug keys for runtime debug requests.
DebugRequestTable | debugRequestTable
| A table wiith the debug requests.
StreamHandler | streamHandler
| A datastructure holding information about the streaming of datatypes.

## 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 38 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 debugDataTable, debugKeyTable, debugOut, debugRequestTable, getRobotConfiguration(), initDebugDataTable(), initDebugging(), initialized, initStreamHandler(), RobotConfiguration::load(), Player::load(), player, processFrameNumberPtr, robotConfiguration, setPlayer(), setRobotConfiguration(), and streamHandler.

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 38 of file Process.cpp. References DebugKeyTable::activate(), OutMessage::bin, MessageQueue::clear(), DEBUG_RESPONSE, debugDataTable, debugIn, debugKeyTable, debugOut, debugRequestTable, OutMessage::finishMessage(), SystemCall::getCurrentSystemTime(), getDebugOut(), SolutionRequest::getModuleCategoryName(), SolutionRequest::getModuleName(), SolutionRequest::getModuleSolutionName(), SolutionRequest::getNumOfSolutions(), getPlayer(), ModuleHandler::getSelectedSolution(), SystemCall::getTimeSince(), MessageQueue::handleAllMessages(), idDebugResponse, idModuleSolutionTable, init(), initDebugDataTable(), initDebugging(), initialized, initStreamHandler(), main(), moduleHandler, MessageQueue::out, OUTPUT, ModuleHandler::pGetModuleSelector(), player, DebugRequestTable::poll, DebugRequestTable::pollCounter, processFrameNumberPtr, robotConfiguration, setPlayer(), MessageQueue::setPlayerForNewMessages(), setRobotConfiguration(), and streamHandler.

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, 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 Motion. Definition at line 77 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, and Motion. Definition at line 120 of file Process.cpp. References DebugRequestTable::addRequest(), InMessage::bin, debugKeyTable, debugRequestTable, InMessage::getMessageID(), ModuleHandler::handleMessage(), idDebugKeyTable, idDebugRequest, idSolutionRequest, idText, moduleHandler, OUTPUT, and ModuleHandler::selectSolutions(). Referenced by Motion::handleMessage(), Debug::handleMessage(), and Cognition::handleMessage().

Here is the call graph for this function:

unsigned long Process::getFrameNumber | ( |  | ) | `[static]`

| The function returns the current frame number. Returns: The frame number. Definition at line 155 of file Process.cpp. References processFrameNumberPtr.

## 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 97 of file Process.h. Referenced by Process(), and processMain().

RobotConfiguration Process::robotConfiguration`[private]`

| The configuration of this robot. Definition at line 102 of file Process.h. Referenced by Process(), and processMain().

Player Process::player`[private]`

| The player configuration of this robot. Definition at line 107 of file Process.h. Referenced by Process(), and processMain().

DebugKeyTable Process::debugKeyTable`[private]`

| A table of debug keys for runtime debug requests. Definition at line 110 of file Process.h. Referenced by handleMessage(), Process(), and processMain().

DebugRequestTable Process::debugRequestTable`[private]`

| A table wiith the debug requests. Definition at line 113 of file Process.h. Referenced by handleMessage(), Process(), and processMain().

StreamHandler Process::streamHandler`[private]`

| A datastructure holding information about the streaming of datatypes. Definition at line 116 of file Process.h. Referenced by Process(), and processMain().

ModuleHandler Process::moduleHandler`[protected]`

| A module handler for managing runtime exchangeable modules. Definition at line 125 of file Process.h. Referenced by handleMessage(), and processMain().

DebugDataTable Process::debugDataTable`[protected]`

| A datastructure for generic streaming of data. Definition at line 128 of file Process.h. Referenced by Motion::handleMessage(), Cognition::handleMessage(), Process(), and processMain().

unsigned long Process::frameNumber`[protected]`

| process wide framenumber Definition at line 131 of file Process.h.

MessageQueue& Process::debugIn`[protected]`

| A queue for incoming debug messages. Definition at line 134 of file Process.h. Referenced by processMain().

MessageQueue& Process::debugOut`[protected]`

| A queue for outgoing debug messages. Definition at line 137 of file Process.h. Referenced by Cognition::Cognition(), Debug::Debug(), Debug::handleMessage(), Cognition::handleMessage(), Motion::Motion(), and processMain().

unsigned int Process::frameCounter`[protected]`

| RunTime. Definition at line 140 of file Process.h.

double Process::averageRunTime`[protected]`

| RunTime. Definition at line 142 of file Process.h.

unsigned long Process::maxRunTime`[protected]`

| RunTime. Definition at line 144 of file Process.h.

unsigned long Process::minRunTime`[protected]`

| RunTime. Definition at line 146 of file Process.h.

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

- Tools/Process.h
- Tools/Process.cpp