CMS 3D CMS Logo

List of all members | Public Member Functions | Static Private Member Functions | Private Attributes
nanoaod::FlatTable::RowView Class Reference

#include <FlatTable.h>

Public Member Functions

double getAnyValue (unsigned int column) const
 
double getAnyValue (const std::string &column) const
 
unsigned int row () const
 
 RowView ()
 
 RowView (const FlatTable &table, unsigned int row)
 
const FlatTabletable () const
 

Static Private Member Functions

static void throwUnknownColumn (const std::string &column) noexcept(false)
 

Private Attributes

unsigned int row_
 
const FlatTabletable_
 

Detailed Description

Definition at line 97 of file FlatTable.h.

Constructor & Destructor Documentation

◆ RowView() [1/2]

nanoaod::FlatTable::RowView::RowView ( )
inline

Definition at line 99 of file FlatTable.h.

99 {}

◆ RowView() [2/2]

nanoaod::FlatTable::RowView::RowView ( const FlatTable table,
unsigned int  row 
)
inline

Definition at line 100 of file FlatTable.h.

100 : table_(&table), row_(row) {}
const FlatTable & table() const
Definition: FlatTable.h:108
const FlatTable * table_
Definition: FlatTable.h:113
unsigned int row() const
Definition: FlatTable.h:109

Member Function Documentation

◆ getAnyValue() [1/2]

double nanoaod::FlatTable::RowView::getAnyValue ( unsigned int  column) const
inline

Definition at line 101 of file FlatTable.h.

References nanoaod::FlatTable::getAnyValue(), row_, and table_.

101 { return table_->getAnyValue(row_, column); }
const FlatTable * table_
Definition: FlatTable.h:113
double getAnyValue(unsigned int row, unsigned int column) const
Definition: FlatTable.cc:46

◆ getAnyValue() [2/2]

double nanoaod::FlatTable::RowView::getAnyValue ( const std::string &  column) const
inline

Definition at line 102 of file FlatTable.h.

References nanoaod::FlatTable::columnIndex(), nanoaod::FlatTable::getAnyValue(), row_, table_, and throwUnknownColumn().

102  {
103  auto index = table_->columnIndex(column);
104  if (index == -1)
105  throwUnknownColumn(column);
106  return table_->getAnyValue(row_, index);
107  }
static void throwUnknownColumn(const std::string &column) noexcept(false)
Definition: FlatTable.cc:70
const FlatTable * table_
Definition: FlatTable.h:113
int columnIndex(const std::string &name) const
Definition: FlatTable.cc:3
double getAnyValue(unsigned int row, unsigned int column) const
Definition: FlatTable.cc:46

◆ row()

unsigned int nanoaod::FlatTable::RowView::row ( ) const
inline

Definition at line 109 of file FlatTable.h.

References row_.

109 { return row_; }

◆ table()

const FlatTable& nanoaod::FlatTable::RowView::table ( ) const
inline

Definition at line 108 of file FlatTable.h.

References table_.

108 { return *table_; }
const FlatTable * table_
Definition: FlatTable.h:113

◆ throwUnknownColumn()

void nanoaod::FlatTable::RowView::throwUnknownColumn ( const std::string &  column)
staticprivatenoexcept

Definition at line 70 of file FlatTable.cc.

References Exception.

Referenced by getAnyValue().

70  {
71  throw cms::Exception("LogicError") << "Invalid column name '" << column << "'";
72 }

Member Data Documentation

◆ row_

unsigned int nanoaod::FlatTable::RowView::row_
private

Definition at line 114 of file FlatTable.h.

Referenced by getAnyValue(), and row().

◆ table_

const FlatTable* nanoaod::FlatTable::RowView::table_
private

Definition at line 113 of file FlatTable.h.

Referenced by getAnyValue(), and table().