Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

SctCalibrationController::Sequence Class Reference

This is a record of each Sequence that is done. More...

#include <Sequence.h>


Public Member Functions

virtual ~Sequence ()
 Removes the SequenceData from IS.

void addTest (auto_ptr< Test > test)
 Adds a Test to this Sequence.

const SequenceDatagetData () const
 Access the underlying SequenceData.

void setStatus (SequenceData::status_E status)
 Set the status of this Sequence - see SequenceData.

string getUniqueID () const
 Get a unique ID for this Sequence - used by IS.

shared_ptr< TestSequence::getTest (unsigned int index) const
 Get a Test.


Static Public Member Functions

shared_ptr< Sequence > create (const string &name, unsigned long runNumber, unsigned long startScanNumber)
 Force creation using shared_ptrs and new.


Private Types

typedef vector< shared_ptr<
Test > > 
TestVector
 A vector of Tests!


Private Member Functions

 Sequence (const string &name, unsigned long runNumber, unsigned long startScanNumber)
 Creates a Sequence -.

void publish ()
 Put (create or update) the SequenceData into IS.

void withdraw ()
 Remove the SequenceData from IS Will not throw - just reports the problem.s.


Private Attributes

SequenceData data
 The underlying data.

unsigned int realSize
 For efficiency we allocate a slightly larger array in SequenceData than necessary for the Test names.

TestVector tests
 The constituent Tests.


Detailed Description

This is a record of each Sequence that is done.

It holds an underlying SequenceData that is put into IS and also references to the constituent Tests.

Definition at line 21 of file Sequence.h.


Member Typedef Documentation

typedef vector<shared_ptr<Test> > SctCalibrationController::Sequence::TestVector [private]
 

A vector of Tests!

Definition at line 95 of file Sequence.h.


Constructor & Destructor Documentation

SctCalibrationController::Sequence::~Sequence   [virtual]
 

Removes the SequenceData from IS.

Definition at line 30 of file Sequence.cpp.

References data, getUniqueID(), SequenceData::sequenceName, and withdraw().

SctCalibrationController::Sequence::Sequence const string &    name,
unsigned long    runNumber,
unsigned long    startScanNumber
[private]
 

Creates a Sequence -.

See also:
create

Definition at line 15 of file Sequence.cpp.

References data, getUniqueID(), SequenceData::nTests, publish(), realSize, SequenceData::runNumber, SequenceData::sequenceName, SequenceData::startScanNumber, SequenceData::testNames, and SequenceData::testNames_size.

Referenced by create().


Member Function Documentation

void SctCalibrationController::Sequence::addTest auto_ptr< Test   test
 

Adds a Test to this Sequence.

Note transfer of ownership semantics.

Definition at line 47 of file Sequence.cpp.

References data, SequenceData::nTests, publish(), realSize, SequenceData::testNames, SequenceData::testNames_size, and tests.

shared_ptr< Sequence > SctCalibrationController::Sequence::create const string &    name,
unsigned long    runNumber,
unsigned long    startScanNumber
[static]
 

Force creation using shared_ptrs and new.

This is because each Sequence is automatically added to the SequenceMap. Puts the SequenceData into IS.

Parameters:
name the name of this Sequence
runNumber the run number
startScanNumber the scan number of the first Scan in this Sequence
Note:
Problems can be caused if there is a significant gap between the creation of the Sequence and the execution of the Scans as this would mean things get out of step/wrong!

Definition at line 35 of file Sequence.cpp.

References Sequence().

const SequenceData & SctCalibrationController::Sequence::getData   const
 

Access the underlying SequenceData.

Definition at line 78 of file Sequence.cpp.

References data.

string SctCalibrationController::Sequence::getUniqueID   const
 

Get a unique ID for this Sequence - used by IS.

Definition at line 41 of file Sequence.cpp.

References data, SequenceData::runNumber, and SequenceData::startScanNumber.

Referenced by publish(), Sequence(), setStatus(), withdraw(), and ~Sequence().

void SctCalibrationController::Sequence::publish   [private]
 

Put (create or update) the SequenceData into IS.

Will not throw - just reports the problem.

Definition at line 94 of file Sequence.cpp.

References data, and getUniqueID().

Referenced by addTest(), Sequence(), and setStatus().

shared_ptr<Test> SctCalibrationController::Sequence::Sequence::getTest unsigned int    index const
 

Get a Test.

Exceptions:
InvalidArgumentError if index is too large

void SctCalibrationController::Sequence::setStatus SequenceData::status_E    status
 

Set the status of this Sequence - see SequenceData.

Once a Sequence has entered the ABORTED or COMPLETED states, it cannot be changed.

Exceptions:
InvalidArgumentError if the status is currently ABORTED or COMPLETED and status is not ABORTED or COMPLETED respectively.

Definition at line 82 of file Sequence.cpp.

References SequenceData::ABORTED, SequenceData::COMPLETED, data, getUniqueID(), publish(), and SequenceData::status.

void SctCalibrationController::Sequence::withdraw   [private]
 

Remove the SequenceData from IS Will not throw - just reports the problem.s.

Definition at line 113 of file Sequence.cpp.

References getUniqueID().

Referenced by ~Sequence().


Field Documentation

SequenceData SctCalibrationController::Sequence::data [private]
 

The underlying data.

Definition at line 74 of file Sequence.h.

Referenced by addTest(), getData(), getUniqueID(), publish(), Sequence(), setStatus(), and ~Sequence().

unsigned int SctCalibrationController::Sequence::realSize [private]
 

For efficiency we allocate a slightly larger array in SequenceData than necessary for the Test names.

This is the real size of that array.

Definition at line 81 of file Sequence.h.

Referenced by addTest(), and Sequence().

TestVector SctCalibrationController::Sequence::tests [private]
 

The constituent Tests.

Definition at line 96 of file Sequence.h.

Referenced by addTest().


The documentation for this class was generated from the following files:
Generated on Mon Dec 15 19:37:33 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3