Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
StringColumn.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_STRING_COLUMN_H
9 #define COLUMNAR_CORE_STRING_COLUMN_H
10 
12 
13 namespace columnar
14 {
15  // in xAOD mode we can do a straightforward conversion from
16  // std::string to std::string_view, as xAODs natively use std::string
17  template<>
19  {
22  using UserType = std::string_view;
23  static constexpr bool isNativeType = false;
24  static constexpr bool useConvertInput = true;
25  static constexpr bool useConvertWithDataInput = false;
26  static ColumnInfo& updateColumnInfo (ColumnarTool<CM>& /*columnarTool*/, ColumnInfo& info) {return info;}
27  static std::string_view convertInput (const std::string& value) {return std::string_view (value);}
28  };
29 
30 
31 
32  // in external mode we can do a straightforward conversion from
33  // std::vector<char> to std::string_view, as uproot natively
34  // represents it as a vector of char
35  template<>
37  {
39  using ColumnType = std::vector<char>;
40  using UserType = std::string_view;
41  static constexpr bool isNativeType = false;
42  static constexpr bool useConvertInput = true;
43  static constexpr bool useConvertWithDataInput = false;
44  static ColumnInfo& updateColumnInfo (ColumnarTool<CM>& /*columnarTool*/, ColumnInfo& info) {return info;}
45  static std::string_view convertInput (std::span<const char> value) {return std::string_view (value.begin(), value.end());}
46  };
47 }
48 
49 #endif
grepfile.info
info
Definition: grepfile.py:38
columnar::ColumnTypeTraits< std::string, ColumnarModeArray >::updateColumnInfo
static ColumnInfo & updateColumnInfo(ColumnarTool< CM > &, ColumnInfo &info)
Definition: StringColumn.h:44
columnar::ColumnTypeTraits::useConvertWithDataInput
static constexpr bool useConvertWithDataInput
Definition: ColumnAccessor.h:99
columnar::ColumnTypeTraits::useConvertInput
static constexpr bool useConvertInput
Definition: ColumnAccessor.h:98
columnar::ColumnTypeTraits< std::string, ColumnarModeArray >::UserType
std::string_view UserType
Definition: StringColumn.h:40
athena.value
value
Definition: athena.py:124
columnar::ColumnTypeTraits< std::string, ColumnarModeArray >::ColumnType
std::vector< char > ColumnType
Definition: StringColumn.h:39
columnar::ColumnInfo
a struct that contains meta-information about each column that's needed to interface the column with ...
Definition: ColumnInfo.h:35
columnar::ColumnTypeTraits< std::string, ColumnarModeArray >::convertInput
static std::string_view convertInput(std::span< const char > value)
Definition: StringColumn.h:45
VectorColumn.h
columnar::ColumnTypeTraits::isNativeType
static constexpr bool isNativeType
Definition: ColumnAccessor.h:97
columnar::final
CM final
Definition: ColumnAccessor.h:106
columnar::ColumnTypeTraits< std::string, ColumnarModeXAOD >::UserType
std::string_view UserType
Definition: StringColumn.h:22
columnar::NativeColumn
a type wrapper to force AccessorTemplate to treat the type as native
Definition: ColumnAccessor.h:120
columnar::ColumnarModeArray
Definition: ColumnarDef.h:30
columnar::ColumnTypeTraits
a trait class to provide information about the column type
Definition: ColumnAccessor.h:96
columnar
Definition: ClusterDef.h:16
columnar::ColumnarTool
the base class for all columnar components
Definition: ColumnAccessorDataArray.h:17
columnar::ColumnarModeXAOD
Definition: ColumnarDef.h:15
columnar::ColumnTypeTraits< std::string, ColumnarModeXAOD >::convertInput
static std::string_view convertInput(const std::string &value)
Definition: StringColumn.h:27
columnar::ColumnTypeTraits< std::string, ColumnarModeXAOD >::updateColumnInfo
static ColumnInfo & updateColumnInfo(ColumnarTool< CM > &, ColumnInfo &info)
Definition: StringColumn.h:26