CMS 3D CMS Logo

DDName.h
Go to the documentation of this file.
1 #ifndef DETECTOR_DESCRIPTION_CORE_DDNAME_H
2 #define DETECTOR_DESCRIPTION_CORE_DDNAME_H
3 
4 #include <iosfwd>
5 #include <string>
6 #include <utility>
7 
9 #include <tbb/concurrent_vector.h>
10 #include <tbb/concurrent_unordered_map.h>
11 
12 class DDCurrentNamespace;
13 
15 
17 class DDName {
18 public:
19  using id_type = int;
20  using key_type = std::pair<const std::string, std::string>;
21  using Registry = tbb::concurrent_unordered_map<key_type, id_type, edm::StdPairHasher>;
22  using IdToName = tbb::concurrent_vector<Registry::const_iterator>;
23 
25  DDName(const std::string& name, const std::string& ns);
26 
28  DDName(const std::string& name);
29  DDName(const char* name);
30  DDName(const char* name, const char* ns);
31 
32  explicit DDName();
33 
35  const std::string& name() const;
36 
38  const std::string& ns() const;
39 
43  const std::string fullname() const { return ns() + ":" + name(); }
44 
45  id_type id() const { return id_; }
46 
47  bool operator<(const DDName& rhs) const { return id_ < rhs.id_; }
48  bool operator==(const DDName& rhs) const { return id_ == rhs.id_; }
49 
50 private:
52 
53  static Registry::const_iterator registerName(const std::pair<std::string, std::string>& s);
54 };
55 
56 std::ostream& operator<<(std::ostream& os, const DDName& n);
57 
58 #endif
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
DDCurrentNamespace
Definition: DDCurrentNamespace.h:6
DDName::id
id_type id() const
Definition: DDName.h:45
operator<<
std::ostream & operator<<(std::ostream &os, const DDName &n)
Definition: DDName.cc:11
DDName::operator<
bool operator<(const DDName &rhs) const
Definition: DDName.h:47
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DDName::id_type
int id_type
Definition: DDName.h:19
DDName::DDName
DDName()
Definition: DDName.cc:39
DDName::id_
id_type id_
Definition: DDName.h:51
DDName::key_type
std::pair< const std::string, std::string > key_type
Definition: DDName.h:20
DDName::operator==
bool operator==(const DDName &rhs) const
Definition: DDName.h:48
createfilelist.int
int
Definition: createfilelist.py:10
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
DDName::registerName
static Registry::const_iterator registerName(const std::pair< std::string, std::string > &s)
Definition: DDName.cc:67
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
StdPairHasher.h
DDName::ns
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:52
DDName::Registry
tbb::concurrent_unordered_map< key_type, id_type, edm::StdPairHasher > Registry
Definition: DDName.h:21
DDName::fullname
const std::string fullname() const
Definition: DDName.h:43
DDName::IdToName
tbb::concurrent_vector< Registry::const_iterator > IdToName
Definition: DDName.h:22