ATLAS Offline Software
Loading...
Searching...
No Matches
columnar::ColumnarToolDataArray Struct Referencefinal

#include <ColumnarToolDataArray.h>

Collaboration diagram for columnar::ColumnarToolDataArray:

Classes

struct  StringHash

Public Member Functions

std::string convertInternalToUserName (std::string_view name) const
 convert a column name between user and internal names
std::vector< std::string > convertUserToInternalNames (std::string_view name) const

Public Attributes

ColumnarTool< ColumnarModeArray > * mainTool = nullptr
 the main tool that is associated with this object
std::vector< ColumnarTool< ColumnarModeArray > * > sharedTools
 the list of all tools that reference this object
std::unordered_map< std::string, std::string, StringHash, std::equal_to<> > containerInternalToUserNames
 the names associated with all container ids
std::unordered_map< std::string, std::vector< std::string >, StringHash, std::equal_to<> > containerUserToInternalNames
std::unordered_map< std::string, std::string, StringHash, std::equal_to<> > columnInternalToUserNames
 an extra map, for mapping individual column names
std::unordered_map< std::string, std::vector< std::string >, StringHash, std::equal_to<> > columnUserToInternalNames
std::unordered_map< std::string, ColumnDataArraycolumns
 the name-column map

Detailed Description

Definition at line 58 of file ColumnarToolDataArray.h.

Member Function Documentation

◆ convertInternalToUserName()

std::string columnar::ColumnarToolDataArray::convertInternalToUserName ( std::string_view name) const
nodiscard

convert a column name between user and internal names

Definition at line 340 of file ColumnarToolArray.cxx.

342 {
343 if (name.empty())
344 return std::string{};
345 if (auto iter = columnInternalToUserNames.find (name);
346 iter != columnInternalToUserNames.end())
347 return iter->second;
348 auto split = name.find ('.');
349 if (split == std::string::npos)
350 split = name.size();
351 auto containerName = name.substr (0, split);
352 auto iter = containerInternalToUserNames.find (containerName);
353 if (iter == containerInternalToUserNames.end())
354 return std::string (name);
355 return iter->second + std::string (name.substr (split));
356 }
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177
std::unordered_map< std::string, std::string, StringHash, std::equal_to<> > containerInternalToUserNames
the names associated with all container ids
std::unordered_map< std::string, std::string, StringHash, std::equal_to<> > columnInternalToUserNames
an extra map, for mapping individual column names

◆ convertUserToInternalNames()

std::vector< std::string > columnar::ColumnarToolDataArray::convertUserToInternalNames ( std::string_view name) const
nodiscard

Definition at line 360 of file ColumnarToolArray.cxx.

362 {
363 if (auto iter = columnUserToInternalNames.find (name);
364 iter != columnUserToInternalNames.end())
365 return iter->second;
366 auto split = name.find ('.');
367 if (split == std::string::npos)
368 split = name.size();
369 auto containerName = name.substr (0, split);
370 auto iter = containerUserToInternalNames.find (containerName);
371 if (iter == containerUserToInternalNames.end())
372 return {std::string (name)};
373 std::vector<std::string> result;
374 for (auto& internalContainerName : iter->second)
375 result.push_back (internalContainerName + std::string (name.substr (split)));
376 if (result.empty())
377 result.push_back (std::string (name));
378 return result;
379 }
std::unordered_map< std::string, std::vector< std::string >, StringHash, std::equal_to<> > columnUserToInternalNames
std::unordered_map< std::string, std::vector< std::string >, StringHash, std::equal_to<> > containerUserToInternalNames

Member Data Documentation

◆ columnInternalToUserNames

std::unordered_map<std::string,std::string,StringHash,std::equal_to<> > columnar::ColumnarToolDataArray::columnInternalToUserNames

an extra map, for mapping individual column names

Definition at line 78 of file ColumnarToolDataArray.h.

◆ columns

std::unordered_map<std::string,ColumnDataArray> columnar::ColumnarToolDataArray::columns

the name-column map

Definition at line 82 of file ColumnarToolDataArray.h.

◆ columnUserToInternalNames

std::unordered_map<std::string,std::vector<std::string>,StringHash,std::equal_to<> > columnar::ColumnarToolDataArray::columnUserToInternalNames

Definition at line 79 of file ColumnarToolDataArray.h.

◆ containerInternalToUserNames

std::unordered_map<std::string,std::string,StringHash,std::equal_to<> > columnar::ColumnarToolDataArray::containerInternalToUserNames

the names associated with all container ids

Definition at line 74 of file ColumnarToolDataArray.h.

◆ containerUserToInternalNames

std::unordered_map<std::string,std::vector<std::string>,StringHash,std::equal_to<> > columnar::ColumnarToolDataArray::containerUserToInternalNames

Definition at line 75 of file ColumnarToolDataArray.h.

◆ mainTool

ColumnarTool<ColumnarModeArray>* columnar::ColumnarToolDataArray::mainTool = nullptr

the main tool that is associated with this object

Definition at line 68 of file ColumnarToolDataArray.h.

◆ sharedTools

std::vector<ColumnarTool<ColumnarModeArray>*> columnar::ColumnarToolDataArray::sharedTools

the list of all tools that reference this object

Definition at line 71 of file ColumnarToolDataArray.h.


The documentation for this struct was generated from the following files: