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, ColumnDataArray, StringHash, std::equal_to<> > columns
 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 343 of file ColumnarToolArray.cxx.

345 {
346 if (name.empty())
347 return std::string{};
348 if (auto iter = columnInternalToUserNames.find (name);
349 iter != columnInternalToUserNames.end())
350 return iter->second;
351 auto split = name.find ('.');
352 if (split == std::string::npos)
353 split = name.size();
354 auto containerName = name.substr (0, split);
355 auto iter = containerInternalToUserNames.find (containerName);
356 if (iter == containerInternalToUserNames.end())
357 return std::string (name);
358 return iter->second + std::string (name.substr (split));
359 }
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 363 of file ColumnarToolArray.cxx.

365 {
366 if (auto iter = columnUserToInternalNames.find (name);
367 iter != columnUserToInternalNames.end())
368 return iter->second;
369 auto split = name.find ('.');
370 if (split == std::string::npos)
371 split = name.size();
372 auto containerName = name.substr (0, split);
373 std::vector<std::string> result;
374 if (auto iter = containerUserToInternalNames.find (containerName);
375 iter != containerUserToInternalNames.end())
376 {
377 for (auto& internalContainerName : iter->second)
378 {
379 std::string subname = internalContainerName + std::string (name.substr (split));
380 if (!columnInternalToUserNames.contains (subname) && columns.contains (subname))
381 result.push_back (std::move (subname));
382 }
383 }
384 if (!containerInternalToUserNames.contains (containerName) && !columnInternalToUserNames.contains (name) && columns.contains (name))
385 result.push_back (std::string (name));
386 return result;
387 }
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
std::unordered_map< std::string, ColumnDataArray, StringHash, std::equal_to<> > columns
the name-column map

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,StringHash,std::equal_to<> > 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: