CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DataKey.h
Go to the documentation of this file.
1 #ifndef Framework_DataKey_h
2 #define Framework_DataKey_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Class : DataKey
7 //
16 //
17 // Author: Chris Jones
18 // Created: Thu Mar 31 14:31:03 EST 2005
19 //
20 
21 // system include files
22 
23 // user include files
26 
27 // forward declarations
28 namespace edm {
29  namespace eventsetup {
30 class DataKey
31 {
32 
33  friend void swap(DataKey&, DataKey&);
34  public:
36 
37  DataKey();
38  DataKey(const TypeTag& iType,
39  const IdTags& iId) :
40  type_(iType),
41  name_(iId),
42  ownMemory_() {
44  }
45 
46  DataKey(const TypeTag& iType,
47  const IdTags& iId,
49  type_(iType),
50  name_(iId),
51  ownMemory_(false) {}
52 
53  DataKey(const DataKey& iRHS) :
54  type_(iRHS.type_),
55  name_(iRHS.name_),
56  ownMemory_() {
58  }
59 
60  DataKey& operator=(const DataKey&); // stop default
61 
63 
64  // ---------- const member functions ---------------------
65  const TypeTag& type() const { return type_; }
66  const NameTag& name() const { return name_; }
67 
68  bool operator==(const DataKey& iRHS) const;
69  bool operator<(const DataKey& iRHS) const;
70 
71  // ---------- static member functions --------------------
72  template<class T>
73  static TypeTag makeTypeTag() {
74  return heterocontainer::HCTypeTag::make<T>();
75  }
76 
77  // ---------- member functions ---------------------------
78 
79  private:
80  void makeCopyOfMemory();
81  void releaseMemory() {
82  if(ownMemory_) {
83  deleteMemory();
84  ownMemory_ = false;
85  }
86  }
87  void deleteMemory();
88  void swap(DataKey&);
89 
90  // ---------- member data --------------------------------
93  bool ownMemory_;
94 };
95 
96  // Free swap function
97  inline
98  void
100  {
101  a.swap(b);
102  }
103  }
104 }
105 #endif
DataKey(const TypeTag &iType, const IdTags &iId, DoNotCopyMemory)
Definition: DataKey.h:46
static TypeTag makeTypeTag()
Definition: DataKey.h:73
DataKey(const DataKey &iRHS)
Definition: DataKey.h:53
DataKey(const TypeTag &iType, const IdTags &iId)
Definition: DataKey.h:38
bool operator<(const DataKey &iRHS) const
Definition: DataKey.cc:134
void swap(DataKey &a, DataKey &b)
Definition: DataKey.h:99
DataKey & operator=(const DataKey &)
Definition: DataKey.cc:52
bool operator==(const DataKey &iRHS) const
Definition: DataKey.cc:127
friend void swap(DataKey &, DataKey &)
Definition: DataKey.h:99
double b
Definition: hdecay.h:120
const TypeTag & type() const
Definition: DataKey.h:65
double a
Definition: hdecay.h:121
const NameTag & name() const
Definition: DataKey.h:66
volatile std::atomic< bool > shutdown_flag false