00001 #ifndef DCHAIN_SELECTIONFUNCTION_H 00002 #define DCHAIN_SELECTIONFUNCTION_H 00003 // -*- C++ -*- 00004 // 00005 // Package: DChain 00006 // Module: SelectionFunction 00007 // 00008 // Description: Base class for selection functional objects 00009 // 00010 // Usage: 00011 // <usage> 00012 // 00013 // Author: Simon Patton 00014 // Created: Wed Sep 18 15:46:35 EDT 1996 00015 // $Id: DCSelectionFunction.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $ 00016 // 00017 // Revision history 00018 // 00019 // $Log: DCSelectionFunction.h,v $ 00020 // Revision 1.1.1.1 2009/03/03 06:06:56 maqm 00021 // first import of DecayChain 00022 // 00023 // Revision 1.3 2006/01/11 20:28:13 cdj 00024 // massive class renaming, addition of [] for selection and unit tests 00025 // 00026 // Revision 1.2 2003/10/01 23:45:18 cdj 00027 // added compound selection function 00028 // 00029 // Revision 1.1.1.1 2000/12/18 22:16:49 cdj 00030 // imported DChain 00031 // 00032 // Revision 1.7 1998/08/27 04:55:17 sjp 00033 // added include of defn when required 00034 // 00035 // Revision 1.6 1998/08/20 19:57:29 sjp 00036 // Modified to use DChainBoolean 00037 // 00038 // Revision 1.5 1998/04/17 19:12:10 sjp 00039 // Modified to use latest type 00040 // 00041 // Revision 1.4 1997/08/15 21:31:54 sjp 00042 // Updated to use <package>/<file>.h include structure. 00043 // Updated to use bug flags specified in Experiement.h 00044 // 00045 // Revision 1.3 1997/01/21 20:31:22 sjp 00046 // Changed CPP flags and include because of library reorganization 00047 // 00048 // Revision 1.2 1996/12/20 21:08:15 sjp 00049 // Modified to support FILENAME_ONLY 00050 // 00051 // Revision 1.1 1996/11/04 16:49:42 sjp 00052 // New function for use in conjunction with new `Lists' 00053 // 00054 00055 // system include files 00056 #include <functional> 00057 00058 // user include files 00059 00060 // forward declarations 00061 00062 template < class Arg > 00063 class DCSelectionFunction : public std::unary_function<Arg&, bool> 00064 { 00065 // friend classses and functions 00066 00067 public: 00068 // constants, enums and typedefs 00069 00070 // Constructors and destructor 00071 DCSelectionFunction() {} 00072 virtual ~DCSelectionFunction() {} 00073 00074 // member functions 00075 virtual bool operator()( Arg& ) =0; 00076 00077 // const member functions 00078 bool operator()(Arg& iArg) const { 00079 return const_cast<DCSelectionFunction<Arg> *>(this)->operator()(iArg); 00080 } 00081 00082 // static member functions 00083 00084 protected: 00085 // protected member functions 00086 00087 // protected const member functions 00088 00089 private: 00090 // Constructors and destructor 00091 //DCSelectionFunction( const DCSelectionFunction< Arg >& ) ; // stop default 00092 00093 // assignment operator(s) 00094 //const DCSelectionFunction& operator=( const DCSelectionFunction< Arg >& ) ; // stop default 00095 00096 // private member functions 00097 00098 // private const member functions 00099 00100 // data members 00101 00102 // static data members 00103 00104 }; 00105 00106 // inline function definitions 00107 00108 #endif /* DCHAIN_SELECTIONFUNCTION_H */