CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWPSetTableManager.h
Go to the documentation of this file.
1 #ifndef Fireworks_FWInterface_FWPSetTableManager_h
2 #define Fireworks_FWInterface_FWPSetTableManager_h
3 // -*- C++ -*-
4 //
5 // Package: FWInterface
6 // Class : FWPSetTableManager
7 //
16 //
17 // Original Author:
18 // Created: Mon Feb 28 17:06:50 CET 2011
19 // $Id: FWPSetTableManager.h,v 1.11 2012/09/08 06:13:57 amraktad Exp $
20 //
21 
22 // system include files
23 
24 
25 #include <sigc++/sigc++.h>
29 
30 class FWPSetCellEditor;
31 namespace edm
32 {
33  class ScheduleInfo;
34 }
35 
36 
37 
39 {
40  friend class FWPathsPopup;
41 
42 public:
44  struct PSetData
45  {
46  PSetData() :level(-1),
47  tracked(false),
48 
49  type(-1),
50 
51  parent(-1),
52 
53  module(-1),
54  path(-1),
55 
58 
59  visible(false),
60 
61  matches(false),
63 
64  editable(false) , pset(0){}
65 
68 
69  int level;
70  bool tracked;
71  char type;
72  size_t parent;
73 
74  size_t module;
75  size_t path;
76 
79 
80  bool visible;
81  bool matches;
83  bool editable;
84 
86  };
87 
89  virtual ~FWPSetTableManager();
90 
91 
92  virtual int unsortedRowNumber(int unsorted) const ;
93  virtual int numberOfRows() const;
94  virtual int numberOfColumns() const;
95  virtual std::vector<std::string> getTitles() const;
96  virtual const std::string title() const;
97  virtual FWTableCellRendererBase* cellRenderer(int iSortedRowNumber, int iCol) const;
98 
99  int selectedRow() const;
100  int selectedColumn() const;
101  virtual bool rowIsSelected(int row) const;
102 
103  virtual void implSort(int, bool);
104  virtual bool cellDataIsSortable() const { return false ; }
105 
106  virtual void updateFilter(const char *filter);
107 
108  virtual std::vector<unsigned int> maxWidthForColumns() const;
109 
110  std::vector<PSetData> &data() { return m_entries; }
111  std::vector<int> &rowToIndex() { return m_row_to_index; }
112 
113  //______________________________________________________________________________
114 
115 protected:
116  struct ModuleInfo
117  {
121  size_t pathIndex;
122  size_t path;
123  size_t entry;
124  bool passed;
128  bool dirty;
129 
132  };
133 
135  struct PathUpdate
136  {
138  bool passed;
139  size_t choiceMaker;
140  };
141 
142 
143  void setExpanded(int row);
145  void update(std::vector<PathUpdate> &pathUpdates);
146 
147  bool applyEditor();
148  void cancelEditor();
149 
150  std::vector<ModuleInfo> &modules() { return m_modules; }
151  std::vector<PSetData> &entries() { return m_entries; }
152 
153  void setSelection (int row, int column, int mask);
154  //______________________________________________________________________________
155 
156 private:
157 
159  struct PathInfo
160  {
162  size_t entryId;
164  size_t moduleStart;
165  size_t moduleEnd;
166  bool passed;
167  };
168 
169  FWPSetTableManager(const FWPSetTableManager&); // stop default
170  const FWPSetTableManager& operator=(const FWPSetTableManager&); // stop default
171 
172  void recalculateVisibility();
173 
174  template <class T> void createScalarString(PSetData &data, T v);
175  template <typename T> void createVectorString(FWPSetTableManager::PSetData &data, const T &v, bool quotes);
176 
178 
179  void handleEntry(const edm::Entry &entry,const std::string &key);
182  void handlePSet(edm::ParameterSet *psp);
183 
184  std::vector<PSetData> m_entries;
186  std::vector<PathInfo> m_paths;
187  std::vector<ModuleInfo> m_modules;
188  std::map<std::string, size_t> m_pathIndex;
189  std::vector<size_t> m_parentStack;
190  std::vector<int> m_row_to_index;
195  std::vector<std::string> m_availablePaths;
196 
198 };
199 
200 
201 #endif
std::vector< ModuleInfo > & modules()
type
Definition: HCALResponse.h:21
virtual FWTableCellRendererBase * cellRenderer(int iSortedRowNumber, int iCol) const
std::vector< std::string > m_availablePaths
virtual std::vector< unsigned int > maxWidthForColumns() const
for each column in the table this returns the present maximum width for that column ...
std::vector< PathInfo > m_paths
virtual bool rowIsSelected(int row) const
virtual void implSort(int, bool)
Called by &#39;sort&#39; method to actually handle the sorting of the rows. Arguments are the same as &#39;sort&#39;...
FWTextTreeCellRenderer m_renderer
std::vector< size_t > m_parentStack
std::vector< int > & rowToIndex()
void handlePSetEntry(edm::ParameterSetEntry &entry, const std::string &key)
void createVectorString(FWPSetTableManager::PSetData &data, const T &v, bool quotes)
std::vector< ModuleInfo > m_modules
virtual const std::string title() const
std::map< std::string, size_t > m_pathIndex
std::vector< PSetData > & data()
void handleVPSetEntry(edm::VParameterSetEntry &entry, const std::string &key)
std::vector< int > m_row_to_index
std::vector< PSetData > m_entries
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
virtual std::vector< std::string > getTitles() const
returns the title names for each column
void handleEntry(const edm::Entry &entry, const std::string &key)
void handlePSet(edm::ParameterSet *psp)
FWPSetCellEditor * m_editor
void updateSchedule(const edm::ScheduleInfo *info)
const FWPSetTableManager & operator=(const FWPSetTableManager &)
void createScalarString(PSetData &data, T v)
virtual void updateFilter(const char *filter)
tuple editor
Definition: idDealer.py:73
void setCellValueEditor(FWPSetCellEditor *editor)
virtual bool cellDataIsSortable() const
list key
Definition: combine.py:13
void update(std::vector< PathUpdate > &pathUpdates)
virtual int unsortedRowNumber(int unsorted) const
when passed the index to the sorted order of the rows it returns the original row number from the und...
void setSelection(int row, int column, int mask)
long double T
virtual int numberOfColumns() const
Number of columns in the table.
Definition: vlib.h:209
virtual int numberOfRows() const
Number of rows in the table.
std::vector< PSetData > & entries()