npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::Column Class Reference

#include <Column.hh>

Public Member Functions

 Column (const unsigned long i)
 
 Column (const char *name)
 
 Column (const std::string &name)
 
template<typename T >
bool isValid (const AbsNtuple< T > &ntuple) const
 
template<typename T >
unsigned long operator() (const AbsNtuple< T > &ntuple) const
 

Detailed Description

This class serves just one purpose: it allows to address ntuple columns by either name or number in the same function call. Do not create stand-alone objects of this class in your application code and do not include this header directly (it will be included automatically when you include AbsNtuple.hh). Objects of this class are not meant to be reused, and doing so can lead to subtle bugs.

Constructor & Destructor Documentation

◆ Column() [1/3]

npstat::Column::Column ( const unsigned long  i)
inline

Constructor from unsigned integer

◆ Column() [2/3]

npstat::Column::Column ( const char *  name)
inline

Constructor from c-string

◆ Column() [3/3]

npstat::Column::Column ( const std::string &  name)
inline

Constructor from std::string

Member Function Documentation

◆ isValid()

template<typename T >
bool npstat::Column::isValid ( const AbsNtuple< T > &  ntuple) const

Can't call "isValid" after operator(): this will result in a run-time error

◆ operator()()

template<typename T >
unsigned long npstat::Column::operator() ( const AbsNtuple< T > &  ntuple) const

This will return the column number in the given ntuple or will throw an exception if the column specification is invalid


The documentation for this class was generated from the following file: