StuBS
Gate Class Referenceabstract

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

#include <interrupt/gate.h>

Inheritance diagram for Gate:
[legend]
Collaboration diagram for Gate:
[legend]

Public Member Functions

 Gate ()
 Constructor.
 
virtual ~Gate ()
 Destructor.
 
bool is_queued () const
 Status about the epilogue.
 
void set_queued (bool val)
 Set epilogue status.
 
virtual bool prologue ()=0
 Device-specific interrupt handling routine that is executed immediately after the interrupt occurs (asynchronously).
 
virtual void epilogue ()
 Possibly delayed, synchronously executed Device-specific interrupt handling routine.
 

Private Member Functions

 Gate (const Gate &)=delete
 
Gateoperator= (const Gate &)=delete
 

Private Attributes

PerCore< bool > queued
 Is this epiloque already marked for execution Add a member that stores the information whether a Gate has already been queued.
 

Additional Inherited Members

- Protected Member Functions inherited from Queue< T, ContainerType >::Node
 Node ()
 

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::prologue(). 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 Guard::epilogue_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)
Todo:
Implement class inheritance. Each Gate instance should be queueable by inheritting from Queue::Node. Keep in mind that you have to specify both template arguments. The first one is the type to be queued, and the second is the maximum amount of cores.

Constructor & Destructor Documentation

◆ Gate() [1/2]

Gate::Gate ( const Gate )
privatedelete

◆ Gate() [2/2]

Gate::Gate ( )
inline

Constructor.

◆ ~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

◆ operator=()

Gate & Gate::operator= ( const Gate )
privatedelete

◆ is_queued()

bool Gate::is_queued ( ) const
inline

Status about the epilogue.

Returns
true if the epilogue is already queued.
Todo:
Implement method.

◆ set_queued()

void Gate::set_queued ( bool  val)
inline

Set epilogue status.

Parameters
valNew statuus of the epilogue. True if the epilogue is queued.
Todo:
Implement method.

◆ 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.
Todo:
Define pure virtual method

Implemented in Keyboard, Mouse, Panic, and SerialStream.

◆ epilogue()

virtual void Gate::epilogue ( )
inlinevirtual

Possibly delayed, synchronously executed Device-specific interrupt handling routine.

Todo:
Define virtual method

Reimplemented in Keyboard, Mouse, and SerialStream.

Member Data Documentation

◆ queued

PerCore<bool> Gate::queued
private

Is this epiloque already marked for execution Add a member that stores the information whether a Gate has already been queued.

Note
For MPStuBS, an epilogue might be queued on every core. Hence, you need multiple instances of queued. Have a look at PerCore.
Todo:
Add member

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