/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/BesDChain/BesDChain-00-00-14/BesDChain/Template/CDMud.cc

Go to the documentation of this file.
00001 #ifndef CLEODCHAIN_CDMUD_CC
00002 #define CLEODCHAIN_CDMUD_CC
00003 // -*- C++ -*-
00004 //
00005 // Package:     CleoDChain
00006 // Module:      CDMud
00007 // 
00008 // Description: Manage the footprints for a given Evidence Class
00009 //
00010 // Usage:
00011 //    <usage>
00012 //
00013 // Author:      Simon Patton
00014 // Created:     Mon Apr 20 20:47:30 PDT 1998
00015 // $Id: CDMud.cc,v 1.1.1.1 2009/03/03 06:05:56 maqm Exp $
00016 //
00017 // Revision history
00018 //
00019 // $Log: CDMud.cc,v $
00020 // Revision 1.1.1.1  2009/03/03 06:05:56  maqm
00021 // first import of BesDChain
00022 //
00023 // Revision 1.1  2001/04/11 13:19:36  urner
00024 // transition to files with CD prefix. Addition of new files
00025 //
00026 // Revision 1.2  2000/12/19 15:11:34  cdj
00027 // removed report statement
00028 //
00029 // Revision 1.1.1.1  2000/12/18 22:17:27  cdj
00030 // imported CleoDChain
00031 //
00032 // Revision 1.4  1998/05/01 20:25:22  sjp
00033 // Put in correct include file path
00034 //
00035 // Revision 1.3  1998/05/01 20:21:59  sjp
00036 // Added line to handle g++ bug
00037 //
00038 // Revision 1.2  1998/04/22 01:24:02  sjp
00039 // Corrected logic that expands list of CDFootPrints.
00040 //
00041 // Revision 1.1  1998/04/21 05:17:22  sjp
00042 // New File
00043 //
00044 
00045 // system include files
00046 #include <vector>
00047 
00048 using std::vector;
00049 
00050 // user include files
00051 #include "BesDChain/CDFootPrint.h"
00052 #include "BesDChain/CDMud.h"
00053 
00054 //
00055 // constants, enums and typedefs
00056 //
00057 
00058 template < class Evidence >
00059 const CDFootPrint& CDMud< Evidence >::get( const Evidence* aEvidence )
00060 {
00061    unsigned int id( aEvidence->trackId() ) ;
00062    vector< const CDFootPrint* >& prints( footprints() ) ;
00063    while ( id >= prints.size() ) {
00064       CDFootPrint* tmp( new CDFootPrint ) ;
00065       (*tmp).fresh() ;
00066       prints.push_back( tmp ) ;
00067    }
00068    return ( *(prints[ id ]) ) ;
00069 }
00070 
00071 template < class Evidence >
00072 void CDMud< Evidence >::clear()
00073 {
00074    vector< const CDFootPrint* >& prints( footprints() ) ;
00075    vector< const CDFootPrint* >::const_iterator finished( prints.end() ) ;
00076    for ( vector< const CDFootPrint* >::const_iterator print( prints.begin() ) ;
00077          finished != print ;
00078          ++print ) {
00079 
00080       // cast way const for delete to work
00081       delete ( (CDFootPrint*)(*print) ) ;
00082    }
00083    prints.erase( prints.begin() ,
00084                  prints.end() ) ;
00085 }
00086 
00087 template< class Evidence >
00088 vector< const CDFootPrint* >&
00089 CDMud< Evidence >::footprints()
00090 {
00091    static vector< const CDFootPrint* > prints ;
00092    return ( prints ) ;
00093 }
00094 
00095 //
00096 // constructors and destructor
00097 //
00098 
00099 //
00100 // assignment operators
00101 //
00102 
00103 //
00104 // member functions
00105 //
00106 
00107 //
00108 // const member functions
00109 //
00110 
00111 
00112 #endif /* CLEODCHAIN_CDMUD_CC */

Generated on Tue Nov 29 22:58:19 2016 for BOSS_7.0.2 by  doxygen 1.4.7