/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
DetailsFromRecordSvc Class Reference

This interface provide access to non-event details of the DAQ. More...

#include <DetailsFromRecordSvc.h>

Inheritance diagram for DetailsFromRecordSvc:
Inheritance graph
[legend]
Collaboration diagram for DetailsFromRecordSvc:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DetailsFromRecordSvc (const std::string &name, ISvcLocator *svc)
 Creates an instance of this class.
virtual ~DetailsFromRecordSvc ()
 Creates an instance of this class.
virtual StatusCode initialize ()
 Initialize this instance.
virtual StatusCode finalize ()
 Finalize this instance.
virtual StatusCode queryInterface (const InterfaceID &id, void **interface)
 Test if the supplied interface is supported.
virtual bool hasRunDetails (const ServiceMode &svcMode) const
 Returns true when there is a DaqRunDetails available for the specified svcMode.
virtual const DaqRunDetailsrunDetails (const ServiceMode &svcMode) const
 Returns the current RunDetailsFromRecord instance.
virtual bool hasFileDetails (const ServiceMode &svcMode) const
 Returns true when there is a DaqFileDetails available for the specified svcMode.
virtual const DaqFileDetailsfileDetails (const ServiceMode &svcMode) const
 Returns the current FileDetailsFromRecord instance.
virtual int calibDetailsCount (const ServiceMode &svcMode) const
 Returns the number of DaqCalibDetails available for the specified svcMode.
virtual const DaqCalibDetailscalibDetails (const int index, const ServiceMode &svcMode) const
 Returns the specified DaqCalibDetails instance.

Static Public Member Functions

static const InterfaceID & interfaceID ()

Private Member Functions

 DetailsFromRecordSvc (const DetailsFromRecordSvc &rhs)
 Suppress default.
DetailsFromRecordSvcoperator= (const DetailsFromRecordSvc &rhs)
 Suppress default.
void flushExpiredDetails () const

Private Attributes

IDaqReadoutSvcm_daqReadoutSvc
 The IDaqReadoutSvc that provides access to the DAQ Blocks.
unsigned int m_lastTime
 The time the last file was started.
unsigned int m_lastDate
 The date the last file was started.
unsigned int m_lastFile
 The file the last file was started.
const RunDetailsFromRecordm_runDetails
 The currentrly cached DaqRunDetails instance.
const FileDetailsFromRecordm_fileDetails
 The currentrly cached DaqFileDetails instance.
std::vector
< CalibDetailsFromRecord * > * 
m_calibDetails
 The currentrly cached DaqCalibDetails instance.

Detailed Description

This interface provide access to non-event details of the DAQ.

Definition at line 305 of file DetailsFromRecordSvc.h.


Constructor & Destructor Documentation

DetailsFromRecordSvc::DetailsFromRecordSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Creates an instance of this class.

Definition at line 205 of file DetailsFromRecordSvc.cc.

                                                           :
  Service(name,
          svc),
  m_daqReadoutSvc(0),
  m_lastTime(0),
  m_lastDate(0),
  m_lastFile(0),
  m_runDetails(0),
  m_fileDetails(0),
  m_calibDetails(new vector<CalibDetailsFromRecord*>())
{
}
DetailsFromRecordSvc::~DetailsFromRecordSvc ( ) [virtual]

Creates an instance of this class.

Definition at line 219 of file DetailsFromRecordSvc.cc.

                                            {
}
DetailsFromRecordSvc::DetailsFromRecordSvc ( const DetailsFromRecordSvc rhs) [private]

Suppress default.


Member Function Documentation

StatusCode DetailsFromRecordSvc::initialize ( ) [virtual]

Initialize this instance.

Definition at line 235 of file DetailsFromRecordSvc.cc.

                                            {
  StatusCode status = Service::initialize();
  if (status.isFailure()) {
    throw GaudiException("Could not initialize super class",
                         name(),
                         status);
  }
  status = service("DaqReadoutSvc",
                   m_daqReadoutSvc);
  if (status.isFailure() ) {
    return status;
  }
  return StatusCode::SUCCESS;
}
StatusCode DetailsFromRecordSvc::finalize ( ) [virtual]

Finalize this instance.

Definition at line 250 of file DetailsFromRecordSvc.cc.

                                          {
  const vector<CalibDetailsFromRecord*>::const_iterator finished = m_calibDetails->end();
  for (vector<CalibDetailsFromRecord*>::const_iterator calib = m_calibDetails->begin();
       finished != calib;
       ++calib) {
       delete *calib;
  }
  if (0 != m_fileDetails) {
    delete m_fileDetails;
  }
  if (0 != m_runDetails) {
    delete m_runDetails;
  }
  if( 0 != m_daqReadoutSvc ) {
    m_daqReadoutSvc->release();
  }
  return Service::finalize();
}
StatusCode DetailsFromRecordSvc::queryInterface ( const InterfaceID &  id,
void **  interface 
) [virtual]

Test if the supplied interface is supported.

Definition at line 222 of file DetailsFromRecordSvc.cc.

                                                                 {
  if (IDaqDetailsSvc::interfaceID().versionMatch(id)) {
    // Good enough. Return this object
    *interface = dynamic_cast<IDaqDetailsSvc*>(this);
    addRef();
    return StatusCode::SUCCESS;
  }
  // Try base class
  return Service::queryInterface(id,
                                 interface);
}
bool DetailsFromRecordSvc::hasRunDetails ( const ServiceMode svcMode) const [virtual]

Returns true when there is a DaqRunDetails available for the specified svcMode.

Implements IDaqDetailsSvc.

Definition at line 309 of file DetailsFromRecordSvc.cc.

                                                                   {
  flushExpiredDetails();
  return 0 != m_runDetails;
}
const DaqRunDetails & DetailsFromRecordSvc::runDetails ( const ServiceMode svcMode) const [virtual]

Returns the current RunDetailsFromRecord instance.

Implements IDaqDetailsSvc.

Definition at line 314 of file DetailsFromRecordSvc.cc.

bool DetailsFromRecordSvc::hasFileDetails ( const ServiceMode svcMode) const [virtual]

Returns true when there is a DaqFileDetails available for the specified svcMode.

Implements IDaqDetailsSvc.

Definition at line 319 of file DetailsFromRecordSvc.cc.

                                                                    {
  flushExpiredDetails();
  return 0 != m_fileDetails;
}
const DaqFileDetails & DetailsFromRecordSvc::fileDetails ( const ServiceMode svcMode) const [virtual]

Returns the current FileDetailsFromRecord instance.

Implements IDaqDetailsSvc.

Definition at line 324 of file DetailsFromRecordSvc.cc.

int DetailsFromRecordSvc::calibDetailsCount ( const ServiceMode svcMode) const [virtual]

Returns the number of DaqCalibDetails available for the specified svcMode.

Implements IDaqDetailsSvc.

Definition at line 329 of file DetailsFromRecordSvc.cc.

                                                                      {
  flushExpiredDetails();
  return m_calibDetails->size();
}
const DaqCalibDetails & DetailsFromRecordSvc::calibDetails ( const int  index,
const ServiceMode svcMode 
) const [virtual]

Returns the specified DaqCalibDetails instance.

Implements IDaqDetailsSvc.

Definition at line 334 of file DetailsFromRecordSvc.cc.

                                                                                       {
  flushExpiredDetails();
  return *(m_calibDetails->at(index));
}
DetailsFromRecordSvc& DetailsFromRecordSvc::operator= ( const DetailsFromRecordSvc rhs) [private]

Suppress default.

void DetailsFromRecordSvc::flushExpiredDetails ( ) const [private]

Definition at line 269 of file DetailsFromRecordSvc.cc.

                                                     {
  bool recordValid = m_daqReadoutSvc->hasFileStartRecord();
  const DybDaq::FileStartRecord& record = m_daqReadoutSvc->fileStartRecord();
  if (recordValid && m_lastTime == record.time() && m_lastDate == record.date() && m_lastFile == record.fileNumber()) {
      return;
  }
  const vector<CalibDetailsFromRecord*>::const_iterator finished = m_calibDetails->end();
  for (vector<CalibDetailsFromRecord*>::const_iterator calib;
       finished != calib;
       ++calib) {
       delete *calib;
  }
  m_calibDetails->clear();
  if (0 != m_fileDetails) {
    delete m_fileDetails;
    m_fileDetails = 0;
  }
  if (0 != m_runDetails) {
    delete m_runDetails;
    m_runDetails = 0;
  }
  if (!recordValid) {
    return;
  }
  m_lastTime = record.time();
  m_lastDate = record.date();
  m_lastFile = record.fileNumber();
  if (m_daqReadoutSvc->hasRunParametersRecord()) {
    m_runDetails = new RunDetailsFromRecord(m_daqReadoutSvc->runParametersRecord());
  }
  m_fileDetails = new FileDetailsFromRecord(record,
                                            m_daqReadoutSvc->fileNameStrings());
  const int finished2 = m_daqReadoutSvc->calibrationParametersRecordCount();
  for (int calib = 0;
       finished2 != calib;
       ++calib) {
      m_calibDetails->push_back(new CalibDetailsFromRecord(m_daqReadoutSvc->calibrationParametersRecord(calib)));
  }
}

Member Data Documentation

The IDaqReadoutSvc that provides access to the DAQ Blocks.

Definition at line 384 of file DetailsFromRecordSvc.h.

unsigned int DetailsFromRecordSvc::m_lastTime [mutable, private]

The time the last file was started.

Definition at line 391 of file DetailsFromRecordSvc.h.

unsigned int DetailsFromRecordSvc::m_lastDate [mutable, private]

The date the last file was started.

Definition at line 396 of file DetailsFromRecordSvc.h.

unsigned int DetailsFromRecordSvc::m_lastFile [mutable, private]

The file the last file was started.

Definition at line 401 of file DetailsFromRecordSvc.h.

The currentrly cached DaqRunDetails instance.

Definition at line 406 of file DetailsFromRecordSvc.h.

The currentrly cached DaqFileDetails instance.

Definition at line 411 of file DetailsFromRecordSvc.h.

The currentrly cached DaqCalibDetails instance.

Definition at line 416 of file DetailsFromRecordSvc.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:15:32 for DaqFormatModules by doxygen 1.7.4