BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
FillListWithSelection.h
Go to the documentation of this file.
1#ifndef DCHAIN_FILLLISTWITHSELECTION_H
2#define DCHAIN_FILLLISTWITHSELECTION_H
3// -*- C++ -*-
4//
5// Package: <DChain>
6// Module: FillListWithSelection
7//
8/**\class FillListWithSelection FillListWithSelection.h DChain/FillListWithSelection.h
9
10 Description: <one line class summary>
11
12 Usage:
13 <usage>
14
15*/
16//
17// Author: Chris D Jones
18// Created: Sat Dec 24 13:10:55 EST 2005
19// $Id: FillListWithSelection.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $
20//
21// Revision history
22//
23// $Log: FillListWithSelection.h,v $
24// Revision 1.1.1.1 2009/03/03 06:06:56 maqm
25// first import of DecayChain
26//
27// Revision 1.1 2006/01/11 20:28:27 cdj
28// massive class renaming, addition of [] for selection and unit tests
29//
30
31// system include files
32
33// user include files
34
35// forward declarations
36
37namespace dchain {
38 template< class CandidateClass>
39 class CombinatoricList;
40
41 template<class TIList, class TSelector,class TOList>
42 void fill_using_selector(const TIList& iList,
43 const TSelector& iSelector,
44 TOList& oList) {
45 oList.fill(iList, iSelector);
46 }
47
48template<class TList, class TSelector>
50{
51 // ---------- friend classes and functions ---------------
52
53 public:
54 // ---------- constants, enums and typedefs --------------
55
56 // ---------- Constructors and destructor ----------------
57 FillListWithSelection(TList& ioList, const TSelector& iSel):
58 m_list(ioList), m_selector(iSel) {}
59 //virtual ~FillListWithSelection();
60
61 // ---------- member functions ---------------------------
62 const TList& operator=(const TList& iList) const {
63 m_list.erase();
64 fill_using_selector(iList, m_selector, m_list);
65 return m_list;
66 }
67
68 template <class TAList>
69 const TList& operator=(const TAList& iList) const {
70 m_list.erase();
71 fill_using_selector(iList, m_selector, m_list);
72 return m_list;
73 }
74
75 template< class TCandidate>
76 const TList& operator=( const CombinatoricList< TCandidate >& aOtherList ) {
77 m_list.erase();
78 fill_using_selector(aOtherList, m_selector, m_list);
79 return m_list;
80 }
81
82 // ---------- const member functions ---------------------
83
84 // ---------- static member functions --------------------
85
86 protected:
87 // ---------- protected member functions -----------------
88
89 // ---------- protected const member functions -----------
90
91 private:
92 // ---------- Constructors and destructor ----------------
93 //FillListWithSelection( const FillListWithSelection& ); // stop default
94
95 // ---------- assignment operator(s) ---------------------
96 //const FillListWithSelection& operator=( const FillListWithSelection& ); // stop default
97
98 // ---------- private member functions -------------------
99
100 // ---------- private const member functions -------------
101
102 // ---------- data members -------------------------------
103 mutable TList& m_list;
104 const TSelector& m_selector;
105
106 // ---------- static data members ------------------------
107
108};
109
110// inline function definitions
111
112// Uncomment the following lines, if your class is templated
113// and has an implementation file (in the Template directory)
114//#if defined(INCLUDE_TEMPLATE_DEFINITIONS)
115//# include "DChain/Template/FillListWithSelection.cc"
116//#endif
117}
118#endif /* DCHAIN_FILLLISTWITHSELECTION_H */
const TList & operator=(const TAList &iList) const
const TList & operator=(const CombinatoricList< TCandidate > &aOtherList)
const TList & operator=(const TList &iList) const
FillListWithSelection(TList &ioList, const TSelector &iSel)
void fill_using_selector(const TIList &iList, const TSelector &iSel, ChargedVisibleList< T, U > &oList)