2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5 /// @author Nils Krumnack
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>
17 struct ColumnAccessorDataArray;
18 struct ColumnarToolDataArray;
20 template<> class ColumnarTool<ColumnarModeArray> : public IColumnarTool
22 /// Common Public Members
23 /// =====================
26 static constexpr bool singleEvent = false;
29 explicit ColumnarTool (ColumnarTool<ColumnarModeArray>* val_parent);
30 ColumnarTool (const ColumnarTool<ColumnarModeArray>&) = delete;
31 ColumnarTool& operator = (const ColumnarTool<ColumnarModeArray>&) = delete;
32 virtual ~ColumnarTool ();
35 /// @brief initialize the columns/column handles
37 /// This should be called at the end of initialize after all data handles
38 /// have been declared.
39 StatusCode initializeColumns ();
42 /// @brief add the given sub-tool
43 void addSubtool (ColumnarTool<ColumnarModeArray>& subtool);
46 /// @brief call the tool for the given event range
47 virtual void callEvents (ObjectRange<ContainerId::eventContext,ColumnarModeArray> events) const;
51 /// Inherited Members from IColumnarTool
52 /// ====================================
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;
62 /// Internal/Detail Members
63 /// =======================
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.
70 void setContainerName (ContainerId container, const std::string& name);
72 void addColumn (const std::string& name, ColumnAccessorDataArray *accessorData, ColumnInfo&& info);
76 /// Mode-Specific Public Members
77 /// ============================
80 const std::string& objectName (ContainerId objectType) const;
88 // most of our data is stored in a pimpl structure
89 std::shared_ptr<ColumnarToolDataArray> m_data;
91 // we may have to access the event offset column, so hard-coding
93 unsigned m_eventsIndex = 0u;
94 std::unique_ptr<ColumnAccessorDataArray> m_eventsData;