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 <boost/bind.hpp>
17 
18 // user include files
19 
28 
29 
32 {
35  this, _1, _2);
38 }
39 
41 {
42 }
43 
44 class FWViewBase*
45 FWTriggerTableViewManager::buildView(TEveWindowSlot* iParent, const std::string& type)
46 {
47  std::shared_ptr<FWTriggerTableView> view;
48 
50  view.reset( new FWHLTTriggerTableView(iParent));
51  else
52  view.reset( new FWL1TriggerTableView(iParent));
53 
54  view->setProcessList(&(context().metadataManager()->processNamesInJob()));
55 
56  view->setBackgroundColor(colorManager().background());
57  m_views.push_back(std::shared_ptr<FWTriggerTableView> (view));
58  view->beingDestroyed_.connect(boost::bind(&FWTriggerTableViewManager::beingDestroyed,
59  this,_1));
60  return view.get();
61 }
62 
63 void
65 {
66  for(std::vector<std::shared_ptr<FWTriggerTableView> >::iterator it=
67  m_views.begin(), itEnd = m_views.end();
68  it != itEnd;
69  ++it) {
70  if(it->get() == iView) {
71  m_views.erase(it);
72  return;
73  }
74  }
75 }
76 
77 void
79 {
80  for(std::vector<std::shared_ptr<FWTriggerTableView> >::iterator it=
81  m_views.begin(), itEnd = m_views.end();
82  it != itEnd;
83  ++it) {
84  (*it)->setBackgroundColor(colorManager().background());
85  }
86 }
87 
88 void
90 {
91  for(std::vector<std::shared_ptr<FWTriggerTableView> >::iterator it=
92  m_views.begin(), itEnd = m_views.end();
93  it != itEnd;
94  ++it) {
95  (*it)->dataChanged();
96  }
97 }
98 
99 void
101 {
102  // printf("FWTriggerTableViewManager::updateProcessLi\n");
103  for(std::vector<std::shared_ptr<FWTriggerTableView> >::iterator it=
104  m_views.begin(), itEnd = m_views.end();
105  it != itEnd;
106  ++it) {
107 
108  (*it)->setProcessList(&(context().metadataManager()->processNamesInJob()));
109  (*it)->resetCombo();
110  }
111 }
112 
std::vector< std::shared_ptr< FWTriggerTableView > > m_views
type
Definition: HCALResponse.h:21
const fireworks::Context & context() const
void beingDestroyed(const FWViewBase *)
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)
FWColorManager & colorManager() const
boost::function2< FWViewBase *, TEveWindowSlot *, const std::string & > ViewBuildFunctor
Definition: FWGUIManager.h:98
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
static std::string sName[kTypeSize]
Definition: FWViewType.h:62
double f[11][100]
static const std::string & idToName(int)
Definition: FWViewType.cc:89