ATLAS Offline Software
StoreGate/StoreGate/VarHandleBase.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 /**
5  * @file StoreGate/VarHandleBase.icc
6  * @author scott snyder <snyder@bnl.gov>
7  * @date Feb, 2016
8  * @brief Property holding a SG store/key/clid from which a WriteHandle is made.
9  */
10 
11 
12 namespace SG {
13 
14 
15 /**
16  * @brief Retrieve an object from StoreGate.
17  * @param quiet If true, suppress failure messages.
18  *
19  * Inline method: first check cached pointer, then call the _impl method.
20  */
21 inline
22 void* VarHandleBase::typeless_dataPointer(bool quiet/*=defaultQuiet*/)
23 {
24  if (m_ptr) { return m_ptr; }
25  return typeless_dataPointer_impl(quiet);
26 }
27 
28 
29 /**
30  * @brief Retrieve an object from StoreGate as a const pointer.
31  *
32  * Same as typeless_dataPointer with the return value converted to const.
33  */
34 inline
35 const void* VarHandleBase::typeless_cptr()
36 {
37  return typeless_dataPointer();
38 }
39 
40 
41 /**
42  * @brief Return the class ID for the referenced object.
43  */
44 inline
45 CLID VarHandleBase::clid() const
46 {
47  return m_key->clid();
48 }
49 
50 
51 /**
52  * @brief Return handle to the referenced store.
53  */
54 inline
55 const ServiceHandle<IProxyDict>& VarHandleBase::storeHandle() const
56 {
57  return m_key->storeHandle();
58 }
59 
60 
61 /**
62  * @brief Return the mode (read/write/update) for this handle.
63  */
64 inline
65 Gaudi::DataHandle::Mode VarHandleBase::mode() const
66 {
67  return m_key->mode();
68 }
69 
70 
71 /**
72  * @brief Return the key string of the underlying @c DataObjID.
73  *
74  * Compared to @c key(), this will be prefixed with the store name.
75  */
76 inline
77 const std::string& VarHandleBase::objKey() const
78 {
79  return m_key->objKey();
80 }
81 
82 
83 /**
84  * @brief Return the key as a @c DataObjID.
85  */
86 inline
87 const DataObjID& VarHandleBase::fullKey() const
88 {
89  return m_key->fullKey();
90 }
91 
92 
93 } // namespace SG