ATLAS Offline Software
ColumnarToolDataArray.h
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 
8 #ifndef COLUMNAR_CORE_COLUMNAR_TOOL_DATA_ARRAY_H
9 #define COLUMNAR_CORE_COLUMNAR_TOOL_DATA_ARRAY_H
10 
13 
14 namespace columnar
15 {
17  {
19  ColumnDataArray () noexcept = default;
20 
23 
24  ColumnDataArray operator= (ColumnDataArray&& other) noexcept = delete;
25 
27  ~ColumnDataArray () noexcept;
28 
30  bool empty () const noexcept;
31 
33  const ColumnInfo& info () const noexcept;
34 
36  void addAccessor (const std::string& name, const ColumnInfo& val_info, ColumnAccessorDataArray* val_accessorData);
37 
39  void removeAccessor (ColumnAccessorDataArray& val_accessorData);
40 
42  void mergeData (const std::string& name, ColumnDataArray&& other);
43 
45  void setIndex (unsigned val_index) noexcept;
46 
47  private:
48 
51 
54  };
55 
56 
57 
59  {
60  struct StringHash {
61  using is_transparent = void; // enables heterogeneous lookup
62  size_t operator()(std::string_view sv) const noexcept {
63  return std::hash<std::string_view>{}(sv);
64  }
65  };
66 
68  ColumnarTool<ColumnarModeArray>* mainTool = nullptr;
69 
71  std::vector<ColumnarTool<ColumnarModeArray>*> sharedTools;
72 
74  std::unordered_map<std::string,std::string,StringHash,std::equal_to<>> containerInternalToUserNames;
75  std::unordered_map<std::string,std::vector<std::string>,StringHash,std::equal_to<>> containerUserToInternalNames;
76 
78  std::unordered_map<std::string,std::string,StringHash,std::equal_to<>> columnInternalToUserNames;
79  std::unordered_map<std::string,std::vector<std::string>,StringHash,std::equal_to<>> columnUserToInternalNames;
80 
82  std::unordered_map<std::string,ColumnDataArray> columns;
83 
84 
86  [[nodiscard]] std::string convertInternalToUserName (std::string_view name) const;
87  [[nodiscard]] std::vector<std::string> convertUserToInternalNames (std::string_view name) const;
88  };
89 }
90 
91 #endif
columnar::ColumnDataArray::removeAccessor
void removeAccessor(ColumnAccessorDataArray &val_accessorData)
remove an accessor data object
Definition: ColumnarToolArray.cxx:306
columnar::ColumnDataArray
Definition: ColumnarToolDataArray.h:17
columnar::ColumnarToolDataArray::StringHash
Definition: ColumnarToolDataArray.h:60
columnar::ColumnarToolDataArray::StringHash::operator()
size_t operator()(std::string_view sv) const noexcept
Definition: ColumnarToolDataArray.h:62
columnar::ColumnDataArray::info
const ColumnInfo & info() const noexcept
get the column info
Definition: ColumnarToolArray.cxx:264
columnar::ColumnarToolDataArray::StringHash::is_transparent
void is_transparent
Definition: ColumnarToolDataArray.h:61
columnar::ColumnarToolDataArray::containerInternalToUserNames
std::unordered_map< std::string, std::string, StringHash, std::equal_to<> > containerInternalToUserNames
the names associated with all container ids
Definition: ColumnarToolDataArray.h:74
columnar::ColumnDataArray::empty
bool empty() const noexcept
whether this column has no associated accessors
Definition: ColumnarToolArray.cxx:256
columnar::ColumnDataArray::ColumnDataArray
ColumnDataArray() noexcept=default
standard constructor
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
columnar::ColumnDataArray::mergeData
void mergeData(const std::string &name, ColumnDataArray &&other)
merge the data from another column
Definition: ColumnarToolArray.cxx:318
columnar::ColumnarToolDataArray
Definition: ColumnarToolDataArray.h:59
columnar::ColumnDataArray::setIndex
void setIndex(unsigned val_index) noexcept
set the index for this column
Definition: ColumnarToolArray.cxx:331
columnar::ColumnDataArray::addAccessor
void addAccessor(const std::string &name, const ColumnInfo &val_info, ColumnAccessorDataArray *val_accessorData)
add an info to the column
Definition: ColumnarToolArray.cxx:272
columnar::ColumnInfo
a struct that contains meta-information about each column that's needed to interface the column with ...
Definition: ColumnInfo.h:35
vector
Definition: MultiHisto.h:13
columnar::ColumnarToolDataArray::columnUserToInternalNames
std::unordered_map< std::string, std::vector< std::string >, StringHash, std::equal_to<> > columnUserToInternalNames
Definition: ColumnarToolDataArray.h:79
columnar::ColumnarToolDataArray::columnInternalToUserNames
std::unordered_map< std::string, std::string, StringHash, std::equal_to<> > columnInternalToUserNames
an extra map, for mapping individual column names
Definition: ColumnarToolDataArray.h:78
ColumnarTool.h
columnar::final
CM final
Definition: ColumnAccessor.h:106
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
columnar::ColumnarToolDataArray::containerUserToInternalNames
std::unordered_map< std::string, std::vector< std::string >, StringHash, std::equal_to<> > containerUserToInternalNames
Definition: ColumnarToolDataArray.h:75
calibdata.delete
list delete
Definition: calibdata.py:45
python.CaloAddPedShiftConfig.default
default
Definition: CaloAddPedShiftConfig.py:43
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
columnar
Definition: ClusterDef.h:16
columnar::ColumnDataArray::m_info
ColumnInfo m_info
the column info
Definition: ColumnarToolDataArray.h:50
columnar::ColumnarToolDataArray::sharedTools
std::vector< ColumnarTool< ColumnarModeArray > * > sharedTools
the list of all tools that reference this object
Definition: ColumnarToolDataArray.h:71
columnar::ColumnarTool
the base class for all columnar components
Definition: ColumnAccessorDataArray.h:17
LArCellConditions.sv
bool sv
Definition: LArCellConditions.py:45
columnar::ColumnDataArray::m_accessors
std::vector< ColumnAccessorDataArray * > m_accessors
the data on all accessors for this column
Definition: ColumnarToolDataArray.h:53
columnar::ColumnAccessorDataArray
all the data about a column accessor that the ColumnarTool needs to know about
Definition: ColumnAccessorDataArray.h:23
private
#define private
Definition: xAODTruthCnvAlg.h:20
columnar::ColumnarToolDataArray::columns
std::unordered_map< std::string, ColumnDataArray > columns
the name-column map
Definition: ColumnarToolDataArray.h:82
ColumnInfo.h