00001 #ifndef CLEODCHAIN_CDMUD_CC
00002 #define CLEODCHAIN_CDMUD_CC
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #include <vector>
00047
00048 using std::vector;
00049
00050
00051 #include "BesDChain/CDFootPrint.h"
00052 #include "BesDChain/CDMud.h"
00053
00054
00055
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
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
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 #endif