CMS 3D CMS Logo

FWTableViewManager.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef Fireworks_Core_FWTableViewManager_h
3 #define Fireworks_Core_FWTableViewManager_h
4 //
5 // Package: Core
6 // Class : FWTableViewManager
7 //
16 //
17 // Original Author:
18 // Created: Sat Jan 5 10:29:00 EST 2008
19 //
20 
21 // system include files
22 #include <string>
23 #include <vector>
24 #include <set>
25 #include <map>
27 
28 // user include files
29 
33 
34 class FWViewBase;
35 class FWGUIManager;
36 class TEveWindowSlot;
37 
39  friend class FWTableView;
41 
42 public:
43  struct TableEntry {
44  enum { INT = 0, INT_HEX = -1, BOOL = -2 };
47  int precision;
48  };
49 
51  typedef std::vector<const FWEventItem *> Items;
53  typedef std::vector<TableEntry> TableEntries;
56  typedef std::map<std::string, TableEntries> TableSpecs;
57 
59  ~FWTableViewManager() override;
60 
61  // ---------- const member functions ---------------------
63  // ---------- static member functions --------------------
64 
65  // ---------- member functions ---------------------------
66  void newItem(const FWEventItem *) override;
67  void destroyItem(const FWEventItem *item);
68  void removeAllItems(void);
69  FWViewBase *buildView(TEveWindowSlot *iParent, const std::string &type);
70  const Items &items() const { return m_items; }
71  TableSpecs::iterator tableFormats(const edm::TypeWithDict &key);
72  TableSpecs::iterator tableFormats(const TClass &key);
73  void addTo(FWConfiguration &) const override;
74  void addToImpl(FWConfiguration &) const;
75  void setFrom(const FWConfiguration &) override;
76 
77  void notifyViews();
78 
81 
82 protected:
84 
86  void modelChangesComing() override;
87  void modelChangesDone() override;
88  void colorsChanged() override;
89  void dataChanged();
90 
91  typedef std::vector<std::shared_ptr<FWTableView> > Views;
92 
96 
97 private:
98  TableSpecs::iterator tableFormatsImpl(const edm::TypeWithDict &key);
99  FWTableViewManager(const FWTableViewManager &); // stop default
100  const FWTableViewManager &operator=(const FWTableViewManager &); // stop default
101 
102  void beingDestroyed(const FWViewBase *);
103 
104  class TableHandle {
105  public:
106  TableHandle &column(const char *formula, int precision, const char *name);
107  TableHandle &column(const char *label, int precision) { return column(label, precision, label); }
108 
109  TableHandle(const char *name, TableSpecs &specs) : m_name(name), m_specs(specs) { m_specs[name].clear(); }
110 
111  private:
114  };
115 
116  TableHandle table(const char *collection);
117 };
118 
119 #endif
TableHandle table(const char *collection)
TableHandle(const char *name, TableSpecs &specs)
TableHandle & column(const char *label, int precision)
TableHandle & column(const char *formula, int precision, const char *name)
void addToImpl(FWConfiguration &) const
const FWTableViewManager & operator=(const FWTableViewManager &)
FWTypeToRepresentations supportedTypesAndRepresentations() const override
char const * label
TableSpecs::iterator tableFormats(const edm::TypeWithDict &key)
void addTo(FWConfiguration &) const override
TableSpecs::iterator tableFormatsImpl(const edm::TypeWithDict &key)
key
prepare the HTCondor submission files and eventually submit them
void modelChangesComing() override
std::map< std::string, TableEntries > TableSpecs
void setFrom(const FWConfiguration &) override
std::vector< TableEntry > TableEntries
std::vector< const FWEventItem * > Items
static const std::string kConfigColumns
const Items & items() const
void modelChangesDone() override
void colorsChanged() override
void destroyItem(const FWEventItem *item)
static const std::string kConfigTypeNames
void beingDestroyed(const FWViewBase *)
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)
void newItem(const FWEventItem *) override
std::vector< std::shared_ptr< FWTableView > > Views