CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/EventFilter/ResourceBroker/interface/RawCache.h

Go to the documentation of this file.
00001 
00002 //
00003 // RawCache.h
00004 // -------
00005 //
00006 // Backup for RawMsgBuf messages containing raw FED data.
00007 //
00008 //  Created on: Nov 16, 2011
00009 //                                                                              Andrei Spataru : aspataru@cern.ch
00011 
00012 #ifndef RAWCACHE_H_
00013 #define RAWCACHE_H_
00014 
00015 #include "EventFilter/ResourceBroker/interface/RawMsgBuf.h"
00016 
00017 namespace evf {
00018 
00028 class RawCache {
00029 public:
00030 
00034         static RawCache* getInstance();
00035 
00040         void initialise(unsigned int nMsgs, unsigned int cellSize);
00041         virtual ~RawCache();
00042 
00047         RawMsgBuf* getMsgToWrite();
00048 
00052         void releaseMsg(unsigned int fuResourceId);
00053 
00057         void printUsage() const;
00058 
00059 private:
00060         static RawCache* instance_;
00061         RawCache();
00062         int getFreeSlot() const;
00063         void setFree(RawMsgBuf* rawCell);
00064 
00065 private:
00066         bool initialised_;
00067         RawMsgBuf** msgs_;
00068         unsigned int nMsgs_, cellSize_;
00069         bool* slotUsage_;
00070 };
00071 
00072 }
00073 
00074 #endif /* RAWCACHE_H_ */