#include <RulbusInterface.h>
Inherits Singleton< TheRulbusInterface >.
Inherited by EppRulbusInterface, and IsaRulbusInterface.
TheRulbusInterface implements the client interface and publishes the provider interface (pure abstract function declarations).
The client interface implemented by functions getByte() and putByte() builds on getReg() and putReg(), for which implementations are given by classes that implement the provider interface.
getByte() and putByte() do complete Rulbus addressing as one atomic operation: select the device's rack and read a byte from or write a byte to the Rulbus. The operation must be atomic (may not be done partially) to prevent different threads of execution to hinder each other's access to the Rulbus.
Public Member Functions | |
Client interface | |
int | getByte (int rack, int offset) const |
read a byte from Rulbus address [rack,offset] (concrete). | |
int | putByte (int rack, int offset, int byte) const |
write a byte to Rulbus address [rack,offset] (concrete). | |
Accessor | |
virtual bool | invariant () const |
check class invariant. | |
Printer | |
virtual bool | printOn (std::ostream &stream) const =0 |
print a string describing the Rulbus Interface (abstract). | |
Static Public Member Functions | |
Construction | |
TheRulbusInterfaceRef | instance () |
return the instance, creating it if needed. | |
Static Public Attributes | |
const int | ANY_RACK = 0xF |
always selected | |
Protected Member Functions | |
Construction | |
TheRulbusInterface () | |
default constructor. | |
~TheRulbusInterface () | |
destructor. | |
Provider interface | |
virtual int | getReg (int offset) const =0 |
read a byte from the Rulbus (abstract). | |
virtual int | putReg (int offset, int byte) const =0 |
write a byte to the Rulbus (abstract). | |
Private Attributes | |
WindowsUtils::SemaphorePtr | s |
guard Rulbus access | |
Friends | |
class | Singleton< TheRulbusInterface > |