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 {
40  friend class FWTableView;
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 
93  Views m_views;
94  Items m_items;
95  TableSpecs m_tableFormats;
96 private:
97  TableSpecs::iterator tableFormatsImpl(const edm::TypeWithDict &key);
98  FWTableViewManager(const FWTableViewManager&); // stop default
99  const FWTableViewManager& operator=(const FWTableViewManager&); // stop default
100 
101  void beingDestroyed(const FWViewBase*);
102 
104  {
105  public:
106  TableHandle &column(const char *formula, int precision, const char *name);
107  TableHandle &column(const char *label, int precision)
108  {
109  return column(label, precision, label);
110  }
111 
112  TableHandle(const char *name, TableSpecs &specs)
113  :m_name(name), m_specs(specs)
114  {
115  m_specs[name].clear();
116  }
117  private:
119  TableSpecs &m_specs;
120  };
121 
122  TableHandle table(const char *collection);
123 };
124 
125 #endif
type
Definition: HCALResponse.h:21
void addToImpl(FWConfiguration &) const
TableHandle table(const char *collection)
void addTo(FWConfiguration &) const override
TableHandle(const char *name, TableSpecs &specs)
TableHandle & column(const char *label, int precision)
const FWTableViewManager & operator=(const FWTableViewManager &)
TableSpecs::iterator tableFormats(const edm::TypeWithDict &key)
const Items & items() const
TableSpecs::iterator tableFormatsImpl(const edm::TypeWithDict &key)
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
void modelChangesDone() override
void colorsChanged() override
void destroyItem(const FWEventItem *item)
FWTypeToRepresentations supportedTypesAndRepresentations() const override
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