Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "GaudiKernel/IInterface.h"
00008 #include "GaudiKernel/IProperty.h"
00009 #include "GaudiKernel/IAlgorithm.h"
00010 #include "GaudiKernel/IAlgTool.h"
00011 #include "GaudiKernel/SmartIF.h"
00012
00013
00014
00015 #include "GaudiAlg/GaudiAlgorithm.h"
00016 #include "GaudiAlg/GaudiTool.h"
00017
00018
00019
00020 #include "GaudiPython/AlgDecorators.h"
00021
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 IAlgTool* GaudiPython::AlgDecorator::tool_
00038 ( const GaudiAlgorithm* alg ,
00039 const std::string& type ,
00040 const std::string& name ,
00041 const IInterface* parent ,
00042 const bool create )
00043 {
00044 if ( 0 == alg ) { return 0 ; }
00045 return alg -> tool<IAlgTool> ( type , name , parent , create ) ;
00046 }
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 IAlgTool* GaudiPython::AlgDecorator::tool_
00057 ( const GaudiAlgorithm* alg ,
00058 const std::string& typeAndName ,
00059 const IInterface* parent ,
00060 const bool create )
00061 {
00062 if ( 0 == alg ) { return 0 ; }
00063 return alg->tool<IAlgTool>( typeAndName , parent , create ) ;
00064 }
00065
00066
00067
00068
00069
00070
00071
00072
00073 IInterface* GaudiPython::AlgDecorator::svc_
00074 ( const GaudiAlgorithm* alg ,
00075 const std::string& name ,
00076 const bool create )
00077 {
00078 if ( 0 == alg ) { return 0 ; }
00079 return alg -> svc<IInterface> ( name , create ) ;
00080 }
00081
00082
00083
00084 size_t GaudiPython::AlgDecorator::_counters_a_
00085 ( const GaudiAlgorithm* alg ,
00086 std::vector<std::string>& names ,
00087 GaudiPython::AlgDecorator::Counters& out )
00088 {
00089 typedef std::map<std::string,StatEntity> Stats ;
00090 names.clear () ;
00091 out.clear () ;
00092 if ( 0 == alg ) { return 0 ; }
00093
00094 const Stats& counters = alg->counters() ;
00095 for ( Stats::const_iterator icnt = counters.begin() ;
00096 counters.end() != icnt ; ++icnt )
00097 {
00098 names.push_back ( icnt->first ) ;
00099 out .push_back ( &(icnt->second) ) ;
00100 }
00101 return out.size() ;
00102 }
00103
00104
00105
00106 size_t GaudiPython::AlgDecorator::_counters_t_
00107 ( const GaudiTool* alg ,
00108 std::vector<std::string>& names ,
00109 GaudiPython::AlgDecorator::Counters& out )
00110 {
00111 typedef std::map<std::string,StatEntity> Stats ;
00112 names.clear () ;
00113 out.clear () ;
00114 if ( 0 == alg ) { return 0 ; }
00115
00116 const Stats& counters = alg->counters() ;
00117 for ( Stats::const_iterator icnt = counters.begin() ;
00118 counters.end() != icnt ; ++icnt )
00119 {
00120 names.push_back ( icnt->first ) ;
00121 out .push_back ( &(icnt->second) ) ;
00122 }
00123 return out.size() ;
00124 }
00125
00126
00127
00128 size_t GaudiPython::AlgDecorator::_counters_a_
00129 ( const IAlgorithm* alg ,
00130 std::vector<std::string>& names ,
00131 GaudiPython::AlgDecorator::Counters& out )
00132 {
00133 names.clear () ;
00134 out.clear () ;
00135 if ( 0 == alg ) { return 0 ; }
00136
00137 return _counters_a_ ( dynamic_cast<const GaudiAlgorithm*>( alg ) , names , out ) ;
00138 }
00139
00140
00141
00142 size_t GaudiPython::AlgDecorator::_counters_t_
00143 ( const IAlgTool* alg ,
00144 std::vector<std::string>& names ,
00145 GaudiPython::AlgDecorator::Counters& out )
00146 {
00147 names.clear () ;
00148 out.clear () ;
00149 if ( 0 == alg ) { return 0 ; }
00150
00151 return _counters_t_ ( dynamic_cast<const GaudiTool*>( alg ) , names , out ) ;
00152 }
00153
00154
00155
00156 const StatEntity* GaudiPython::AlgDecorator::_counter_a_
00157 ( const GaudiAlgorithm* cmp , const std::string& name )
00158 {
00159 if ( 0 == cmp ) { return 0 ; }
00160 return &( cmp -> counter ( name ) ) ;
00161 }
00162
00163
00164
00165 const StatEntity* GaudiPython::AlgDecorator::_counter_t_
00166 ( const GaudiTool* cmp , const std::string& name )
00167 {
00168 if ( 0 == cmp ) { return 0 ; }
00169 return &( cmp -> counter ( name ) ) ;
00170 }
00171
00172
00173
00174 const StatEntity* GaudiPython::AlgDecorator::_counter_a_
00175 ( const IAlgorithm* cmp , const std::string& name )
00176 {
00177 if ( 0 == cmp ) { return 0 ; }
00178 return _counter_a_ ( dynamic_cast<const GaudiAlgorithm*>( cmp ) , name ) ;
00179 }
00180
00181
00182
00183 const StatEntity* GaudiPython::AlgDecorator::_counter_t_
00184 ( const IAlgTool* cmp , const std::string& name )
00185 {
00186 if ( 0 == cmp ) { return 0 ; }
00187 return _counter_t_ ( dynamic_cast<const GaudiTool*>( cmp ) , name ) ;
00188 }
00189
00190
00191
00192 size_t GaudiPython::AlgDecorator::_tools_a_
00193 ( const GaudiAlgorithm* cmp , GaudiPython::AlgDecorator::Tools& tools )
00194 {
00195 tools.clear() ;
00196 if ( 0 == cmp ) { return 0 ; }
00197 tools = cmp->tools() ;
00198 return tools.size() ;
00199 }
00200
00201
00202
00203 size_t GaudiPython::AlgDecorator::_tools_t_
00204 ( const GaudiTool* cmp , GaudiPython::AlgDecorator::Tools& tools )
00205 {
00206 tools.clear() ;
00207 if ( 0 == cmp ) { return 0 ; }
00208 tools = cmp->tools() ;
00209 return tools.size() ;
00210 }
00211
00212
00213
00214 size_t GaudiPython::AlgDecorator::_tools_a_
00215 ( const IAlgorithm* cmp , GaudiPython::AlgDecorator::Tools& tools )
00216 {
00217 tools.clear() ;
00218 if ( 0 == cmp ) { return 0 ; }
00219 return _tools_a_ ( dynamic_cast<const GaudiAlgorithm*> ( cmp ) , tools ) ;
00220 }
00221
00222
00223
00224 size_t GaudiPython::AlgDecorator::_tools_t_
00225 ( const IAlgTool* cmp , GaudiPython::AlgDecorator::Tools& tools )
00226 {
00227 tools.clear() ;
00228 if ( 0 == cmp ) { return 0 ; }
00229 return _tools_t_ ( dynamic_cast<const GaudiTool*> ( cmp ) , tools ) ;
00230 }
00231
00232
00233
00234
00235
00236
00237