#include <RulbusDevice.h>
Inherited by PiaVia, RB8509_Adc12, RB8510_Dac12, RB8513_timebase, RB8514_delay, RB8515_clock, RB8905_Adc12, RB9005_amplifier, and RB9603_monochromator.
getByte() and putByte() are made public so that they can be used from a dummy Rulbus device ( see RulbusDevice_getByte() ). Normally these functions would be only used from derived classes and therefore would be made protected.
For getByte() and putByte(), see TheRulbusInterface, section Thread Safety.
Public Member Functions | |
Construction | |
RulbusDevice (Name aName, Addr aAddr, Addr aWidth, Rack aRack) | |
constructor. | |
virtual | ~RulbusDevice () |
destructor. | |
Accessors | |
Name | name () const |
return device's name. | |
Rack | rack () const |
return device's rack. | |
Addr | addr () const |
return device's address. | |
Addr | width () const |
return device's address width. | |
Predicates | |
bool | eqRack (RulbusDeviceCref rhs) const |
true if racks are active at the same time. | |
bool | eqAddr (RulbusDeviceCref rhs) const |
true if cards have overlapping address ranges. | |
Modifiers | |
void | setRack (Rack aRack) |
set device's rack. | |
void | setAddr (Addr aAddr) |
set device's address. | |
Printer | |
virtual int | printOn (std::ostream &stream) const |
report this device's name and Rulbus addres. | |
Rulbus interface access | |
int | getByte (int offset) const |
read a byte from the Rulbus via theRulbus(). | |
int | putByte (int offset, int byte) const |
write a byte to the Rulbus via theRulbus(). | |
Static Public Attributes | |
const int | ANY_RACK = 0xF |
always selected | |
const int | DEF_RACK = ANY_RACK |
default rack address | |
Protected Member Functions | |
Construction and assignment | |
RulbusDevice () | |
prevent default construction | |
RulbusDevice (RulbusDeviceCref) | |
prevent copying | |
RulbusDeviceRef | operator= (RulbusDeviceCref) |
prevent copying | |
Checkers | |
void | checkValidAddress (int offset=0) const |
check for valid Rulbus address and data. | |
void | checkBusViolation (int offset, int byte) const |
check for valid Rulbus address and data. | |
Static Protected Member Functions | |
Delegator | |
TheRulbusInterfaceRef | theRulbus () |
return the Rulbus Interface implementation, using TheRulbusInterface::instance(). | |
Private Attributes | |
Name | theName |
device name | |
Rack | theRack |
device Rulbus rack number [0..15] | |
Addr | theAddr |
device Rulbus address [1..$FE] | |
Addr | theWidth |
device Rulbus address width |
|
checkBusViolation() checks if parameter
method checkBusViolation() is part of RulbusDevice -- and not of RulbusInterface, so that it can use the device's name in the error message. |
|
checkBusViolation() checks if parameter
method checkBusViolation() is part of RulbusDevice -- and not of RulbusInterface, so that it can use the device's name in the error message. |
|
getByte() delegates this request via theRulbus() to the actual RulbusInterface object. If the DFLAG_BUSVIOLATION flag is set in DEBUG, putByte() first checks for a bus address violation via checkBusViolation(). If a busviolation occurs, putBuyte() throws a RulbusAddressError. |
|
putByte() delegates this request via theRulbus() to the actual RulbusInterface object. If the DFLAG_BUSVIOLATION flag is set in DEBUG, putByte() first checks for bus address and data violations via checkBusViolation(). If a busviolation occurs, putBuyte() throws a RulbusAddressError, or a RulbusDataError. |