Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RawBlockRegistry Class Reference

#include <RawBlockRegistry.h>

List of all members.

Public Types

typedef RawDataBlockRawDataBlockCreator_t )(const char *name)

Public Member Functions

 ~RawBlockRegistry ()
void Register (RawBlockProxy *rawBlockProxy)
RawBlockProxyLookUp (const char *name)
RawBlockProxyLookUp (bool isDCS, int majorId)
const std::list< RawBlockProxy * > & GetProxyList () const
void Print (Option_t *="") const

Static Public Member Functions

RawBlockRegistryInstance ()

Private Member Functions

 RawBlockRegistry ()
 RawBlockRegistry (RawBlockRegistry &)
RawBlockRegistryoperator= (const RawBlockRegistry &rbr)

Private Attributes

std::list< RawBlockProxy * > fRawBlockProxyTable

Static Private Attributes

RawBlockRegistryfInstance = 0

Friends

struct Cleaner
std::ostream & operator<< (std::ostream &os, const RawBlockRegistry &rbr)


Member Typedef Documentation

typedef RawDataBlock( RawBlockRegistry::RawDataBlockCreator_t)(const char *name)
 

Definition at line 40 of file RawBlockRegistry.h.


Constructor & Destructor Documentation

RawBlockRegistry::~RawBlockRegistry  ) 
 

Definition at line 34 of file RawBlockRegistry.cxx.

00035 {
00036    // dtor is NOT responsible for destroying elements of the list;
00037    // they are created statically and are thus automagically
00038    // destroyed when the process ends
00039 }

RawBlockRegistry::RawBlockRegistry  )  [private]
 

Definition at line 111 of file RawBlockRegistry.cxx.

References MsgService::GetStream(), MsgService::Instance(), and MsgStream::SetLogLevel().

00112 {
00113 //#define DEBUG_RAWDATA
00114 #ifdef DEBUG_RAWDATA
00115 #include <MessageService/MsgStream.h>
00116   // Setting this debug level at run time is too late in this case...
00117   MsgService::Instance()->GetStream("RawData")->SetLogLevel(Msg::kVerbose);
00118 #endif
00119 }

RawBlockRegistry::RawBlockRegistry RawBlockRegistry  )  [inline, private]
 

Definition at line 57 of file RawBlockRegistry.h.

00057 { abort(); }


Member Function Documentation

const std::list<RawBlockProxy*>& RawBlockRegistry::GetProxyList  )  const [inline]
 

Definition at line 49 of file RawBlockRegistry.h.

Referenced by RotoObjectifier::SysLogRawBlockRegistry().

00049 { return fRawBlockProxyTable; }

RawBlockRegistry & RawBlockRegistry::Instance  )  [static]
 

Definition at line 123 of file RawBlockRegistry.cxx.

References RawBlockRegistry::Cleaner::ClassIsUsed(), and fInstance.

Referenced by RotoObjectifier::BufferInflate(), RerootToRawDataModule::FinalizeWorkingArray(), DetSim::FinalizeWorkingArray(), RawBlockId::GetMajorAsString(), RawRecord::PromoteRawDataBlocks(), RawBeamMonHeaderBlock::RawBeamMonHeaderBlock(), RawConfigFilesBlock::RawConfigFilesBlock(), RawDaqDeadTimeBlock::RawDaqDeadTimeBlock(), RawDaqHeaderBlock::RawDaqHeaderBlock(), RawDcsHeaderBlock::RawDcsHeaderBlock(), RawDeadChipBlock::RawDeadChipBlock(), RawErrorStatsBlock::RawErrorStatsBlock(), RawQieErrorStatsBlock::RawQieErrorStatsBlock(), RawRunCommentBlock::RawRunCommentBlock(), RawRunConfigBlock::RawRunConfigBlock(), RawRunEndBlock::RawRunEndBlock(), RawRunStartBlock::RawRunStartBlock(), RawSnarlHeaderBlock::RawSnarlHeaderBlock(), RawSpillServerMonitorBlock::RawSpillServerMonitorBlock(), RawSubRunEndBlock::RawSubRunEndBlock(), RawTpSinglesSummaryBlock::RawTpSinglesSummaryBlock(), RawTriggerStatsBlock::RawTriggerStatsBlock(), and RotoObjectifier::SysLogRawBlockRegistry().

00124 {
00125   if (fInstance==0) {
00126      static RawBlockRegistry::Cleaner c; // end-of-run clean up
00127      c.ClassIsUsed();
00128 
00129      fInstance = new RawBlockRegistry;
00130   }
00131   return *fInstance;
00132 }

RawBlockProxy * RawBlockRegistry::LookUp bool  isDCS,
int  majorId
 

Definition at line 94 of file RawBlockRegistry.cxx.

References fRawBlockProxyTable.

00095 {
00096   // Check if its in table
00097   std::list<RawBlockProxy*>::iterator itrRawBlockProxyTable;
00098   for (itrRawBlockProxyTable  = fRawBlockProxyTable.begin();
00099        itrRawBlockProxyTable != fRawBlockProxyTable.end();
00100        ++itrRawBlockProxyTable) {
00101     if ((*itrRawBlockProxyTable)->IsDCS()      == isDCS &&
00102         (*itrRawBlockProxyTable)->GetMajorId() == majorId  ) {
00103       return (*itrRawBlockProxyTable);
00104     }
00105   }
00106   return 0;
00107 }

RawBlockProxy * RawBlockRegistry::LookUp const char *  name  ) 
 

Definition at line 78 of file RawBlockRegistry.cxx.

References fRawBlockProxyTable.

Referenced by RotoObjectifier::BufferInflate(), RerootToRawDataModule::FinalizeWorkingArray(), DetSim::FinalizeWorkingArray(), RawBlockId::GetMajorAsString(), RawRecord::PromoteRawDataBlocks(), RawBeamMonHeaderBlock::RawBeamMonHeaderBlock(), RawConfigFilesBlock::RawConfigFilesBlock(), RawDaqDeadTimeBlock::RawDaqDeadTimeBlock(), RawDaqHeaderBlock::RawDaqHeaderBlock(), RawDcsHeaderBlock::RawDcsHeaderBlock(), RawDeadChipBlock::RawDeadChipBlock(), RawErrorStatsBlock::RawErrorStatsBlock(), RawQieErrorStatsBlock::RawQieErrorStatsBlock(), RawRunCommentBlock::RawRunCommentBlock(), RawRunConfigBlock::RawRunConfigBlock(), RawRunEndBlock::RawRunEndBlock(), RawRunStartBlock::RawRunStartBlock(), RawSnarlHeaderBlock::RawSnarlHeaderBlock(), RawSpillServerMonitorBlock::RawSpillServerMonitorBlock(), RawSubRunEndBlock::RawSubRunEndBlock(), RawTpSinglesSummaryBlock::RawTpSinglesSummaryBlock(), RawTriggerStatsBlock::RawTriggerStatsBlock(), and Register().

00079 {
00080   // Check if its in table
00081   std::list<RawBlockProxy*>::iterator itrRawBlockProxyTable;
00082   for (itrRawBlockProxyTable  = fRawBlockProxyTable.begin();
00083        itrRawBlockProxyTable != fRawBlockProxyTable.end();
00084        ++itrRawBlockProxyTable) {
00085     if (strcmp(name,(*itrRawBlockProxyTable)->GetName())==0) {
00086       return (*itrRawBlockProxyTable);
00087     }
00088   }
00089   return 0;
00090 }

RawBlockRegistry& RawBlockRegistry::operator= const RawBlockRegistry rbr  )  [inline, private]
 

Definition at line 58 of file RawBlockRegistry.h.

00059       { abort(); return const_cast<RawBlockRegistry&>(rbr); }

void RawBlockRegistry::Print Option_t *  = ""  )  const [inline]
 

Definition at line 51 of file RawBlockRegistry.h.

00051 { std::cout << Instance(); }

void RawBlockRegistry::Register RawBlockProxy rawBlockProxy  ) 
 

Definition at line 43 of file RawBlockRegistry.cxx.

References fRawBlockProxyTable, RawBlockProxy::GetMajorId(), RawBlockProxy::GetName(), RawBlockProxy::IsDCS(), LookUp(), and MSG.

00044 {
00045   const char* blockName    = proxy->GetName();
00046   bool        isDCS        = proxy->IsDCS();
00047   int         blockMajorId = proxy->GetMajorId();
00048   // Add the raw block to the table
00049   if (this->LookUp(blockName)) {
00050     MSG("RawData", Msg::kWarning) 
00051       << "A raw block named " << blockName << " is already registered!\n"
00052       << "Duplicate block names are not allowed!\n";
00053     return;
00054   }
00055   else {
00056     // Do insertions in alphabetical order
00057     std::list<RawBlockProxy*>::iterator itrRawBlockProxyTable;
00058     for (itrRawBlockProxyTable  = fRawBlockProxyTable.begin();
00059          itrRawBlockProxyTable != fRawBlockProxyTable.end();
00060          ++itrRawBlockProxyTable) {
00061       if (strcmp(blockName,(*itrRawBlockProxyTable)->GetName())<0) {
00062         break;
00063       }
00064     }
00065     fRawBlockProxyTable.insert(itrRawBlockProxyTable,proxy);
00066 
00067     const char* isDCSstring = (isDCS) ? "DCS" : "DAQ";
00068     MSG("RawData", Msg::kDebug) 
00069       << "Registered block " << blockName << " "
00070       << isDCSstring << " "
00071       << blockMajorId << " proxy @ "
00072       << proxy << "." << endl;
00073   }
00074 }


Friends And Related Function Documentation

friend struct Cleaner [friend]
 

Definition at line 70 of file RawBlockRegistry.h.

std::ostream& operator<< std::ostream &  os,
const RawBlockRegistry rbr
[friend]
 

Definition at line 20 of file RawBlockRegistry.cxx.

00021 {
00022    std::list<RawBlockProxy*>::const_iterator itrRawBlockProxyTable;
00023    os << "Registered Raw Blocks:\n";
00024    for (itrRawBlockProxyTable  = rbr.fRawBlockProxyTable.begin();
00025         itrRawBlockProxyTable != rbr.fRawBlockProxyTable.end();
00026         ++itrRawBlockProxyTable) {
00027       os << " " << (*(*itrRawBlockProxyTable)) << endl;
00028   }
00029   return os;
00030 }


Member Data Documentation

RawBlockRegistry * RawBlockRegistry::fInstance = 0 [static, private]
 

Definition at line 16 of file RawBlockRegistry.cxx.

Referenced by Instance(), and RawBlockRegistry::Cleaner::~Cleaner().

std::list<RawBlockProxy*> RawBlockRegistry::fRawBlockProxyTable [private]
 

Definition at line 75 of file RawBlockRegistry.h.

Referenced by LookUp(), operator<<(), and Register().


The documentation for this class was generated from the following files:
Generated on Sat Nov 7 01:32:10 2009 for loon by  doxygen 1.3.9.1