00001 #ifndef DCHAIN_CANDIDATELIST_H 00002 #define DCHAIN_CANDIDATELIST_H 00003 // -*- C++ -*- 00004 // 00005 // Package: DChain 00006 // Module: CandidateList 00007 // 00008 // Description: container of subclasses of Candidate, used for iteration 00009 // 00010 // Usage: 00011 // <usage> 00012 // 00013 // Author: Simon Patton 00014 // Created: Wed Sep 11 15:59:57 EDT 1996 00015 // $Id: CandidateList.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $ 00016 // 00017 // Revision history 00018 // 00019 // $Log: CandidateList.h,v $ 00020 // Revision 1.1.1.1 2009/03/03 06:06:56 maqm 00021 // first import of DecayChain 00022 // 00023 // Revision 1.1 2006/01/11 20:28:20 cdj 00024 // massive class renaming, addition of [] for selection and unit tests 00025 // 00026 // Revision 1.1.1.1 2000/12/18 22:16:51 cdj 00027 // imported DChain 00028 // 00029 // Revision 1.10 1998/08/21 00:52:43 sjp 00030 // Modifier to no longer use typedefs 00031 // 00032 // Revision 1.9 1998/08/20 19:59:06 sjp 00033 // Modified to use DChainBoolean 00034 // 00035 // Revision 1.8 1998/04/17 19:11:06 sjp 00036 // Modified to use latest types 00037 // 00038 // Revision 1.7 1997/08/28 06:59:57 sjp 00039 // Modified files to handle complete templating 00040 // 00041 // Revision 1.6 1997/08/26 04:14:17 sjp 00042 // Made Candidate handling objects into `CandidateClass' Templates 00043 // 00044 // Revision 1.5 1997/08/15 21:32:07 sjp 00045 // Updated to use <package>/<file>.h include structure. 00046 // Updated to use bug flags specified in Experiement.h 00047 // 00048 // Revision 1.4 1997/01/22 16:27:08 sjp 00049 // Fixed error in pre-processor labels 00050 // 00051 // Revision 1.3 1997/01/21 20:33:36 sjp 00052 // Changed CPP flags and include because of library reorganization 00053 // 00054 // Revision 1.2 1997/01/19 20:28:34 sjp 00055 // Changed LargeCount to Count 00056 // 00057 // Revision 1.1 1996/11/04 19:35:46 sjp 00058 // New file for new `List' module 00059 // 00060 00061 // system include files 00062 00063 // user include files 00064 00065 // forward declarations 00066 namespace dchain { 00067 00068 template < class CandidateClass > class MuteWholeCandidateItr ; 00069 template < class CandidateClass > class WholeCandidateItr ; 00070 template < class CandidateClass > class PartialCandidateItr ; 00071 template < class CandidateClass > class LabeledCandidate ; 00072 template < class CandidateClass > class LabeledCandidateList ; 00073 00074 00075 template < class CandidateClass > 00076 class CandidateList 00077 { 00078 // friend classses and functions 00079 00080 public: 00081 // constants, enums and typedefs 00082 typedef dchain::MuteWholeCandidateItr< CandidateClass > iterator ; 00083 typedef dchain::WholeCandidateItr< CandidateClass > const_iterator ; 00084 typedef dchain::PartialCandidateItr< CandidateClass > const_partial_iterator ; 00085 00086 typedef dchain::LabeledCandidate<CandidateClass> value_type; 00087 // Constructors and destructor 00088 CandidateList() ; 00089 virtual ~CandidateList() ; 00090 00091 // member functions 00092 virtual iterator begin() ; 00093 virtual iterator end() ; 00094 00095 // const member functions 00096 virtual bool empty() const ; 00097 virtual int size() const ; 00098 virtual const_iterator begin() const ; 00099 virtual const_iterator end() const ; 00100 00101 template < class TAnalyzer > 00102 void iterate( const TAnalyzer& analyze ) const { 00103 const_iterator finished ( end() ); 00104 for ( const_iterator entry ( begin() ) ; 00105 entry != finished ; 00106 ++entry ) { 00107 analyze( (*entry)() ) ; 00108 } 00109 } 00110 00111 // static member functions 00112 00113 protected: 00114 // protected member functions 00115 virtual dchain::LabeledCandidateList< CandidateClass >& labeledCandidateList() = 0 ; 00116 00117 // protected const member functions 00118 virtual const dchain::LabeledCandidateList< CandidateClass >& labeledCandidateList() const = 0 ; 00119 00120 private: 00121 // Constructors and destructor 00122 CandidateList( const CandidateList< CandidateClass >& ) ; // stop default 00123 00124 // assignment operator(s) 00125 const CandidateList& operator=( const CandidateList< CandidateClass >& ) ; // stop default 00126 00127 // private member functions 00128 00129 // private const member functions 00130 00131 // data members 00132 00133 // static data members 00134 00135 }; 00136 } 00137 // inline function definitions 00138 00139 // function definitions 00140 #include "DecayChain/List/Template/CandidateList.cc" 00141 00142 #endif /* DCHAIN_CANDIDATELIST_H */