3 #ifndef GAUDIALG_GAUDICOMMONIMP_H
4 #define GAUDIALG_GAUDICOMMONIMP_H 1
23 template <
class PBASE >
26 const bool useRootInTES )
const
38 return ( !useRootInTES || rootInTES().
empty() ?
41 location.empty() || ( location ==
"/Event" ) ?
42 rootInTES().substr(0,rootInTES().size()-1)
44 0 == location.find(
"/Event/") ?
45 rootInTES() + location.substr(7)
47 rootInTES() + location );
52 template <
class PBASE >
53 template <
class TYPE >
54 inline typename Gaudi::Utils::GetData<TYPE>::return_type
57 const bool useRootInTES )
const
60 Assert( 0 != service ,
"get():: IDataProvider* points to NULL!" ) ;
62 Gaudi::Utils::GetData<TYPE> getter ;
63 return getter ( *
this ,
65 fullTESLocation ( location , useRootInTES ) ) ;
70 template <
class PBASE >
71 template <
class TYPE >
72 inline typename Gaudi::Utils::GetData<TYPE>::return_type
75 const bool useRootInTES )
const
78 Assert( 0 != service ,
"get():: IDataProvider* points to NULL!" ) ;
80 Gaudi::Utils::GetData<TYPE> getter ;
81 return getter ( *
this ,
83 fullTESLocation ( location , useRootInTES ),
89 template <
class PBASE >
90 template <
class TYPE >
93 const bool useRootInTES )
const
96 Assert( 0 != service ,
"exist():: IDataProvider* points to NULL!" ) ;
98 Gaudi::Utils::CheckData<TYPE> checker ;
99 return checker ( service,
100 fullTESLocation ( location , useRootInTES ) ) ;
107 template <
class PBASE>
108 template <
class TYPE,
class TYPE2>
109 inline typename Gaudi::Utils::GetData<TYPE>::return_type
112 const bool useRootInTES )
const
115 Assert ( 0 != service ,
"getOrCreate():: svc points to NULL!" ) ;
117 Gaudi::Utils::GetOrCreateData<TYPE,TYPE2> getter ;
118 return getter ( *
this ,
120 fullTESLocation( location, useRootInTES ) ,
126 template <
class PBASE >
127 template <
class TOOL >
137 Tool = tool<TOOL>(
type , parent , create ) ;
141 Assert( this->toolSvc() != 0,
"tool():: IToolSvc* points to NULL!" ) ;
144 this->toolSvc()->retrieveTool ( type , name , Tool , parent , create ) ;
146 { Exception(
"tool():: Could not retrieve Tool '" + type +
"'/'" + name +
"'", sc ) ; }
148 { Exception(
"tool():: Could not retrieve Tool '" + type +
"'/'" + name +
"'" ) ; }
150 addToToolList( Tool );
158 template <
class PBASE >
159 template <
class TOOL >
165 Assert ( PBASE::toolSvc() != 0,
"IToolSvc* points to NULL!" );
169 this->toolSvc() -> retrieveTool ( type, Tool, parent , create );
171 { Exception(
"tool():: Could not retrieve Tool '" + type +
"'", sc ) ; }
173 { Exception(
"tool():: Could not retrieve Tool '" + type +
"'" ) ; }
175 addToToolList( Tool );
182 template <
class PBASE >
183 template <
class SERVICE >
185 const bool create )
const
187 Assert ( this->svcLoc() != 0,
"ISvcLocator* points to NULL!" );
191 if (it != m_services.end()) {
207 addToServiceList(baseSvc);
215 template <
class PBASE>
220 { m_updMgrSvc = svc<IUpdateManagerSvc>(
"UpdateManagerSvc",
true); }
226 template <
class PBASE>
231 { m_msgStream =
new MsgStream ( PBASE::msgSvc() , this->name() ) ; }
232 return *m_msgStream <<
level ;
237 template <
class PBASE>
242 if (!ok) Exception( msg , sc );
247 template <
class PBASE>
250 if ( 0 != m_msgStream ) {
delete m_msgStream; m_msgStream = 0; }
255 template <
class PBASE>
260 if (!ok) Exception( msg , sc );
277 #define ALG_ERROR( message , code ) \
279 std::string ( " [ at line " ) + \
280 GaudiAlg::fileLine ( __LINE__ ) + \
281 std::string ( " in file '" ) + \
282 std::string ( __FILE__ ) + "']" , code ) )
287 #endif // GAUDIALG_GAUDICOMMONIMP_H