RawBlockRegistry Class Reference

#include <RawBlockRegistry.h>

List of all members.

Classes

struct  Cleaner

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

static RawBlockRegistryInstance ()

Private Member Functions

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

Private Attributes

std::list< RawBlockProxy * > fRawBlockProxyTable

Static Private Attributes

static RawBlockRegistryfInstance = 0

Friends

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

Detailed Description

Definition at line 35 of file RawBlockRegistry.h.


Member Typedef Documentation

Definition at line 41 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 Instance(), and Msg::kVerbose.

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 58 of file RawBlockRegistry.h.

00058 { abort(); }


Member Function Documentation

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

Definition at line 50 of file RawBlockRegistry.h.

References fRawBlockProxyTable.

Referenced by RotoObjectifier::SysLogRawBlockRegistry().

00050 { return fRawBlockProxyTable; }

RawBlockRegistry & RawBlockRegistry::Instance ( void   )  [static]
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  ) 
RawBlockRegistry& RawBlockRegistry::operator= ( const RawBlockRegistry rbr  )  [inline, private]

Definition at line 59 of file RawBlockRegistry.h.

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

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

Definition at line 52 of file RawBlockRegistry.h.

References Instance().

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

void RawBlockRegistry::Register ( RawBlockProxy rawBlockProxy  ) 

Definition at line 43 of file RawBlockRegistry.cxx.

References fRawBlockProxyTable, RawBlockProxy::GetMajorId(), RawBlockProxy::GetName(), RawBlockProxy::IsDCS(), Msg::kDebug, Msg::kWarning, 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 71 of file RawBlockRegistry.h.

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

Member Data Documentation

Definition at line 75 of file RawBlockRegistry.h.

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

Definition at line 76 of file RawBlockRegistry.h.

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


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1