CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Attributes
Selection< C, Selector, StoreContainer > Class Template Reference

#include <Selection.h>

Classes

class  const_iterator
 

Public Types

typedef const value_typeconst_reference
 
typedef value_typereference
 
typedef C::size_type size_type
 
typedef C::value_type value_type
 

Public Member Functions

const_iterator begin () const
 
bool empty () const
 
const_iterator end () const
 
const_reference operator[] (size_type i)
 
 Selection (const C &c, const Selector &sel)
 
size_type size () const
 

Private Attributes

Selector select_
 
StoreContainer selected_
 

Detailed Description

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
class Selection< C, Selector, StoreContainer >

Definition at line 6 of file Selection.h.

Member Typedef Documentation

◆ const_reference

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
typedef const value_type& Selection< C, Selector, StoreContainer >::const_reference

Definition at line 11 of file Selection.h.

◆ reference

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
typedef value_type& Selection< C, Selector, StoreContainer >::reference

Definition at line 10 of file Selection.h.

◆ size_type

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
typedef C::size_type Selection< C, Selector, StoreContainer >::size_type

Definition at line 9 of file Selection.h.

◆ value_type

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
typedef C::value_type Selection< C, Selector, StoreContainer >::value_type

Definition at line 8 of file Selection.h.

Constructor & Destructor Documentation

◆ Selection()

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
Selection< C, Selector, StoreContainer >::Selection ( const C &  c,
const Selector sel 
)
inline

Definition at line 12 of file Selection.h.

References c, mps_fire::i, Selection< C, Selector, StoreContainer >::select_, and Selection< C, Selector, StoreContainer >::selected_.

12  : select_(sel) {
13  for (typename C::const_iterator i = c.begin(); i != c.end(); ++i) {
14  if (select_(*i))
15  selected_.push_back(&*i);
16  }
17  }
Selector select_
Definition: Selection.h:77
StoreContainer selected_
Definition: Selection.h:78

Member Function Documentation

◆ begin()

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
const_iterator Selection< C, Selector, StoreContainer >::begin ( void  ) const
inline

Definition at line 70 of file Selection.h.

References Selection< C, Selector, StoreContainer >::selected_.

70 { return const_iterator(selected_.begin()); }
StoreContainer selected_
Definition: Selection.h:78

◆ empty()

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
bool Selection< C, Selector, StoreContainer >::empty ( ) const
inline

Definition at line 73 of file Selection.h.

References Selection< C, Selector, StoreContainer >::selected_.

73 { return selected_.empty(); }
StoreContainer selected_
Definition: Selection.h:78

◆ end()

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
const_iterator Selection< C, Selector, StoreContainer >::end ( void  ) const
inline

Definition at line 71 of file Selection.h.

References Selection< C, Selector, StoreContainer >::selected_.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

71 { return const_iterator(selected_.end()); }
StoreContainer selected_
Definition: Selection.h:78

◆ operator[]()

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
const_reference Selection< C, Selector, StoreContainer >::operator[] ( size_type  i)
inline

Definition at line 74 of file Selection.h.

References mps_fire::i, and Selection< C, Selector, StoreContainer >::selected_.

74 { return *selected_[i]; }
StoreContainer selected_
Definition: Selection.h:78

◆ size()

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
size_type Selection< C, Selector, StoreContainer >::size ( void  ) const
inline

Definition at line 72 of file Selection.h.

References Selection< C, Selector, StoreContainer >::selected_.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

72 { return selected_.size(); }
StoreContainer selected_
Definition: Selection.h:78

Member Data Documentation

◆ select_

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
Selector Selection< C, Selector, StoreContainer >::select_
private

Definition at line 77 of file Selection.h.

Referenced by Selection< C, Selector, StoreContainer >::Selection().

◆ selected_

template<typename C, typename Selector, typename StoreContainer = std::vector<const typename C::value_type*>>
StoreContainer Selection< C, Selector, StoreContainer >::selected_
private