ATLAS Offline Software
Loading...
Searching...
No Matches
AuxVectorInterface.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/AuxVectorInterface.icc
6 * @author scott snyder <snyder@bnl.gov>
7 * @date Jan, 2024
8 * @brief Make an AuxVectorData object from either a raw vector or an aux store.
9 */
10
11
12namespace SG {
13
14
15/**
16 * @brief Build from a (non-const) auxiliary store.
17 * @param store The auxiliary store to wrap.
18 */
19inline
20AuxVectorInterface::AuxVectorInterface (IAuxStore& store)
21 : m_size (store.size())
22{
23 setStore (&store);
24}
25
26
27/**
28 * @brief Build from a (const) auxiliary store.
29 * @param store The auxiliary store to wrap.
30 */
31inline
32AuxVectorInterface::AuxVectorInterface (const IConstAuxStore& store)
33 : m_size (store.size())
34{
35 setStore (&store);
36}
37
38
39/**
40 * @brief Build from a (non-const) raw array.
41 * @param auxid ID of the represented variable.
42 * @param size Length of the array.
43 * @param ptr Pointer to the array.
44 */
45inline
46AuxVectorInterface::AuxVectorInterface (SG::auxid_t auxid, size_t size, void* ptr)
47 : m_size (size)
48{
49 setCache (auxid, ptr);
50}
51
52
53/**
54 * @brief Build from a (const) raw array.
55 * @param auxid ID of the represented variable.
56 * @param size Length of the array.
57 * @param ptr Pointer to the array.
58 */
59inline
60AuxVectorInterface::AuxVectorInterface (SG::auxid_t auxid, size_t size, const void* ptr)
61 : m_size (size)
62{
63 setCache (auxid, ptr);
64}
65
66
67/**
68 * @brief Return the size of the container.
69 */
70inline
71size_t AuxVectorInterface::size_v() const
72{
73 return m_size;
74}
75
76
77/**
78 * @brief Return the capacity of the container.
79 */
80inline
81size_t AuxVectorInterface::capacity_v() const
82{
83 return m_size;
84}
85
86
87} // namespace SG