CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
MonitorElementData::Path Struct Reference

#include <MonitorElementCollection.h>

Public Types

enum  Type { Type::DIR, Type::DIR_AND_NAME }
 

Public Member Functions

std::string const & getDirname () const
 
std::string const & getObjectname () const
 
bool operator== (Path const &other) const
 
void set (std::string path, Path::Type type)
 

Private Attributes

std::string dirname_
 
std::string objname_
 

Detailed Description

Definition at line 93 of file MonitorElementCollection.h.

Member Enumeration Documentation

Enumerator
DIR 
DIR_AND_NAME 

Definition at line 100 of file MonitorElementCollection.h.

100 { DIR, DIR_AND_NAME };

Member Function Documentation

std::string const& MonitorElementData::Path::getDirname ( ) const
inline

Definition at line 102 of file MonitorElementCollection.h.

102 { return dirname_; }
std::string const& MonitorElementData::Path::getObjectname ( ) const
inline

Definition at line 103 of file MonitorElementCollection.h.

103 { return objname_; }
bool MonitorElementData::Path::operator== ( Path const &  other) const
inline

Definition at line 146 of file MonitorElementCollection.h.

References dirname_, and objname_.

146  {
147  return this->dirname_ == other.dirname_ && this->objname_ == other.objname_;
148  }
void MonitorElementData::Path::set ( std::string  path,
Path::Type  type 
)
inline

Definition at line 111 of file MonitorElementCollection.h.

References DeadROC_duringRun::dir, DIR, DIR_AND_NAME, mps_fire::i, recoMuon::in, visualization-live-secondInstance_cfg::m, and AlCaHLTBitMon_QueryRunRegistry::string.

111  {
113  std::vector<std::string> buf;
114  std::regex dir("^/*([^/]+)");
115  std::smatch m;
116 
117  while (std::regex_search(in, m, dir)) {
118  if (m[1] == "..") {
119  if (!buf.empty()) {
120  buf.pop_back();
121  }
122  } else {
123  buf.push_back(m[1]);
124  }
125  in = m.suffix().str();
126  }
127 
128  // Construct dirname_ and object_name
129  dirname_ = "";
130  objname_ = "";
131  int numberOfItems = buf.size();
132  for (int i = 0; i < numberOfItems; i++) {
133  if (i == numberOfItems - 1) {
134  // Processing last component...
136  objname_ = buf[i];
137  } else if (type == Path::Type::DIR) {
138  dirname_ += buf[i] + "/";
139  }
140  } else {
141  dirname_ += buf[i] + "/";
142  }
143  }
144  }
type
Definition: HCALResponse.h:21

Member Data Documentation

std::string MonitorElementData::Path::dirname_
private

Definition at line 96 of file MonitorElementCollection.h.

Referenced by operator==().

std::string MonitorElementData::Path::objname_
private

Definition at line 97 of file MonitorElementCollection.h.

Referenced by operator==().