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 //
20 
21 // system include files
22 
23 
24 #include <sigc++/sigc++.h>
28 
29 class FWPSetCellEditor;
30 namespace edm
31 {
32  class ScheduleInfo;
33 }
34 
35 
36 
38 {
39  friend class FWPathsPopup;
40 
41 public:
43  struct PSetData
44  {
45  PSetData() :level(-1),
46  tracked(false),
47 
48  type(-1),
49 
50  parent(-1),
51 
52  module(-1),
53  path(-1),
54 
57 
58  visible(false),
59 
60  matches(false),
62 
63  editable(false) , pset(0){}
64 
67 
68  int level;
69  bool tracked;
70  char type;
71  size_t parent;
72 
73  size_t module;
74  size_t path;
75 
78 
79  bool visible;
80  bool matches;
82  bool editable;
83 
85  };
86 
88  virtual ~FWPSetTableManager();
89 
90 
91  virtual int unsortedRowNumber(int unsorted) const ;
92  virtual int numberOfRows() const;
93  virtual int numberOfColumns() const;
94  virtual std::vector<std::string> getTitles() const;
95  virtual const std::string title() const;
96  virtual FWTableCellRendererBase* cellRenderer(int iSortedRowNumber, int iCol) const;
97 
98  int selectedRow() const;
99  int selectedColumn() const;
100  virtual bool rowIsSelected(int row) const;
101 
102  virtual void implSort(int, bool);
103  virtual bool cellDataIsSortable() const { return false ; }
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 
131  };
132 
134  struct PathUpdate
135  {
137  bool passed;
138  size_t choiceMaker;
139  };
140 
141 
142  void setExpanded(int row);
144  void update(std::vector<PathUpdate> &pathUpdates);
145 
146  bool applyEditor();
147  void cancelEditor();
148 
149  std::vector<ModuleInfo> &modules() { return m_modules; }
150  std::vector<PSetData> &entries() { return m_entries; }
151 
152  void setSelection (int row, int column, int mask);
153  //______________________________________________________________________________
154 
155 private:
156 
158  struct PathInfo
159  {
161  size_t entryId;
163  size_t moduleStart;
164  size_t moduleEnd;
165  bool passed;
166  };
167 
168  FWPSetTableManager(const FWPSetTableManager&); // stop default
169  const FWPSetTableManager& operator=(const FWPSetTableManager&); // stop default
170 
171  void recalculateVisibility();
172 
173  template <class T> void createScalarString(PSetData &data, T v);
174  template <typename T> void createVectorString(FWPSetTableManager::PSetData &data, const T &v, bool quotes);
175 
177 
178  void handleEntry(const edm::Entry &entry,const std::string &key);
181  void handlePSet(edm::ParameterSet *psp);
182 
183  std::vector<PSetData> m_entries;
185  std::vector<PathInfo> m_paths;
186  std::vector<ModuleInfo> m_modules;
187  std::map<std::string, size_t> m_pathIndex;
188  std::vector<size_t> m_parentStack;
189  std::vector<int> m_row_to_index;
194  std::vector<std::string> m_availablePaths;
195 
197 };
198 
199 
200 #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 ...
static const TGPicture * info(bool iBackgroundIsBlack)
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
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)
#define column(...)
Definition: DbCore.h:74
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)
volatile std::atomic< bool > shutdown_flag false
long double T
virtual int numberOfColumns() const
Number of columns in the table.
Definition: vlib.h:208
virtual int numberOfRows() const
Number of rows in the table.
std::vector< PSetData > & entries()