![]() |
![]() |
00001 // -*- C++ -*- 00002 #ifndef Fireworks_Core_FWEventItemsManager_h 00003 #define Fireworks_Core_FWEventItemsManager_h 00004 // 00005 // Package: Core 00006 // Class : FWEventItemsManager 00007 // 00016 // 00017 // Original Author: 00018 // Created: Thu Jan 3 13:27:29 EST 2008 00019 // $Id: FWEventItemsManager.h,v 1.18 2010/09/07 15:46:46 yana Exp $ 00020 // 00021 00022 // system include files 00023 #include <vector> 00024 #include <boost/shared_ptr.hpp> 00025 #include "sigc++/signal.h" 00026 00027 // user include files 00028 #include "Fireworks/Core/interface/FWConfigurable.h" 00029 00030 // forward declarations 00031 namespace edm { 00032 class EventBase; 00033 } 00034 namespace fireworks { 00035 class Context; 00036 } 00037 00038 class FWEventItem; 00039 class FWPhysicsObjectDesc; 00040 class FWModelChangeManager; 00041 class FWSelectionManager; 00042 class FWItemAccessorFactory; 00043 00044 class FWEventItemsManager : public FWConfigurable 00045 { 00046 public: 00047 //does not take ownership of the object to which it points but does keep reference 00048 FWEventItemsManager(FWModelChangeManager*); 00049 virtual ~FWEventItemsManager(); 00050 00051 typedef std::vector<FWEventItem*>::const_iterator const_iterator; 00052 00053 //configuration management interface 00054 void addTo(FWConfiguration&) const; 00055 void setFrom(const FWConfiguration&); 00056 00057 // ---------- const member functions --------------------- 00059 const_iterator begin() const; 00060 const_iterator end() const; 00061 // const std::vector<FWEventItem*> &items () const { return m_items; } 00062 00063 const FWEventItem* find(const std::string& iName) const; 00064 // ---------- static member functions -------------------- 00065 00066 // ---------- member functions --------------------------- 00067 const FWEventItem* add(const FWPhysicsObjectDesc& iItem); 00068 void clearItems(); 00069 00070 void newEvent(const edm::EventBase* iEvent); 00071 00072 void setContext(fireworks::Context*); 00073 00074 sigc::signal<void, FWEventItem*> newItem_; 00075 sigc::signal<void> goingToClearItems_; 00076 private: 00077 00078 void removeItem(const FWEventItem*); 00079 FWEventItemsManager(const FWEventItemsManager&); // stop default 00080 00081 const FWEventItemsManager& operator=(const FWEventItemsManager&); // stop default 00082 00083 // ---------- member data -------------------------------- 00084 std::vector<FWEventItem*> m_items; 00085 FWModelChangeManager* m_changeManager; 00086 fireworks::Context* m_context; 00087 00088 const edm::EventBase* m_event; 00089 boost::shared_ptr<FWItemAccessorFactory> m_accessorFactory; 00090 }; 00091 00092 00093 #endif