CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/EventFilter/StorageManager/interface/DQMEventProcessorResources.h

Go to the documentation of this file.
00001 // $Id: DQMEventProcessorResources.h,v 1.5 2011/03/07 15:31:31 mommsen Exp $
00003 
00004 
00005 #ifndef EventFilter_StorageManager_DQMEventProcessorResources_h
00006 #define EventFilter_StorageManager_DQMEventProcessorResources_h
00007 
00008 #include "EventFilter/StorageManager/interface/Configuration.h"
00009 
00010 #include "boost/thread/condition.hpp"
00011 #include "boost/thread/mutex.hpp"
00012 
00013 namespace stor
00014 {
00015 
00025   class DQMEventProcessorResources
00026   {
00027   public:
00028 
00029     struct Requests
00030     {
00031       bool configuration;
00032       bool endOfRun;
00033       bool storeDestruction;
00034 
00035       void reset();
00036     };
00037 
00041     DQMEventProcessorResources();
00042 
00046     virtual ~DQMEventProcessorResources() {}
00047 
00053     void requestConfiguration(DQMProcessingParams const&,  boost::posix_time::time_duration const&);
00054 
00058     void requestEndOfRun();
00059 
00063     void requestStoreDestruction();
00064 
00070     bool getRequests(Requests&, DQMProcessingParams&, boost::posix_time::time_duration& timeoutValue);
00071 
00075     virtual void waitForCompletion();
00076 
00080     virtual bool requestsOngoing();
00081 
00085     void requestsDone();
00086 
00087 
00088   private:
00089 
00090     bool requestsPending_;
00091     bool requestsInProgress_;
00092     Requests pendingRequests_;
00093 
00094     DQMProcessingParams requestedDQMProcessingParams_;
00095     boost::posix_time::time_duration requestedTimeout_;
00096 
00097     boost::condition requestsCondition_;
00098 
00099     mutable boost::mutex requestsMutex_;
00100   };
00101 
00102   typedef boost::shared_ptr<DQMEventProcessorResources> DQMEventProcessorResourcesPtr;
00103 
00104 } // namespace stor
00105 
00106 #endif // EventFilter_StorageManager_DQMEventProcessorResources_h
00107