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