CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 // $Id: InitMsgCollection.h,v 1.15 2012/04/20 10:48:18 mommsen Exp $
00003 
00004 #ifndef EventFilter_StorageManager_InitMsgCollection_h
00005 #define EventFilter_StorageManager_InitMsgCollection_h
00006 
00007 #include "IOPool/Streamer/interface/InitMessage.h"
00008 
00009 #include "boost/shared_ptr.hpp"
00010 #include "boost/thread/thread.hpp"
00011 #include <map>
00012 #include <set>
00013 #include <string>
00014 #include <utility>
00015 #include <vector>
00016 
00017 namespace stor
00018 {
00019 
00020   class I2OChain;
00021 
00032   typedef std::vector<unsigned char> InitMsgBuffer;
00033   typedef boost::shared_ptr<InitMsgBuffer> InitMsgSharedPtr;
00034 
00035   class InitMsgCollection
00036   {
00037 
00038   public:
00039 
00043     InitMsgCollection();
00044 
00048     ~InitMsgCollection();
00049 
00065     bool addIfUnique(InitMsgView const& initMsgView);
00066 
00086     bool addIfUnique(I2OChain const&, InitMsgSharedPtr&);
00087 
00098     InitMsgSharedPtr getElementForOutputModuleId(const uint32_t&) const;
00099 
00119     InitMsgSharedPtr getElementForOutputModuleLabel(const std::string&) const;
00120 
00128     InitMsgSharedPtr getElementAt(const unsigned int index) const;
00129  
00133     void clear();
00134 
00140     size_t size() const;
00141 
00147     std::string getSelectionHelpString() const;
00148 
00155     std::string getOutputModuleName(const uint32_t outputModuleId) const;
00156 
00167     static std::string stringsToText(Strings const& list,
00168                                      unsigned int maxCount = 0);
00169 
00170   private:
00171 
00172     void checkOutputModuleLabel(InitMsgView const&) const;
00173 
00174     typedef std::map<uint32_t,InitMsgSharedPtr> InitMsgMap;
00175     InitMsgMap initMsgMap_;
00176     mutable boost::mutex listLock_;
00177   };
00178   
00179   typedef boost::shared_ptr<InitMsgCollection> InitMsgCollectionPtr;
00180 
00181 } //namespace stor
00182 
00183 #endif // EventFilter_StorageManager_InitMsgCollection_h
00184 
00185