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

# ProcessBase Class Reference

The class is a helper that allows to instantiate a class as an Aperios process. More...

`#include <ProcessFramework.h>`

Inheritance diagram for ProcessBase:

[legend]
Collaboration diagram for ProcessBase:

[legend]
List of all members.

## Public Member Functions
void | getAntInformation (int *&listenContSelector, int *&sendContSelector, int *&receiveContSelector, int *&closeContSelector, int *&connectContSelector)
OID * | getOID ()
| ProcessBase ()
| Constructor.
void | stop ()
| The function marks the process as stopped.
bool | isRunning ()
| The function returns whether the process is still running.
## Static Public Member Functions
void | setBlockingId (int id, bool block=true)
| The functions sets or resets a bit in the blocking mask.
void | setEventId (int id)
| The function is called when an event was received.
int | getEventMask ()
| Returns the event mask.
void | resetEventMask ()
| Resets the event mask.
## Static Public Attributes
ProcessBase * | theInstance = 0
| A pointer to the only instance of this class.
## Protected Member Functions
void | init ()
| The function initializes the object and should immediately be called after the construction of an object.
virtual void | processNextFrame ()=0
| The function is called once for each frame.
virtual PlatformProcess * | getProcess ()=0
| The function returns the address of the associated process.
## Static Private Member Functions
void | aperiosInit (OReasonMessage *reasonMsg)
| A global Aperios event handler that calls OObject::Init().
void | aperiosStart (OReasonMessage *reasonMsg)
| A global Aperios event handler that calls OObject::Start().
void | aperiosStop (OReasonMessage *reasonMsg)
| A global Aperios event handler that calls OObject::Stop().
void | aperiosDestroy (OReasonMessage *reasonMsg)
| A global Aperios event handler that calls OObject::Destroy().
void | awakeOnTimer (OReasonMessage *reasonMsg)
| A global event handler for timer events.
void | antConnectCont (antEnvMsg *msg)
| Global event handlers for IP-networking.
void | antReceiveCont (antEnvMsg *msg)
void | antSendCont (antEnvMsg *msg)
void | antListenCont (antEnvMsg *msg)
void | antCloseCont (antEnvMsg *msg)
void | nextFrame ()
| The function calls the member ProcessNextFrame() of the only instance of this class.
## Private Attributes
bool | running
| The flag states whether the process is still running.
int | antConnectContSelector
int | antReceiveContSelector
int | antSendContSelector
int | antListenContSelector
int | antCloseContSelector
## Static Private Attributes
int | blockMask
| A mask with bits set for all blocking senders and receivers.
int | eventMask
| A mask with bits set for all senders and receivers that received an event.

## Detailed Description

The class is a helper that allows to instantiate a class as an Aperios process.

ProcessBase contains the parts that need not to be implemented as a template. It will only be used by the macro MAKE_PROCESS and should never be used directly.

Definition at line 74 of file ProcessFramework.h.

## Constructor & Destructor Documentation

ProcessBase::ProcessBase | ( |  | ) | `[inline]`

| Constructor. Definition at line 170 of file ProcessFramework.h. References running, and theInstance.

## Member Function Documentation

void ProcessBase::getAntInformation | ( | int *& | listenContSelector,
|  | int *& | sendContSelector,
|  | int *& | receiveContSelector,
|  | int *& | closeContSelector,
|  | int *& | connectContSelector
| ) |

| Definition at line 131 of file ProcessFramework.cpp. References antCloseContSelector, antConnectContSelector, antListenContSelector, antReceiveContSelector, and antSendContSelector.

OID* ProcessBase::getOID | ( |  | ) | `[inline]`

| Definition at line 81 of file ProcessFramework.h. Referenced by IPEndpoint::IPEndpoint().

void ProcessBase::aperiosInit | ( | OReasonMessage * | reasonMsg | ) | `[static, private]`

  | A global Aperios event handler that calls OObject::Init(). Parameters:
  reasonMsg | A message provided by Aperios.
Definition at line 57 of file ProcessFramework.cpp. References theInstance. Referenced by init().

void ProcessBase::aperiosStart | ( | OReasonMessage * | reasonMsg | ) | `[static, private]`

  | A global Aperios event handler that calls OObject::Start(). Parameters:
  reasonMsg | A message provided by Aperios.
Definition at line 63 of file ProcessFramework.cpp. References theInstance. Referenced by init().

void ProcessBase::aperiosStop | ( | OReasonMessage * | reasonMsg | ) | `[static, private]`

  | A global Aperios event handler that calls OObject::Stop(). Parameters:
  reasonMsg | A message provided by Aperios.
Definition at line 69 of file ProcessFramework.cpp. References theInstance. Referenced by init().

void ProcessBase::aperiosDestroy | ( | OReasonMessage * | reasonMsg | ) | `[static, private]`

  | A global Aperios event handler that calls OObject::Destroy(). Parameters:
  reasonMsg | A message provided by Aperios.
Definition at line 75 of file ProcessFramework.cpp. References theInstance. Referenced by init().

void ProcessBase::awakeOnTimer | ( | OReasonMessage * | reasonMsg | ) | `[static, private]`

  | A global event handler for timer events. It is automatically called after a certain time if Process::main() returned a nonzero value. It will note that the timer event occurred, and will start a new frame if there are no other pending event, i.e. waiting receivers. Parameters:
  reasonMsg | A message provided by Aperios.
Definition at line 81 of file ProcessFramework.cpp. References setEventId(). Referenced by init().

Here is the call graph for this function:

void ProcessBase::antConnectCont | ( | antEnvMsg * | msg | ) | `[static, private]`

| Global event handlers for IP-networking. Definition at line 99 of file ProcessFramework.cpp. Referenced by init().

void ProcessBase::antReceiveCont | ( | antEnvMsg * | msg | ) | `[static, private]`

| Definition at line 107 of file ProcessFramework.cpp. Referenced by init().

void ProcessBase::antSendCont | ( | antEnvMsg * | msg | ) | `[static, private]`

| Definition at line 115 of file ProcessFramework.cpp. Referenced by init().

void ProcessBase::antListenCont | ( | antEnvMsg * | msg | ) | `[static, private]`

| Definition at line 88 of file ProcessFramework.cpp. Referenced by init().

void ProcessBase::antCloseCont | ( | antEnvMsg * | msg | ) | `[static, private]`

| Definition at line 123 of file ProcessFramework.cpp. Referenced by init().

void ProcessBase::nextFrame | ( |  | ) | `[static, private]`

| The function calls the member ProcessNextFrame() of the only instance of this class. Definition at line 199 of file ProcessFramework.cpp. References isRunning(), processNextFrame(), and theInstance. Referenced by setEventId().

Here is the call graph for this function:

void ProcessBase::init | ( |  | ) | `[protected]`

| The function initializes the object and should immediately be called after the construction of an object. Definition at line 142 of file ProcessFramework.cpp. References antCloseCont(), antCloseContSelector, antConnectCont(), antConnectContSelector, antListenCont(), antListenContSelector, antReceiveCont(), antReceiveContSelector, antSendCont(), antSendContSelector, aperiosDestroy(), aperiosInit(), aperiosStart(), aperiosStop(), ASSERT, awakeOnTimer(), SenderList::fillEntryTable(), ReceiverList::fillEntryTable(), PlatformProcess::getFirstReceiver(), PlatformProcess::getFirstSender(), SenderList::getNext(), ReceiverList::getNext(), getProcess(), and ObjectEntryTable. Referenced by ProcessCreator< T >::ProcessCreator().

Here is the call graph for this function:

virtual void ProcessBase::processNextFrame | ( |  | ) | `[protected, pure virtual]`

| The function is called once for each frame. Implemented in ProcessCreator< T >. Referenced by nextFrame().

virtual PlatformProcess* ProcessBase::getProcess | ( |  | ) | `[protected, pure virtual]`

| The function returns the address of the associated process. Returns: The address of the object. Implemented in ProcessCreator< T >. Referenced by init().

void ProcessBase::stop | ( |  | ) | `[inline]`

| The function marks the process as stopped. Definition at line 178 of file ProcessFramework.h. References running. Referenced by ProcessCreator< T >::DoStop().

bool ProcessBase::isRunning | ( |  | ) | `[inline]`

| The function returns whether the process is still running. Returns: Shall the process continue? Definition at line 184 of file ProcessFramework.h. References running. Referenced by nextFrame().

void ProcessBase::setBlockingId | ( | int | id,
|  | bool | block = true
| ) | `[static]`

  | The functions sets or resets a bit in the blocking mask. After a bit is set in the blocking mask for a certain sender or receiver, a new frame will not be started before this sender or receiver received an event. Parameters:
  id | The id of the sender or receiver.
  block | Should it block or not?
Definition at line 205 of file ProcessFramework.cpp. References blockMask. Referenced by ProcessCreator< T >::DoInit(), ReceiverList::finishFrame(), ProcessCreator< T >::processNextFrame(), SenderList::setBlockingId(), and ReceiverList::setBlockingId().

void ProcessBase::setEventId | ( | int | id | ) | `[static]`

  | The function is called when an event was received. If this was the last event the process was waiting for, the next frame is started, i.e. NextFrame() is called. Parameters:
  id | The id of the sender or receiver that received an event.
Definition at line 213 of file ProcessFramework.cpp. References blockMask, eventMask, and nextFrame(). Referenced by awakeOnTimer(), ProcessCreator< T >::DoStart(), SenderList::setEventId(), and ReceiverList::setEventId().

Here is the call graph for this function:

int ProcessBase::getEventMask | ( |  | ) | `[inline, static]`

| Returns the event mask. Returns: The event mask. Definition at line 208 of file ProcessFramework.h. References eventMask. Referenced by ReceiverList::receivedNew().

void ProcessBase::resetEventMask | ( |  | ) | `[inline, static]`

| Resets the event mask. Definition at line 213 of file ProcessFramework.h. References eventMask. Referenced by ProcessCreator< T >::processNextFrame().

## Member Data Documentation

ProcessBase * ProcessBase::theInstance = 0`[static]`

| A pointer to the only instance of this class. Definition at line 53 of file ProcessFramework.cpp. Referenced by aperiosDestroy(), aperiosInit(), aperiosStart(), aperiosStop(), nextFrame(), and ProcessBase().

int ProcessBase::blockMask`[static, private]`

| Initial value:
     0
        ProcessBase::eventMask = 0
A mask with bits set for all blocking senders and receivers. Definition at line 51 of file ProcessFramework.cpp. Referenced by setBlockingId(), and setEventId().

int ProcessBase::eventMask`[static, private]`

| A mask with bits set for all senders and receivers that received an event. Definition at line 86 of file ProcessFramework.h. Referenced by getEventMask(), resetEventMask(), and setEventId().

bool ProcessBase::running`[private]`

| The flag states whether the process is still running. Definition at line 88 of file ProcessFramework.h. Referenced by isRunning(), ProcessBase(), and stop().

int ProcessBase::antConnectContSelector`[private]`

| Definition at line 129 of file ProcessFramework.h. Referenced by getAntInformation(), and init().

int ProcessBase::antReceiveContSelector`[private]`

| Definition at line 132 of file ProcessFramework.h. Referenced by getAntInformation(), and init().

int ProcessBase::antSendContSelector`[private]`

| Definition at line 135 of file ProcessFramework.h. Referenced by getAntInformation(), and init().

int ProcessBase::antListenContSelector`[private]`

| Definition at line 138 of file ProcessFramework.h. Referenced by getAntInformation(), and init().

int ProcessBase::antCloseContSelector`[private]`

| Definition at line 141 of file ProcessFramework.h. Referenced by getAntInformation(), and init().

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

- Platform/Aperios1.3.2/ProcessFramework.h
- Platform/Aperios1.3.2/ProcessFramework.cpp