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

ColumnarToolArray * mainTool = nullptr
 the main tool that is associated with this object
std::vector< ColumnarToolArray * > 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 329 of file ColumnarToolArray.cxx.

331 {
332 if (name.empty())
333 return std::string{};
334 if (auto iter = columnInternalToUserNames.find (name);
335 iter != columnInternalToUserNames.end())
336 return iter->second;
337 auto split = name.find ('.');
338 if (split == std::string::npos)
339 split = name.size();
340 auto containerName = name.substr (0, split);
341 auto iter = containerInternalToUserNames.find (containerName);
342 if (iter == containerInternalToUserNames.end())
343 return std::string (name);
344 return iter->second + std::string (name.substr (split));
345 }
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 349 of file ColumnarToolArray.cxx.

351 {
352 if (auto iter = columnUserToInternalNames.find (name);
353 iter != columnUserToInternalNames.end())
354 return iter->second;
355 auto split = name.find ('.');
356 if (split == std::string::npos)
357 split = name.size();
358 auto containerName = name.substr (0, split);
359 auto iter = containerUserToInternalNames.find (containerName);
360 if (iter == containerUserToInternalNames.end())
361 return {std::string (name)};
362 std::vector<std::string> result;
363 for (auto& internalContainerName : iter->second)
364 result.push_back (internalContainerName + std::string (name.substr (split)));
365 if (result.empty())
366 result.push_back (std::string (name));
367 return result;
368 }
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

ColumnarToolArray* columnar::ColumnarToolDataArray::mainTool = nullptr

the main tool that is associated with this object

Definition at line 68 of file ColumnarToolDataArray.h.

◆ sharedTools

std::vector<ColumnarToolArray*> 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: