StuBS
Gate Class Referenceabstract

Class of objects that are capable of handling interrupts. More...

#include <gate.h>

Inheritance diagram for Gate:
Collaboration diagram for Gate:

Public Member Functions

 Gate ()
 Constructor.
 
virtual ~Gate ()
 Destructor. More...
 
virtual bool prologue ()=0
 Device-specific interrupt handling routine that is executed immediately after the interrupt occurs (asynchronously). More...
 
virtual void epilogue ()
 Possibly delayed, synchronously executed Device-specific interrupt handling routine.
 

Private Attributes

Gatequeue_link [Core::MAX]
 Pointer to next element for Queue. More...
 

Friends

class Queue< Gate >
 

Detailed Description

Class of objects that are capable of handling interrupts.

All objects to be assigned in Plugbox must be derived from this class.

Each inheriting class must now define the virtual method Gate::epilogue(). For the virtual method Gate::epilogue() an empty implementation can be specified in this parent class, so derived device classes do not necessarily have to define an Gate::epilogue() on their own.

Note
To be able to enqueue each class inheriting from Gate into the linked list(s) implemented by Queue this class has to contain a member acting as next pointer (for MPStuBS, each of the Core::MAX CPU cores will need its own pointer)

Constructor & Destructor Documentation

◆ ~Gate()

virtual Gate::~Gate ( )
inlinevirtual

Destructor.

Classes with virtual methods should always have a virtual destructor (which can be empty as well). In StuBS this will calm the compiler, on other systems this will guarantee that delete will free the memory for objects of the derived classes correctly.

Member Function Documentation

◆ prologue()

virtual bool Gate::prologue ( )
pure virtual

Device-specific interrupt handling routine that is executed immediately after the interrupt occurs (asynchronously).

Returns
true if the epilogue has to be executed.

Implemented in Assassin, WakeUp, Keyboard, Panic, and Watch.

Member Data Documentation

◆ queue_link

Gate* Gate::queue_link[Core::MAX]
private

Pointer to next element for Queue.

This has to be a single pointer (not an array) for OOStuBS.

Note
Not perfect since it is not cache aligned, will lead to false sharing.

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