ATLAS Offline Software
Loading...
Searching...
No Matches
ColumnarToolArray.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/// @author Nils Krumnack
6
7
8#include <AsgMessaging/StatusCode.h>
9#include <ColumnarCore/ContainerId.h>
10#include <ColumnarCore/ObjectRange.h>
11#include <ColumnarInterfaces/ColumnInfo.h>
12#include <ColumnarInterfaces/IColumnarTool.h>
13#include <memory>
14
15namespace columnar
16{
17 struct ColumnAccessorDataArray;
18 struct ColumnarToolDataArray;
19
20 template<> class ColumnarTool<ColumnarModeArray> : public IColumnarTool
21 {
22 /// Common Public Members
23 /// =====================
24 public:
25
26 static constexpr bool singleEvent = false;
27
28 ColumnarTool ();
29 explicit ColumnarTool (ColumnarTool<ColumnarModeArray>* val_parent);
30 ColumnarTool (const ColumnarTool<ColumnarModeArray>&) = delete;
31 ColumnarTool& operator = (const ColumnarTool<ColumnarModeArray>&) = delete;
32 virtual ~ColumnarTool ();
33
34
35 /// @brief initialize the columns/column handles
36 ///
37 /// This should be called at the end of initialize after all data handles
38 /// have been declared.
39 StatusCode initializeColumns ();
40
41
42 /// @brief add the given sub-tool
43 void addSubtool (ColumnarTool<ColumnarModeArray>& subtool);
44
45
46 /// @brief call the tool for the given event range
47 virtual void callEvents (ObjectRange<ContainerId::eventContext,ColumnarModeArray> events) const;
48
49
50
51 /// Inherited Members from IColumnarTool
52 /// ====================================
53 public:
54
55 void callVoid (void **data) const final;
56 std::vector<ColumnInfo> getColumnInfo () const final;
57 void renameColumn (const std::string& from, const std::string& to) final;
58 void setColumnIndex (const std::string& name, std::size_t index) final;
59
60
61
62 /// Internal/Detail Members
63 /// =======================
64 ///
65 /// These are technically public members, but are not intended for
66 /// the user to call, and are only public because they need to be
67 /// for other parts of the prototype to call.
68 public:
69
70 void setContainerUserName (std::string_view ciName, const std::string& name);
71
72 void addColumn (const std::string& name, ColumnAccessorDataArray *accessorData, ColumnInfo&& info);
73
74
75
76 /// Mode-Specific Public Members
77 /// ============================
78 public:
79
80
81
82 /// Private Members
83 /// ===============
84 private:
85
86 // most of our data is stored in a pimpl structure
87 std::shared_ptr<ColumnarToolDataArray> m_data;
88
89 // we may have to access the event offset column, so hard-coding
90 // that here
91 unsigned m_eventsIndex = 0u;
92 std::unique_ptr<ColumnAccessorDataArray> m_eventsData;
93 };
94}