ATLAS Offline Software
Loading...
Searching...
No Matches
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
13namespace 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
the base class for all columnar components
STL class.
STL namespace.
a struct that contains meta-information about each column that's needed to interface the column with ...
Definition ColumnInfo.h:35
static ColumnInfo & updateColumnInfo(ColumnarTool< CM > &, ColumnInfo &info)
static std::string_view convertInput(std::span< const char > value)
static ColumnInfo & updateColumnInfo(ColumnarTool< CM > &, ColumnInfo &info)
static std::string_view convertInput(const std::string &value)
a trait class to provide information about the column type
a type wrapper to force AccessorTemplate to treat the type as native