CMS 3D CMS Logo

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 #include <sigc++/sigc++.h>
27 
28 class FWPSetCellEditor;
29 namespace edm {
30  class ScheduleInfo;
31 }
32 
34  friend class FWPathsPopup;
35 
36 public:
38  struct PSetData {
40  : level(-1),
41  tracked(false),
42 
43  type(-1),
44 
45  parent(-1),
46 
47  module(-1),
48  path(-1),
49 
52 
53  visible(false),
54 
55  matches(false),
57 
58  editable(false),
59  pset(nullptr) {}
60 
63 
64  int level;
65  bool tracked;
66  char type;
67  size_t parent;
68 
69  size_t module;
70  size_t path;
71 
74 
75  bool visible;
76  bool matches;
78  bool editable;
79 
81  };
82 
84  ~FWPSetTableManager() override;
85  FWPSetTableManager(const FWPSetTableManager &) = delete; // stop default
86  const FWPSetTableManager &operator=(const FWPSetTableManager &) = delete; // stop default
87 
88  int unsortedRowNumber(int unsorted) const override;
89  int numberOfRows() const override;
90  int numberOfColumns() const override;
91  std::vector<std::string> getTitles() const override;
92  virtual const std::string title() const;
93  FWTableCellRendererBase *cellRenderer(int iSortedRowNumber, int iCol) const override;
94 
95  int selectedRow() const;
96  int selectedColumn() const;
97  virtual bool rowIsSelected(int row) const;
98 
99  void implSort(int, bool) override;
100  bool cellDataIsSortable() const override { return false; }
101 
102  virtual void updateFilter(const char *filter);
103 
104  std::vector<unsigned int> maxWidthForColumns() const override;
105 
106  std::vector<PSetData> &data() { return m_entries; }
107  std::vector<int> &rowToIndex() { return m_row_to_index; }
108 
109  //______________________________________________________________________________
110 
111 protected:
112  struct ModuleInfo {
116  size_t pathIndex;
117  size_t path;
118  size_t entry;
119  bool passed;
123  bool dirty;
124 
127  };
128 
130  struct PathUpdate {
132  bool passed;
133  size_t choiceMaker;
134  };
135 
136  void setExpanded(int row);
138  void update(std::vector<PathUpdate> &pathUpdates);
139 
140  bool applyEditor();
141  void cancelEditor();
142 
143  std::vector<ModuleInfo> &modules() { return m_modules; }
144  std::vector<PSetData> &entries() { return m_entries; }
145 
146  void setSelection(int row, int column, int mask);
147  //______________________________________________________________________________
148 
149 private:
151  struct PathInfo {
153  size_t entryId;
155  size_t moduleStart;
156  size_t moduleEnd;
157  bool passed;
158  };
159 
160  void recalculateVisibility();
161 
162  template <class T>
164  template <typename T>
165  void createVectorString(FWPSetTableManager::PSetData &data, const T &v, bool quotes);
166 
167  void setCellValueEditor(FWPSetCellEditor *editor);
168 
169  void handleEntry(const edm::Entry &entry, const std::string &key);
172  void handlePSet(edm::ParameterSet *psp);
173 
174  std::vector<PSetData> m_entries;
176  std::vector<PathInfo> m_paths;
177  std::vector<ModuleInfo> m_modules;
178  std::map<std::string, size_t> m_pathIndex;
179  std::vector<size_t> m_parentStack;
180  std::vector<int> m_row_to_index;
185  std::vector<std::string> m_availablePaths;
186 
188 };
189 
190 #endif
std::vector< ModuleInfo > & modules()
int unsortedRowNumber(int unsorted) const override
when passed the index to the sorted order of the rows it returns the original row number from the und...
std::vector< std::string > m_availablePaths
static const TGPicture * info(bool iBackgroundIsBlack)
std::vector< PathInfo > m_paths
~FWPSetTableManager() override
virtual bool rowIsSelected(int row) const
FWTextTreeCellRenderer m_renderer
std::vector< size_t > m_parentStack
std::vector< unsigned int > maxWidthForColumns() const override
for each column in the table this returns the present maximum width for that column ...
std::vector< int > & rowToIndex()
void implSort(int, bool) override
Called by &#39;sort&#39; method to actually handle the sorting of the rows. Arguments are the same as &#39;sort&#39;...
virtual const std::string title() const
void handlePSetEntry(edm::ParameterSetEntry &entry, const std::string &key)
void createVectorString(FWPSetTableManager::PSetData &data, const T &v, bool quotes)
int numberOfColumns() const override
Number of columns in the table.
std::vector< ModuleInfo > m_modules
constexpr uint32_t mask
Definition: gpuClustering.h:26
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
bool cellDataIsSortable() const override
void handleEntry(const edm::Entry &entry, const std::string &key)
const FWPSetTableManager & operator=(const FWPSetTableManager &)=delete
void handlePSet(edm::ParameterSet *psp)
FWPSetCellEditor * m_editor
std::vector< std::string > getTitles() const override
returns the title names for each column
void updateSchedule(const edm::ScheduleInfo *info)
void createScalarString(PSetData &data, T v)
virtual void updateFilter(const char *filter)
void setCellValueEditor(FWPSetCellEditor *editor)
FWTableCellRendererBase * cellRenderer(int iSortedRowNumber, int iCol) const override
HLT enums.
int numberOfRows() const override
Number of rows in the table.
void update(std::vector< PathUpdate > &pathUpdates)
void setSelection(int row, int column, int mask)
long double T
std::vector< PSetData > & entries()