CMS 3D CMS Logo

FWTriggerTableViewManager.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWTriggerTableViewManager
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author:
10 // Created: Sun Jan 6 22:01:27 EST 2008
11 //
12 
13 // system include files
14 #include <cassert>
15 #include <iostream>
16 #include <functional>
17 
18 // user include files
19 
28 
31  f = std::bind(&FWTriggerTableViewManager::buildView, this, std::placeholders::_1, std::placeholders::_2);
34 }
35 
37 
38 class FWViewBase* FWTriggerTableViewManager::buildView(TEveWindowSlot* iParent, const std::string& type) {
39  std::shared_ptr<FWTriggerTableView> view;
40 
42  view.reset(new FWHLTTriggerTableView(iParent));
43  else
44  view.reset(new FWL1TriggerTableView(iParent));
45 
46  view->setProcessList(&(context().metadataManager()->processNamesInJob()));
47 
48  view->setBackgroundColor(colorManager().background());
49  m_views.push_back(std::shared_ptr<FWTriggerTableView>(view));
50  view->beingDestroyed_.connect(std::bind(&FWTriggerTableViewManager::beingDestroyed, this, std::placeholders::_1));
51  return view.get();
52 }
53 
55  for (std::vector<std::shared_ptr<FWTriggerTableView> >::iterator it = m_views.begin(), itEnd = m_views.end();
56  it != itEnd;
57  ++it) {
58  if (it->get() == iView) {
59  m_views.erase(it);
60  return;
61  }
62  }
63 }
64 
66  for (std::vector<std::shared_ptr<FWTriggerTableView> >::iterator it = m_views.begin(), itEnd = m_views.end();
67  it != itEnd;
68  ++it) {
69  (*it)->setBackgroundColor(colorManager().background());
70  }
71 }
72 
74  for (std::vector<std::shared_ptr<FWTriggerTableView> >::iterator it = m_views.begin(), itEnd = m_views.end();
75  it != itEnd;
76  ++it) {
77  (*it)->dataChanged();
78  }
79 }
80 
82  // printf("FWTriggerTableViewManager::updateProcessLi\n");
83  for (std::vector<std::shared_ptr<FWTriggerTableView> >::iterator it = m_views.begin(), itEnd = m_views.end();
84  it != itEnd;
85  ++it) {
86  (*it)->setProcessList(&(context().metadataManager()->processNamesInJob()));
87  (*it)->resetCombo();
88  }
89 }
std::vector< std::shared_ptr< FWTriggerTableView > > m_views
void beingDestroyed(const FWViewBase *)
FWColorManager & colorManager() const
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
static std::string sName[kTypeSize]
Definition: FWViewType.h:61
double f[11][100]
std::function< FWViewBase *(TEveWindowSlot *, const std::string &)> ViewBuildFunctor
Definition: FWGUIManager.h:98
static const std::string & idToName(int)
Definition: FWViewType.cc:72
const fireworks::Context & context() const