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.7 2011/03/04 16:30:16 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) {}
65 
66  std::string label;
67  std::string value;
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 
105  virtual void updateFilter(const char *filter);
106 
107  virtual std::vector<unsigned int> maxWidthForColumns() const;
108 
109  std::vector<PSetData> &data() { return m_entries; }
110  std::vector<int> &rowToIndex() { return m_row_to_index; }
111 
112  //______________________________________________________________________________
113 
114 protected:
115  struct ModuleInfo
116  {
120  size_t pathIndex;
121  size_t path;
122  size_t entry;
123  bool passed;
127  bool dirty;
128  };
129 
131  struct PathUpdate
132  {
133  std::string pathName;
134  bool passed;
135  size_t choiceMaker;
136  };
137 
138 
139  void setExpanded(int row);
141  void update(std::vector<PathUpdate> &pathUpdates);
142 
143  bool applyEditor();
144  void cancelEditor();
145 
146  std::vector<ModuleInfo> &modules() { return m_modules; }
147  std::vector<PSetData> &entries() { return m_entries; }
148 
149  void setSelection (int row, int column, int mask);
150  //______________________________________________________________________________
151 
152 private:
153 
155  struct PathInfo
156  {
157  std::string pathName;
158  size_t entryId;
160  size_t moduleStart;
161  size_t moduleEnd;
162  bool passed;
163  };
164 
165  FWPSetTableManager(const FWPSetTableManager&); // stop default
166  const FWPSetTableManager& operator=(const FWPSetTableManager&); // stop default
167 
168  void recalculateVisibility();
169 
170  template <class T> void createScalarString(PSetData &data, T v);
171  template <typename T> void createVectorString(FWPSetTableManager::PSetData &data, const T &v, bool quotes);
172 
174 
175  void handleEntry(const edm::Entry &entry,const std::string &key);
176  void handlePSetEntry(const edm::ParameterSetEntry& entry, const std::string& key);
177  void handleVPSetEntry(const edm::VParameterSetEntry& entry, const std::string& key);
178  void handlePSet(const edm::ParameterSet &ps);
179 
180  std::vector<PSetData> m_entries;
182  std::vector<PathInfo> m_paths;
183  std::vector<ModuleInfo> m_modules;
184  std::map<std::string, size_t> m_pathIndex;
185  std::vector<size_t> m_parentStack;
186  std::vector<int> m_row_to_index;
189  std::string m_filter;
191  std::vector<std::string> m_availablePaths;
192 
194 };
195 
196 
197 #endif
std::vector< ModuleInfo > & modules()
type
Definition: HCALResponse.h:22
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 ...
void handlePSet(const edm::ParameterSet &ps)
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 createVectorString(FWPSetTableManager::PSetData &data, const T &v, bool quotes)
std::vector< ModuleInfo > m_modules
void handleVPSetEntry(const edm::VParameterSetEntry &entry, const std::string &key)
virtual const std::string title() const
std::map< std::string, size_t > m_pathIndex
std::vector< PSetData > & data()
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)
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 filter
USE THIS FOR SKIMMED TRACKS process.p = cms.Path(process.hltLevel1GTSeed*process.skimming*process.offlineBeamSpot*process.TrackRefitter2) OTHERWISE USE THIS.
Definition: align_tpl.py:86
tuple editor
Definition: idDealer.py:73
void setCellValueEditor(FWPSetCellEditor *editor)
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 handlePSetEntry(const edm::ParameterSetEntry &entry, const std::string &key)
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()
mathSSE::Vec4< T > v