CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: FWTableViewManager.h,v 1.8 2010/09/02 18:10:10 amraktad Exp $
20 //
21 
22 // system include files
23 #include <string>
24 #include <vector>
25 #include <set>
26 #include <map>
27 #include "Reflex/Type.h"
28 
29 // user include files
30 
34 
35 class FWViewBase;
36 class FWGUIManager;
37 class TEveWindowSlot;
38 
40 {
41  friend class FWTableView;
43 public:
44  struct TableEntry {
45  enum { INT = 0, INT_HEX = -1, BOOL = -2 };
46  std::string expression;
47  std::string name;
48  int precision;
49  };
50 
52  typedef std::vector<const FWEventItem *> Items;
54  typedef std::vector<TableEntry> TableEntries;
57  typedef std::map<std::string, TableEntries> TableSpecs;
58 
60  virtual ~FWTableViewManager();
61 
62  // ---------- const member functions ---------------------
64  // ---------- static member functions --------------------
65 
66  // ---------- member functions ---------------------------
67  virtual void newItem(const FWEventItem*);
68  void destroyItem(const FWEventItem *item);
69  void removeAllItems(void);
70  FWViewBase * buildView(TEveWindowSlot *iParent, const std::string& type);
71  const Items & items() const { return m_items; }
72  TableSpecs::iterator tableFormats(const Reflex::Type &key);
73  TableSpecs::iterator tableFormats(const TClass &key);
74  void addTo(FWConfiguration&) const;
75  void addToImpl(FWConfiguration&) const;
76  void setFrom(const FWConfiguration&);
77 
78  void notifyViews();
79 
80  static const std::string kConfigTypeNames;
81  static const std::string kConfigColumns;
82 
83 protected:
85 
87  virtual void modelChangesComing();
88  virtual void modelChangesDone();
89  virtual void colorsChanged();
90  void dataChanged ();
91 
92  typedef std::vector<boost::shared_ptr<FWTableView> > Views;
93 
97 private:
98  TableSpecs::iterator tableFormatsImpl(const Reflex::Type &key);
99  FWTableViewManager(const FWTableViewManager&); // stop default
100  const FWTableViewManager& operator=(const FWTableViewManager&); // stop default
101 
102  void beingDestroyed(const FWViewBase*);
103 
105  {
106  public:
107  TableHandle &column(const char *formula, int precision, const char *name);
108  TableHandle &column(const char *label, int precision)
109  {
110  return column(label, precision, label);
111  }
112 
113  TableHandle(const char *name, TableSpecs &specs)
114  :m_name(name), m_specs(specs)
115  {
116  m_specs[name].clear();
117  }
118  private:
119  std::string m_name;
121  };
122 
123  TableHandle table(const char *collection);
124 };
125 
126 #endif
type
Definition: HCALResponse.h:22
void addToImpl(FWConfiguration &) const
TableHandle table(const char *collection)
TableHandle(const char *name, TableSpecs &specs)
const std::string & label
Definition: MVAComputer.cc:186
virtual FWTypeToRepresentations supportedTypesAndRepresentations() const
TableHandle & column(const char *label, int precision)
void setFrom(const FWConfiguration &)
virtual void newItem(const FWEventItem *)
TableHandle & column(const char *formula, int precision, const char *name)
const FWTableViewManager & operator=(const FWTableViewManager &)
const Items & items() const
std::vector< boost::shared_ptr< FWTableView > > Views
TableSpecs::iterator tableFormatsImpl(const Reflex::Type &key)
std::map< std::string, TableEntries > TableSpecs
std::vector< TableEntry > TableEntries
void addTo(FWConfiguration &) const
std::vector< const FWEventItem * > Items
static const std::string kConfigColumns
virtual void modelChangesDone()
virtual void colorsChanged()
void destroyItem(const FWEventItem *item)
list key
Definition: combine.py:13
virtual void modelChangesComing()
static const std::string kConfigTypeNames
TableSpecs::iterator tableFormats(const Reflex::Type &key)
void beingDestroyed(const FWViewBase *)
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)