ATLAS Offline Software
AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandleKey.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 /**
5  * @file AsgDataHandles/ReadHandleKey.icc
6  * @author Nils Krumnack <Nils.Erik.Krumnack@cern.h>
7  * @author scott snyder <snyder@bnl.gov> (for original version)
8  * @brief Property holding a SG store/key/clid from which a ReadHandle is made.
9  */
10 
11 
12 namespace SG {
13 
14 
15 /**
16  * @brief Constructor.
17  * @param key The StoreGate key for the object.
18  * @param storeName Name to use for the store, if it's not encoded in sgkey.
19  *
20  * The provided key may actually start with the name of the store,
21  * separated by a "+": "MyStore+Obj". If no "+" is present
22  * the store named by @c storeName is used.
23  */
24 template <class T>
25 ReadHandleKey<T>::ReadHandleKey (const std::string& key)
26  : VarHandleKey (key)
27  // : VarHandleKey (ClassID_traits<T>::ID(), key,
28  // Gaudi::DataHandle::Reader,
29  // storeName)
30 {
31 }
32 
33 
34 /**
35  * @brief Auto-declaring Property constructor.
36  * @param owner Owning component.
37  * @param name Name of the Property.
38  * @param key Default StoreGate key for the object.
39  * @param doc Documentation string.
40  *
41  * Will associate the named Property with this RHK via declareProperty.
42  *
43  * The provided key may actually start with the name of the store,
44  * separated by a "+": "MyStore+Obj". If no "+" is present
45  * the store named by @c storeName is used.
46  */
47 template <class T>
48 template <class OWNER, class K>
49 inline
50 ReadHandleKey<T>::ReadHandleKey( OWNER* owner,
51  const std::string& name,
52  const K& key /* ={}*/,
53  const std::string& doc /*= ""*/)
54  : ReadHandleKey<T>( key )
55 {
56  owner->declareProperty(name, *this, doc);
57 }
58 
59 
60 /**
61  * @brief Change the key of the object to which we're referring.
62  * @param sgkey The StoreGate key for the object.
63  *
64  * The provided key may actually start with the name of the store,
65  * separated by a "+": "MyStore+Obj". If no "+" is present,
66  * the store is not changed.
67  */
68 template <class T>
69 ReadHandleKey<T>& ReadHandleKey<T>::operator= (const std::string& sgkey)
70 {
71  VarHandleKey::operator= (sgkey);
72  return *this;
73 }
74 
75 
76 } // namespace SG