CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ShmOutputModuleRegistry.cc
Go to the documentation of this file.
3 
4 #include <iostream>
5 
6 namespace evf{
7 
9  }
10 
12  {
13  clm_.insert(std::pair<std::string, OutputModule*>(name,op));
14  }
15 
16 
18  {
19  OutputModule* retval = 0;
20  idct it= clm_.find(name);
21  if(it!=clm_.end())
22  retval = (it->second);
23  return retval;
24  }
26  idct it= clm_.begin();
27  while(it!=clm_.end()){
28  std::cout << "name " << it->first << "add "
29  << (unsigned long)(it->second) << std::endl;
30  it++;
31  }
32  }
33  std::vector<edm::FUShmOutputModule *> ShmOutputModuleRegistry::getShmOutputModules()
34  {
35  std::vector<edm::FUShmOutputModule *> outputs;
36  idct it= clm_.begin();
37  while(it!=clm_.end()){
38  edm::FUShmOutputModule * sho = dynamic_cast<edm::FUShmOutputModule *> ((*it).second);
39  if (sho!=NULL) {
40  outputs.push_back(sho);
41  }
42  it++;
43  }
44  return outputs;
45  }
47  {
48  clm_.clear();
50  listOfDatasets_.clear();
51  }
52 
54  {
56  listOfDatasets_.clear();
57  std::vector<edm::FUShmOutputModule *> outputs = getShmOutputModules();
58  for (unsigned int i=0;i<outputs.size();i++) {
59  edm::FUShmOutputModule * output = outputs[i];
60  if (output->getStreamId().size()) {
61  std::vector<std::string> datasets = output->getDatasetNames();
62  listOfDatasets_.insert(listOfDatasets_.end(),datasets.begin(),datasets.end());
63  if (datasets.size())
64  shmOutputsWithDatasets_.push_back(output);
65  }
66  }
67  }
69  {
70  std::string datasetNameString;
71  for (unsigned int i=0;i<listOfDatasets_.size();i++) {
72  if (i)
73  datasetNameString+=",";
74  datasetNameString+=listOfDatasets_[i];
75  }
76  return datasetNameString;
77  }
78 
80  {
81  idct it= clm_.begin();
82  while(it!=clm_.end()){
83  edm::FUShmOutputModule * sho = dynamic_cast<edm::FUShmOutputModule *> ((*it).second);
84  if (sho!=NULL) {
85  sho->insertStreamAndDatasetInfo(streams,datasets);
86  }
87  it++;
88  }
89  }
90 
91 } //end namespace evf
int i
Definition: DBlmapReader.cc:9
void registerModule(std::string &name, OutputModule *op)
std::vector< std::string > listOfDatasets_
ShmOutputModuleRegistry(const edm::ParameterSet &)
#define NULL
Definition: scimark2.h:8
std::vector< std::string > getDatasetNames()
void insertStreamAndDatasetInfo(edm::ParameterSet &streams, edm::ParameterSet datasets)
void insertStreamAndDatasetInfo(edm::ParameterSet &streams, edm::ParameterSet &datasets)
std::vector< edm::FUShmOutputModule * > shmOutputsWithDatasets_
std::vector< edm::FUShmOutputModule * > getShmOutputModules()
OutputModule * get(std::string &name)
tuple cout
Definition: gather_cfg.py:121