CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCDDUDataItr Class Reference

#include <CSCDDUDataItr.h>

List of all members.

Public Member Functions

 CSCDDUDataItr ()
 default constructor
 CSCDDUDataItr (const char *buf)
 construct from data buffer. so makes a new DDUEventData
 CSCDDUDataItr (const CSCDDUDataItr &)
 if I own the data, I need to do special copy & assign
 CSCDDUDataItr (const CSCDDUEventData *dduData)
 uses someone else's data, so doesn't delete
bool next ()
const CSCEventDataoperator* ()
void operator= (const CSCDDUDataItr &)
 ~CSCDDUDataItr ()

Private Attributes

int theCurrentCSC
bool theDataIsOwnedByMe
const CSCDDUEventDatatheDDUData
int theNumberOfCSCs

Detailed Description

Definition at line 13 of file CSCDDUDataItr.h.


Constructor & Destructor Documentation

CSCDDUDataItr::CSCDDUDataItr ( )

default constructor

Definition at line 8 of file CSCDDUDataItr.cc.

CSCDDUDataItr::CSCDDUDataItr ( const char *  buf)

construct from data buffer. so makes a new DDUEventData

Definition at line 16 of file CSCDDUDataItr.cc.

References CSCDDUHeader::check(), CSCDDUEventData::cscData(), LogTrace, theDDUData, and theNumberOfCSCs.

                                             :
  theDDUData(0),
  theCurrentCSC(-1),
  theNumberOfCSCs(0),
  theDataIsOwnedByMe(true)
{
  // check if it's OK first
  const CSCDDUHeader * dduHeader
    = reinterpret_cast<const CSCDDUHeader *>(buf);
  if(dduHeader->check()){
    theDDUData = new CSCDDUEventData((unsigned short *)buf);
    theNumberOfCSCs = theDDUData->cscData().size();
  } else {
    LogTrace ("CSCDDUDataItr|CSCRawToDigi") << "Failed DDU header check.";
  }
}
CSCDDUDataItr::CSCDDUDataItr ( const CSCDDUEventData dduData)

uses someone else's data, so doesn't delete

Definition at line 34 of file CSCDDUDataItr.cc.

CSCDDUDataItr::~CSCDDUDataItr ( )

Definition at line 43 of file CSCDDUDataItr.cc.

References theDataIsOwnedByMe, and theDDUData.

CSCDDUDataItr::CSCDDUDataItr ( const CSCDDUDataItr i)

if I own the data, I need to do special copy & assign

Definition at line 49 of file CSCDDUDataItr.cc.

References theDataIsOwnedByMe, and theDDUData.


Member Function Documentation

bool CSCDDUDataItr::next ( void  )

Definition at line 90 of file CSCDDUDataItr.cc.

References theCurrentCSC, and theNumberOfCSCs.

Referenced by CSCChamberDataItr::next().

{
  return (++theCurrentCSC < theNumberOfCSCs);
}
const CSCEventData & CSCDDUDataItr::operator* ( void  )
void CSCDDUDataItr::operator= ( const CSCDDUDataItr i)

Member Data Documentation

Definition at line 37 of file CSCDDUDataItr.h.

Referenced by next(), operator*(), and operator=().

Definition at line 39 of file CSCDDUDataItr.h.

Referenced by CSCDDUDataItr(), operator=(), and ~CSCDDUDataItr().

Definition at line 36 of file CSCDDUDataItr.h.

Referenced by CSCDDUDataItr(), operator*(), operator=(), and ~CSCDDUDataItr().

Definition at line 38 of file CSCDDUDataItr.h.

Referenced by CSCDDUDataItr(), next(), operator*(), and operator=().