Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Public Attributes | List of all members
columnar::PhysliteTestHelpers::ColumnDataOutVector< T > Struct Template Referencefinal
Inheritance diagram for columnar::PhysliteTestHelpers::ColumnDataOutVector< T >:
Collaboration diagram for columnar::PhysliteTestHelpers::ColumnDataOutVector< T >:

Public Member Functions

 ColumnDataOutVector (const std::string &val_columnName, const T &val_defaultValue)
 
virtual bool connect (TTree *, std::unordered_map< std::string, const PhysliteTestHelpers::IColumnData * > &sizeColumns, std::unordered_map< std::string, ColumnInfo > &requestedColumns) override
 
virtual std::size_t getSize () const override
 
virtual void setData (ColumnarToolWrapperData &tool, Long64_t) override
 

Public Attributes

std::string columnName
 
defaultValue
 
const PhysliteTestHelpers::IColumnDatasizeColumn = nullptr
 
std::vector< T > outData
 

Detailed Description

template<typename T>
struct columnar::PhysliteTestHelpers::ColumnDataOutVector< T >

Definition at line 241 of file ColumnarPhysliteTest.cxx.

Constructor & Destructor Documentation

◆ ColumnDataOutVector()

template<typename T >
columnar::PhysliteTestHelpers::ColumnDataOutVector< T >::ColumnDataOutVector ( const std::string &  val_columnName,
const T &  val_defaultValue 
)
inline

Definition at line 248 of file ColumnarPhysliteTest.cxx.

249  : columnName (val_columnName), defaultValue (val_defaultValue) {}

Member Function Documentation

◆ connect()

template<typename T >
virtual bool columnar::PhysliteTestHelpers::ColumnDataOutVector< T >::connect ( TTree *  ,
std::unordered_map< std::string, const PhysliteTestHelpers::IColumnData * > &  sizeColumns,
std::unordered_map< std::string, ColumnInfo > &  requestedColumns 
)
inlineoverridevirtual

Implements columnar::PhysliteTestHelpers::IColumnData.

Definition at line 251 of file ColumnarPhysliteTest.cxx.

252  {
253  auto iter = requestedColumns.find (columnName);
254  if (iter == requestedColumns.end())
255  return false;
256 
257  const auto & offsetName = iter->second.offsetName;
258  if (offsetName.empty())
259  throw std::runtime_error ("missing offset column for: " + columnName);
260 
261  requestedColumns.erase (iter);
262 
263  if (auto sizeIter = sizeColumns.find (offsetName); sizeIter != sizeColumns.end())
264  sizeColumn = sizeIter->second;
265  else
266  throw std::runtime_error ("missing size column for: " + columnName);
267  return true;
268  }

◆ getSize()

template<typename T >
virtual std::size_t columnar::PhysliteTestHelpers::ColumnDataOutVector< T >::getSize ( ) const
inlineoverridevirtual

Implements columnar::PhysliteTestHelpers::IColumnData.

Definition at line 270 of file ColumnarPhysliteTest.cxx.

271  {
272  return outData.size();
273  }

◆ setData()

template<typename T >
virtual void columnar::PhysliteTestHelpers::ColumnDataOutVector< T >::setData ( ColumnarToolWrapperData tool,
Long64_t   
)
inlineoverridevirtual

Implements columnar::PhysliteTestHelpers::IColumnData.

Definition at line 275 of file ColumnarPhysliteTest.cxx.

276  {
277  outData.clear ();
278  outData.resize (sizeColumn->getSize(), defaultValue);
279  tool.setColumn (columnName, outData.size(), outData.data());
280  }

Member Data Documentation

◆ columnName

template<typename T >
std::string columnar::PhysliteTestHelpers::ColumnDataOutVector< T >::columnName

Definition at line 243 of file ColumnarPhysliteTest.cxx.

◆ defaultValue

template<typename T >
T columnar::PhysliteTestHelpers::ColumnDataOutVector< T >::defaultValue

Definition at line 244 of file ColumnarPhysliteTest.cxx.

◆ outData

template<typename T >
std::vector<T> columnar::PhysliteTestHelpers::ColumnDataOutVector< T >::outData

Definition at line 246 of file ColumnarPhysliteTest.cxx.

◆ sizeColumn

Definition at line 245 of file ColumnarPhysliteTest.cxx.


The documentation for this struct was generated from the following file:
columnar::PhysliteTestHelpers::ColumnDataOutVector::outData
std::vector< T > outData
Definition: ColumnarPhysliteTest.cxx:246
columnar::PhysliteTestHelpers::ColumnDataOutVector::sizeColumn
const PhysliteTestHelpers::IColumnData * sizeColumn
Definition: ColumnarPhysliteTest.cxx:245
columnar::PhysliteTestHelpers::ColumnDataOutVector::defaultValue
T defaultValue
Definition: ColumnarPhysliteTest.cxx:244
columnar::PhysliteTestHelpers::IColumnData::getSize
virtual std::size_t getSize() const =0
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
columnar::PhysliteTestHelpers::ColumnDataOutVector::columnName
std::string columnName
Definition: ColumnarPhysliteTest.cxx:243