CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/EventFilter/Utilities/interface/BUFUInterface.h

Go to the documentation of this file.
00001 /*
00002  * BUFUInterface.h
00003  *
00004  *  Created on: Aug 16, 2011
00005  *      Author: aspataru
00006  */
00007 
00008 #ifndef BUFUINTERFACE_H_
00009 #define BUFUINTERFACE_H_
00010 
00011 #include "BaseBU.h"
00012 #include "BaseFU.h"
00013 #include "xdaq/Application.h"
00014 
00015 namespace evf {
00016 
00017 class BUFUInterface {
00018 
00019 public:
00020         ~BUFUInterface();
00021 
00023         static BUFUInterface* instance();
00029         static BUFUInterface* forceNewInstance();
00030 
00032         bool registerBU(BaseBU* bu, Logger log);
00034         bool registerFU(BaseFU* fu, Logger log);
00035 
00039         void allocate(const UIntVec_t& fuResourceIds,
00040                         xdaq::ApplicationDescriptor* fuAppDesc);
00042         void discard(UInt_t buResourceId);
00044         void take(xdaq::ApplicationDescriptor* fuAppDesc,
00045                         toolbox::mem::Reference* bufRef);
00046 
00047 private:
00049         static BUFUInterface* instance_;
00050 
00052         BUFUInterface();
00053 
00054         /*
00055          * private functions
00056          */
00058         inline bool directConnection() const {
00059                 return buConn_ && fuConn_;
00060         }
00061 
00062         /*
00063          * private fields
00064          */
00066         BaseBU* bu_;
00068         BaseFU* fu_;
00070         Logger buLogger_, fuLogger_;
00072         bool buConn_, fuConn_;
00073 
00074 };
00075 }
00076 
00077 #endif /* BUFUINTERFACE_H_ */