File indexing completed on 2024-04-06 12:11:31
0001
0002 #ifndef Fireworks_Core_FWEventItemsManager_h
0003 #define Fireworks_Core_FWEventItemsManager_h
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <vector>
0023 #include <memory>
0024 #include "sigc++/signal.h"
0025
0026
0027 #include "Fireworks/Core/interface/FWConfigurable.h"
0028
0029
0030 namespace edm {
0031 class EventBase;
0032 }
0033 namespace fireworks {
0034 class Context;
0035 }
0036
0037 class FWEventItem;
0038 class FWPhysicsObjectDesc;
0039 class FWModelChangeManager;
0040 class FWSelectionManager;
0041 class FWItemAccessorFactory;
0042 class FWProxyBuilderConfiguration;
0043
0044 class FWEventItemsManager : public FWConfigurable {
0045 public:
0046
0047 FWEventItemsManager(FWModelChangeManager*);
0048 ~FWEventItemsManager() override;
0049
0050 typedef std::vector<FWEventItem*>::const_iterator const_iterator;
0051
0052
0053 void addTo(FWConfiguration&) const override;
0054 void setFrom(const FWConfiguration&) override;
0055
0056
0057
0058 const_iterator begin() const;
0059 const_iterator end() const;
0060
0061
0062 const FWEventItem* find(const std::string& iName) const;
0063
0064
0065
0066 FWEventItem* add(const FWPhysicsObjectDesc& iItem, const FWConfiguration* pbConf = nullptr, bool doSetEvent = true);
0067 void clearItems();
0068
0069 void newEvent(const edm::EventBase* iEvent);
0070
0071 void setContext(fireworks::Context*);
0072
0073 sigc::signal<void(FWEventItem*)> newItem_;
0074 sigc::signal<void(const FWEventItem*)> removingItem_;
0075 sigc::signal<void()> goingToClearItems_;
0076
0077 FWEventItemsManager(const FWEventItemsManager&) = delete;
0078
0079 const FWEventItemsManager& operator=(const FWEventItemsManager&) = delete;
0080
0081 private:
0082 void removeItem(const FWEventItem*);
0083
0084
0085 std::vector<FWEventItem*> m_items;
0086 FWModelChangeManager* m_changeManager;
0087 fireworks::Context* m_context;
0088
0089 const edm::EventBase* m_event;
0090 std::shared_ptr<FWItemAccessorFactory> m_accessorFactory;
0091 };
0092
0093 #endif