RulbusDevice Class Reference
[Rulbus Device]

#include <RulbusDevice.h>

Inherited by PiaVia, RB8509_Adc12, RB8510_Dac12, RB8513_timebase, RB8514_delay, RB8515_clock, RB8905_Adc12, RB9005_amplifier, and RB9603_monochromator.

List of all members.


Detailed Description

Class RulbusDevice is the base class for all Rulbus devices. Its functions are to:

A Note on Access Protection

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.

Thread Safety

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


Member Function Documentation

void checkBusViolation int  offset,
int  byte
const [protected]
 

checkBusViolation() checks if parameter offset combined with the device's rack and base address specifies a valid Rulbus address, and it checks if parameter byte specifies a valid Rulbus data value:

  • rack:address -- [0..15:0..0xFF]
  • data -- [0..0xFF]

method checkBusViolation() is part of RulbusDevice -- and not of RulbusInterface, so that it can use the device's name in the error message.

void checkValidAddress int  offset = 0  )  const [protected]
 

checkBusViolation() checks if parameter offset combined with the device's rack and base address specifies a valid Rulbus address, and it checks if parameter byte specifies a valid Rulbus data value:

  • rack:address -- [0..15:0..0xFF]
  • data -- [0..0xFF]

method checkBusViolation() is part of RulbusDevice -- and not of RulbusInterface, so that it can use the device's name in the error message.

int getByte int  offset  )  const
 

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.

int putByte int  offset,
int  byte
const
 

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.


The documentation for this class was generated from the following files:
Generated on Tue Oct 12 14:12:05 2004 for Rulbus Device Class Library for Microsoft Windows by doxygen 1.3.4