CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/Fireworks/Core/interface/FWEventItemsManager.h

Go to the documentation of this file.
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.19 2011/07/30 04:54:27 amraktad 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 class FWProxyBuilderConfiguration;
00044 
00045 class FWEventItemsManager : public FWConfigurable
00046 {
00047 public:
00048    //does not take ownership of the object to which it points but does keep reference
00049    FWEventItemsManager(FWModelChangeManager*);
00050    virtual ~FWEventItemsManager();
00051 
00052    typedef std::vector<FWEventItem*>::const_iterator const_iterator;
00053 
00054    //configuration management interface
00055    void addTo(FWConfiguration&) const;
00056    void setFrom(const FWConfiguration&);
00057 
00058    // ---------- const member functions ---------------------
00060    const_iterator begin() const;
00061    const_iterator end() const;
00062    // const std::vector<FWEventItem*> &items () const { return m_items; }
00063 
00064    const FWEventItem* find(const std::string& iName) const;
00065    // ---------- static member functions --------------------
00066 
00067    // ---------- member functions ---------------------------
00068    const FWEventItem* add(const FWPhysicsObjectDesc& iItem,  const FWConfiguration* pbConf = 0);
00069    void clearItems();
00070 
00071    void newEvent(const edm::EventBase* iEvent);
00072 
00073    void setContext(fireworks::Context*);
00074 
00075    sigc::signal<void, FWEventItem*> newItem_;
00076    sigc::signal<void> goingToClearItems_;
00077 private:
00078 
00079    void removeItem(const FWEventItem*);
00080    FWEventItemsManager(const FWEventItemsManager&);    // stop default
00081 
00082    const FWEventItemsManager& operator=(const FWEventItemsManager&);    // stop default
00083 
00084    // ---------- member data --------------------------------
00085    std::vector<FWEventItem*> m_items;
00086    FWModelChangeManager* m_changeManager;
00087    fireworks::Context* m_context;
00088 
00089    const edm::EventBase* m_event;
00090    boost::shared_ptr<FWItemAccessorFactory> m_accessorFactory;
00091 };
00092 
00093 
00094 #endif