CGEM BOSS 6.6.5.i
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.2.1 2014/04/18 00:56:43 maqm Exp $
20//
21// Revision history
22//
23// $Log: FillListWithSelection.h,v $
24// Revision 1.1.1.1.2.1 2014/04/18 00:56:43 maqm
25// remove mutable for TList ref.
26//
27// Revision 1.1.1.1 2009/03/03 06:06:56 maqm
28// first import of DecayChain
29//
30// Revision 1.1 2006/01/11 20:28:27 cdj
31// massive class renaming, addition of [] for selection and unit tests
32//
33
34// system include files
35
36// user include files
37
38// forward declarations
39
40namespace dchain {
41 template< class CandidateClass>
43
44 template<class TIList, class TSelector,class TOList>
45 void fill_using_selector(const TIList& iList,
46 const TSelector& iSelector,
47 TOList& oList) {
48 oList.fill(iList, iSelector);
49 }
50
51template<class TList, class TSelector>
53{
54 // ---------- friend classes and functions ---------------
55
56 public:
57 // ---------- constants, enums and typedefs --------------
58
59 // ---------- Constructors and destructor ----------------
60 FillListWithSelection(TList& ioList, const TSelector& iSel):
61 m_list(ioList), m_selector(iSel) {}
62 //virtual ~FillListWithSelection();
63
64 // ---------- member functions ---------------------------
65 const TList& operator=(const TList& iList) const {
66 m_list.erase();
67 fill_using_selector(iList, m_selector, m_list);
68 return m_list;
69 }
70
71 template <class TAList>
72 const TList& operator=(const TAList& iList) const {
73 m_list.erase();
74 fill_using_selector(iList, m_selector, m_list);
75 return m_list;
76 }
77
78 template< class TCandidate>
79 const TList& operator=( const CombinatoricList< TCandidate >& aOtherList ) {
80 m_list.erase();
81 fill_using_selector(aOtherList, m_selector, m_list);
82 return m_list;
83 }
84
85 // ---------- const member functions ---------------------
86
87 // ---------- static member functions --------------------
88
89 protected:
90 // ---------- protected member functions -----------------
91
92 // ---------- protected const member functions -----------
93
94 private:
95 // ---------- Constructors and destructor ----------------
96 //FillListWithSelection( const FillListWithSelection& ); // stop default
97
98 // ---------- assignment operator(s) ---------------------
99 //const FillListWithSelection& operator=( const FillListWithSelection& ); // stop default
100
101 // ---------- private member functions -------------------
102
103 // ---------- private const member functions -------------
104
105 // ---------- data members -------------------------------
106 TList& m_list;
107 const TSelector& m_selector;
108
109 // ---------- static data members ------------------------
110
111};
112
113// inline function definitions
114
115// Uncomment the following lines, if your class is templated
116// and has an implementation file (in the Template directory)
117//#if defined(INCLUDE_TEMPLATE_DEFINITIONS)
118//# include "DChain/Template/FillListWithSelection.cc"
119//#endif
120}
121#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)