SctData::ModuleElement Class Reference

Represents an contiguous element of a module : may be a chip, link or channel. More...

#include <ModuleElement.h>


Public Member Functions

 ModuleElement (const unsigned first, const unsigned last)
 Constructor takes the first and last channel of the element.
 ~ModuleElement () throw ()
 Destructor.
unsigned getFirst () const throw ()
 First channel contained (0->1535).
unsigned getLast () const throw ()
 Last channel contained (0->1535).
unsigned getNChannels () const throw ()
bool isChannel () const throw ()
bool isChip () const throw ()
bool isLink () const throw ()
bool isModule () const throw ()
bool operator== (const ModuleElement &) const throw ()
 explicit equality operator
bool isWithin (const ModuleElement &) const throw ()
bool contains (const ModuleElement &) const throw ()
bool overlaps (const ModuleElement &) const throw ()
bool adjacentTo (const ModuleElement &) const throw ()

Static Public Member Functions

static ModuleElement Module () throw ()
 Returns a ModuleElement representing a whole Module.
static ModuleElement Link (unsigned int link)
 Returns a ModuleElement representing Link link.
static ModuleElement Chip (unsigned int chip)
 Returns a ModuleElement representing Chip chip.
static ModuleElement Channel (unsigned int channel)
 Returns a ModuleElement representing Channel channel.

Private Member Functions

 ModuleElement () throw ()
 can't do this

Private Attributes

unsigned first
unsigned last


Detailed Description

Represents an contiguous element of a module : may be a chip, link or channel.

Author:
Alan Barr
Date:
3 July 2003

Definition at line 15 of file ModuleElement.h.


Constructor & Destructor Documentation

SctData::ModuleElement::ModuleElement const unsigned  first,
const unsigned  last
[inline]
 

Constructor takes the first and last channel of the element.

0,127 for chip 0 link 0, or perhaps 768, 895 for chip 0 link 1.

Parameters:
first channel contained
last channel contained
Exceptions:
OutOfRangeError if last<first or last>1535.

Definition at line 85 of file ModuleElement.h.

References Sct::nChannelModule.

SctData::ModuleElement::~ModuleElement  )  throw () [inline]
 

Destructor.

Definition at line 50 of file ModuleElement.h.

SctData::ModuleElement::ModuleElement  )  throw () [private]
 

can't do this

Referenced by Module().


Member Function Documentation

bool SctData::ModuleElement::adjacentTo const ModuleElement  )  const throw () [inline]
 

Returns:
true if this element is logically next to RHS element
Note:
includes `adjacent' across chip and even link boundries.

overlapping elements are not adjacent.

Definition at line 130 of file ModuleElement.h.

static ModuleElement SctData::ModuleElement::Channel unsigned int  channel  )  [static]
 

Returns a ModuleElement representing Channel channel.

Exceptions:
OutOfRangeError if channel>nChannelModule

Referenced by SctData::ISTestSummary::ISNPtGainSummaryWriter::write().

static ModuleElement SctData::ModuleElement::Chip unsigned int  chip  )  [static]
 

Returns a ModuleElement representing Chip chip.

Exceptions:
OutOfRangeError if chip>=nChipModule

Referenced by SctDataDisplay::NPtGainDisplayer::plotData().

bool SctData::ModuleElement::contains const ModuleElement  )  const throw () [inline]
 

Returns:
true if this element contains or is equal to the RHS element

Definition at line 121 of file ModuleElement.h.

unsigned SctData::ModuleElement::getFirst  )  const throw () [inline]
 

First channel contained (0->1535).

Definition at line 52 of file ModuleElement.h.

Referenced by getNChannels(), isChip(), isLink(), and isModule().

unsigned SctData::ModuleElement::getLast  )  const throw () [inline]
 

Last channel contained (0->1535).

Definition at line 54 of file ModuleElement.h.

Referenced by getNChannels().

unsigned int SctData::ModuleElement::getNChannels  )  const throw () [inline]
 

Returns:
the number of channels (=last-first+1)

Definition at line 98 of file ModuleElement.h.

References getFirst(), and getLast().

Referenced by isChannel(), isChip(), isLink(), isModule(), and SctDataDisplay::NPtGainDisplayer::plotData().

Here is the call graph for this function:

bool SctData::ModuleElement::isChannel  )  const throw () [inline]
 

Returns:
true if only contains one element

Definition at line 101 of file ModuleElement.h.

References getNChannels().

Here is the call graph for this function:

bool SctData::ModuleElement::isChip  )  const throw () [inline]
 

Returns:
true if the channels contained precisely match one chip

Definition at line 104 of file ModuleElement.h.

References getFirst(), getNChannels(), and Sct::nChannelChip.

Here is the call graph for this function:

bool SctData::ModuleElement::isLink  )  const throw () [inline]
 

Returns:
true if the channels contained precisely match one link

Definition at line 107 of file ModuleElement.h.

References getFirst(), getNChannels(), and Sct::nChannelLink.

Here is the call graph for this function:

bool SctData::ModuleElement::isModule  )  const throw () [inline]
 

Returns:
true if all of the channels are contained

Definition at line 110 of file ModuleElement.h.

References getFirst(), getNChannels(), and Sct::nChannelModule.

Here is the call graph for this function:

bool SctData::ModuleElement::isWithin const ModuleElement  )  const throw () [inline]
 

Returns:
true if this element is contained within or equal to the argument

Definition at line 118 of file ModuleElement.h.

static ModuleElement SctData::ModuleElement::Link unsigned int  link  )  [static]
 

Returns a ModuleElement representing Link link.

Exceptions:
OutOfRangeError if link>=nLinkModule

ModuleElement SctData::ModuleElement::Module  )  throw () [inline, static]
 

Returns a ModuleElement representing a whole Module.

Definition at line 147 of file ModuleElement.h.

References ModuleElement(), and Sct::nChannelModule.

Here is the call graph for this function:

bool SctData::ModuleElement::operator== const ModuleElement  )  const throw () [inline]
 

explicit equality operator

Returns:
true if first and last are equal

Definition at line 114 of file ModuleElement.h.

bool SctData::ModuleElement::overlaps const ModuleElement  )  const throw () [inline]
 

Returns:
true if this element overlaps any part of RHS element

Definition at line 125 of file ModuleElement.h.


The documentation for this class was generated from the following file:
Generated on Mon Feb 6 14:07:23 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6