ATLAS Offline Software
Loading...
Searching...
No Matches
ColumnAccessorDataArray.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
10
12
14
15
18
19namespace columnar
20{
21 ColumnAccessorDataArray ::
22 ~ColumnAccessorDataArray () noexcept
23 {
24 if (dataRef)
25 dataRef->removeAccessor (*this);
26 }
27
28
29
30 void moveAccessor (unsigned& dataIndex, std::unique_ptr<ColumnAccessorDataArray>& accessorData, unsigned& sourceIndex, std::unique_ptr<ColumnAccessorDataArray>& sourceData)
31 {
32 if (accessorData != nullptr)
33 throw std::runtime_error ("trying to set a columnar accessor that has already been set, overwriting not yet supported");
34
35 dataIndex = sourceIndex;
36 sourceIndex = 0;
37
38 if (sourceData)
39 {
40 if (sourceData->selfPtr != &sourceData)
41 throw std::logic_error ("selfPtr not set correctly");
42
43 accessorData = std::move (sourceData);
44 accessorData->selfPtr = &accessorData;
45 accessorData->dataIndexPtr = &dataIndex;
46 }
47 }
48}
void moveAccessor(unsigned &dataIndex, std::unique_ptr< ColumnAccessorDataArray > &accessorData, unsigned &sourceIndex, std::unique_ptr< ColumnAccessorDataArray > &sourceData)
ColumnDataArray * dataRef
the ColumnDataArray object that holds us