ATLAS Offline Software
LinkedVarAccessorBase.icc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
3  */
4 /**
5  * @file AthContainers/tools/LinkedVarAccessorBase.icc
6  * @author scott snyder <snyder@bnl.gov>
7  * @date Jun, 2024
8  * @brief Base class usable for accessors for variables with linked variables.
9  */
10 
11 
12 namespace SG { namespace detail {
13 
14 
15 /**
16  * @brief Test to see if this variable exists in the store.
17  * @param e An element of the container in which to test the variable.
18  */
19 template <class ELT>
20 requires( IsConstAuxElement<ELT> )
21 inline
22 bool LinkedVarAccessorBase::isAvailable (const ELT& e) const
23 {
24  return e.container() &&
25  e.container()->isAvailable (m_auxid) &&
26  e.container()->isAvailable (m_linkedAuxid);
27 }
28 
29 
30 /**
31  * @brief Test to see if this variable exists in the store.
32  * @param c The container in which to test the variable.
33  */
34 inline
35 bool LinkedVarAccessorBase::isAvailable (const AuxVectorData& c) const
36 {
37  return c.isAvailable (m_auxid) && c.isAvailable (m_linkedAuxid);
38 }
39 
40 
41 /**
42  * @brief Return the aux id for this variable.
43  */
44 inline
45 auxid_t LinkedVarAccessorBase::auxid() const
46 {
47  return m_auxid;
48 }
49 
50 
51 /**
52  * @brief Return the aux id for the linked DataLink vector.
53  */
54 inline
55 auxid_t LinkedVarAccessorBase::linkedAuxid() const
56 {
57  return m_linkedAuxid;
58 }
59 
60 
61 } } // namespace SG::detail