| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

GaudiHandle.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_GAUDIHANDLE_H
2 #define GAUDIKERNEL_GAUDIHANDLE_H
3
4 // Includes
5 #include "GaudiKernel/GaudiException.h"
6 #include "GaudiKernel/IInterface.h"
7 #include "GaudiKernel/System.h"
8
9 #include <algorithm>
10 #include <iostream>
11 #include <stdexcept>
12 #include <string>
13 #include <type_traits>
14 #include <vector>
15
16 class GAUDI_API GaudiHandleInfo
17 {
18 protected:
27 GaudiHandleInfo( std::string myComponentType, std::string myParentName )
28 : m_componentType( std::move( myComponentType ) ), m_parentName( std::move( myParentName ) )
29 {
30 }
31
32 public:
34 virtual ~GaudiHandleInfo() = default;
35 //
36 // Public member functions
37 //
38 const std::string& componentType() const { return m_componentType; }
39
41 const std::string& propertyName() const { return m_propertyName; }
42
44 void setPropertyName( std::string propName ) { m_propertyName = std::move( propName ); }
45
47 const std::string& parentName() const { return m_parentName; }
48
52 virtual std::string pythonPropertyClassName() const = 0;
53
58 virtual std::string pythonRepr() const = 0;
59
60 protected:
62 void setComponentType( const std::string& componentType ) { m_componentType = componentType; }
63
65 void setParentName( const std::string& parent ) { m_parentName = parent; }
66
67 private:
68 //
69 // Data members
70 //
71 std::string m_componentType; // e.g.: "PublicTool","PrivateTool","Service"
72 std::string m_propertyName; // name as used in declareProperty(name,gaudiHandle)
73 std::string m_parentName; // name of the parent having this handle as a member
74 };
75
83 class GAUDI_API GaudiHandleBase : public GaudiHandleInfo
84 {
85 //
86 // Ctors etc
87 //
88 protected:
100 GaudiHandleBase( std::string myTypeAndName, std::string myComponentType, std::string myParentName )
101 : GaudiHandleInfo( std::move( myComponentType ), std::move( myParentName ) )
102 {
103 setTypeAndName( std::move( myTypeAndName ) );
104 }
105
106 public:
107 //
108 // Public member functions
109 //
111 std::string typeAndName() const { return m_typeAndName; }
112
114 std::string type() const;
115
117 std::string name() const;
118
120 bool empty() const { return m_typeAndName.empty(); }
121
123 void setTypeAndName( std::string myTypeAndName );
124
126 void setName( const std::string& myName );
127
131 std::string pythonPropertyClassName() const override;
132
134 std::string messageName() const;
135
139 std::string pythonRepr() const override;
140
141 private:
142 //
143 // Data member
144 //
145 std::string m_typeAndName; // the full type and name: "type/name"
146 };
147
156 template <class T>
157 class GAUDI_API GaudiHandle : public GaudiHandleBase
158 {
159 //
160 // Constructors etc.
161 //
162 protected:
163 GaudiHandle( std::string myTypeAndName, std::string myComponentType, std::string myParentName )
164 : GaudiHandleBase( std::move( myTypeAndName ), std::move( myComponentType ), std::move( myParentName ) )
165 {
166 }
167
168 public:
170 template <typename CT = T, typename NCT = typename std::remove_const<T>::type>
171 GaudiHandle( const GaudiHandle<NCT>& other,
172 typename std::enable_if<std::is_const<CT>::value && !std::is_same<CT, NCT>::value>::type* = nullptr )
173 : GaudiHandleBase( other )
174 {
175 m_pObject = other.get();
176 if ( m_pObject ) nonConst( m_pObject )->addRef();
177 }
178
180 GaudiHandle( const GaudiHandle& other ) : GaudiHandleBase( other )
181 {
182 m_pObject = other.m_pObject;
183 if ( m_pObject ) nonConst( m_pObject )->addRef();
184 }
185
187 template <typename CT = T, typename NCT = typename std::remove_const<T>::type>
188 typename std::enable_if<std::is_const<CT>::value && !std::is_same<CT, NCT>::value, GaudiHandle&>::type
189 operator=( const GaudiHandle<NCT>& other )
190 {
191 GaudiHandleBase::operator=( other );
192 // release any current tool
193 release().ignore();
194 m_pObject = other.get();
195 // update ref-counting
196 if ( m_pObject ) nonConst( m_pObject )->addRef();
197 return *this;
198 }
199
201 GaudiHandle& operator=( const GaudiHandle& other )
202 {
203 GaudiHandleBase::operator=( other );
204 // release any current tool
205 release().ignore();
206 m_pObject = other.m_pObject;
207 // update ref-counting
208 if ( m_pObject ) nonConst( m_pObject )->addRef();
209 return *this;
210 }
211
213 StatusCode retrieve() const
214 { // not really const, because it updates m_pObject
215 StatusCode sc = StatusCode::SUCCESS;
216 if ( m_pObject && release().isFailure() ) {
217 sc = StatusCode::FAILURE;
218 }
219 if ( sc && retrieve( m_pObject ).isFailure() ) {
220 m_pObject = nullptr;
221 sc = StatusCode::FAILURE;
222 }
223 return sc;
224 }
225
227 StatusCode release() const
228 { // not really const, because it updates m_pObject
229 StatusCode sc = StatusCode::SUCCESS;
230 if ( m_pObject ) {
231 sc = release( m_pObject );
232 m_pObject = nullptr;
233 }
234 return sc;
235 }
236
238 bool isValid() const
239 { // not really const, because it may update m_pObject
240 return m_pObject || retrieve().isSuccess();
241 }
242
245 operator bool() const
246 { // not really const, because it may update m_pObject
247 return isValid();
248 }
249
251 T* get() { return m_pObject; }
252
254 typename std::add_const<T>::type* get() const { return m_pObject; }
255
257 bool isSet() const { return get(); }
258
259 T& operator*()
260 {
261 assertObject();
262 return *m_pObject;
263 }
264
265 T* operator->()
266 {
267 assertObject();
268 return m_pObject;
269 }
270
271 typename std::add_const<T>::type& operator*() const
272 {
273 // not really const, because it may update m_pObject
274 assertObject();
275 return *m_pObject;
276 }
277
278 typename std::add_const<T>::type* operator->() const
279 {
280 // not really const, because it may update m_pObject
281 assertObject();
282 return m_pObject;
283 }
284
286 std::string getDefaultType() { return System::typeinfoName( typeid( T ) ); }
287
288 std::string getDefaultName()
289 {
290 const auto defName = GaudiHandleBase::type();
291 return ( defName.empty() ? getDefaultType() : defName );
292 }
293
294 protected:
296 virtual StatusCode retrieve( T*& ) const = 0; // not really const, because it updates m_pObject
297
300 virtual StatusCode release( T* comp ) const
301 { // not really const, because it updates m_pObject
302 // const cast to support T being a const type
303 nonConst( comp )->release();
304 return StatusCode::SUCCESS;
305 }
306
308 template <class CLASS>
309 typename std::remove_const<CLASS>::type* nonConst( CLASS* p ) const
310 {
311 return const_cast<typename std::remove_const<CLASS>::type*>( p );
312 }
313
314 private:
316 void setDefaultTypeAndName()
317 {
318 const std::string& myType = getDefaultType();
319 GaudiHandleBase::setTypeAndName( myType + '/' + myType );
320 }
321
323 void setDefaultType() { GaudiHandleBase::setTypeAndName( getDefaultType() ); }
324
327 void assertObject() const
328 { // not really const, because it may update m_pObject
329 if ( UNLIKELY( !isValid() ) ) {
330 throw GaudiException( "Failed to retrieve " + componentType() + ": " + typeAndName(),
331 componentType() + " retrieve", StatusCode::FAILURE );
332 }
333 }
334
335 private:
336 //
337 // Data members
338 //
339 mutable T* m_pObject = nullptr;
340 };
341
348 class GAUDI_API GaudiHandleArrayBase : public GaudiHandleInfo
349 {
350 protected:
351 GaudiHandleArrayBase( std::string myComponentType, std::string myParentName )
352 : GaudiHandleInfo( std::move( myComponentType ), std::move( myParentName ) )
353 {
354 }
355
356 public:
357 typedef std::vector<GaudiHandleBase*> BaseHandleArray;
358 typedef std::vector<const GaudiHandleBase*> ConstBaseHandleArray;
359
362 bool setTypesAndNames( const std::vector<std::string>& myTypesAndNamesList );
363
366 const std::vector<std::string> typesAndNames() const;
367
369 const std::vector<std::string> types() const;
370
372 const std::vector<std::string> names() const;
373
376 const std::vector<std::string> getBaseInfos( std::string ( GaudiHandleBase::*pMemFunc )() const ) const;
377
381 std::string pythonPropertyClassName() const override;
382
386 std::string pythonRepr() const override;
387
391 virtual bool push_back( const std::string& myHandleTypeAndName ) = 0;
392
394 virtual void clear() = 0;
395
397 virtual bool empty() const = 0;
398
401 virtual ConstBaseHandleArray getBaseArray() const = 0;
402
405 virtual BaseHandleArray getBaseArray() = 0;
406
408 virtual bool retrieved() const = 0;
409 };
410
412 template <class T>
413 class GAUDI_API GaudiHandleArray : public GaudiHandleArrayBase
414 {
415 public:
416 //
417 // public nested types
418 //
419 typedef std::vector<T> HandleVector;
420 typedef typename HandleVector::value_type value_type;
421 typedef typename HandleVector::size_type size_type;
422 typedef typename HandleVector::reference reference;
423 typedef typename HandleVector::const_reference const_reference;
424 typedef typename HandleVector::iterator iterator;
425 typedef typename HandleVector::const_iterator const_iterator;
426 typedef typename HandleVector::reverse_iterator reverse_iterator;
427 typedef typename HandleVector::const_reverse_iterator const_reverse_iterator;
428
429 protected:
430 //
431 // Constructors
432 //
437 GaudiHandleArray( const std::vector<std::string>& myTypesAndNamesList, std::string myComponentType,
438 std::string myParentName )
439 : GaudiHandleArrayBase( std::move( myComponentType ), std::move( myParentName ) )
440 {
441 setTypesAndNames( myTypesAndNamesList );
442 }
443
448 GaudiHandleArray( const std::string& myComponentType, const std::string& myParentName )
449 : GaudiHandleArrayBase( myComponentType, myParentName )
450 {
451 }
452
453 public:
454 virtual ~GaudiHandleArray() = default;
455
457 GaudiHandleArray& operator=( const std::vector<std::string>& myTypesAndNamesList )
458 {
459 setTypesAndNames( myTypesAndNamesList );
460 return *this;
461 }
462
463 GaudiHandleArrayBase::BaseHandleArray getBaseArray() override
464 {
465 GaudiHandleArrayBase::BaseHandleArray baseArray;
466 iterator it = begin(), itEnd = end();
467 for ( ; it != itEnd; ++it ) baseArray.push_back( &*it );
468 return baseArray;
469 }
470
471 GaudiHandleArrayBase::ConstBaseHandleArray getBaseArray() const override
472 {
473 GaudiHandleArrayBase::ConstBaseHandleArray baseArray;
474 const_iterator it = begin(), itEnd = end();
475 for ( ; it != itEnd; ++it ) baseArray.push_back( &*it );
476 return baseArray;
477 }
478
479 //
480 // Simulate (part of) an std::vector
481 //
482 iterator begin() { return m_handleArray.begin(); }
483
484 iterator end() { return m_handleArray.end(); }
485
486 const_iterator begin() const { return m_handleArray.begin(); }
487
488 const_iterator end() const { return m_handleArray.end(); }
489
490 const_iterator rbegin() const { return m_handleArray.rbegin(); }
491
492 const_iterator rend() const { return m_handleArray.rend(); }
493
494 size_type size() const { return m_handleArray.size(); }
495
496 void clear() override { m_handleArray.clear(); }
497
498 bool empty() const override { return m_handleArray.empty(); }
499
500 T& operator[]( int index ) { return m_handleArray[index]; }
501
502 const T& operator[]( int index ) const { return m_handleArray[index]; }
503
505 T* operator[]( const std::string& name )
506 {
507 auto it = std::find_if( begin(), end(), [&]( const_reference r ) { return r.name() == name; } );
508 return it != end() ? &*it : nullptr;
509 }
510
512 const T* operator[]( const std::string& name ) const
513 {
514 auto it = std::find_if( begin(), end(), [&]( const_reference r ) { return r.name() == name; } );
515 return it != end() ? &*it : nullptr;
516 }
517
520 using GaudiHandleArrayBase::push_back; // avoid compiler warning
521 virtual bool push_back( const T& myHandle )
522 {
523 m_handleArray.push_back( myHandle );
524 return true;
525 }
526
528 StatusCode retrieve()
529 {
530 StatusCode sc = StatusCode::SUCCESS;
531 for ( auto& i : *this ) {
532 // stop at first failure
533 if ( i.retrieve().isFailure() ) {
534 sc = StatusCode::FAILURE;
535 break;
536 }
537 }
538 if ( sc ) {
539 m_retrieved = true;
540 }
541 return sc;
542 }
543
545 StatusCode release()
546 {
547 StatusCode sc = StatusCode::SUCCESS;
548 for ( auto& i : *this ) {
549 // continue trying to release other tools even if we fail...
550 if ( i.release().isFailure() ) sc = StatusCode::FAILURE;
551 }
552 return sc;
553 }
554
556 virtual bool retrieved() const override { return m_retrieved; }
557
558 private:
559 //
560 // Private data members
561 //
562 HandleVector m_handleArray;
563 bool m_retrieved{false};
564 };
565
566 // Easy printing out of Handles and HandleArrays
567 // It prints <propertyName> = <HandleType>( <HandleType(s)AndName(s)> )
568 std::ostream& operator<<( std::ostream& os, const GaudiHandleInfo& handle );
569
570 #endif // ! GAUDIKERNEL_GAUDIHANDLE_H
System.h
GaudiHandle::operator=
GaudiHandle & operator=(const GaudiHandle &other)
Assignment operator for correct ref-counting.
Definition: GaudiHandle.h:201
GaudiHandleArray::const_reference
HandleVector::const_reference const_reference
Definition: GaudiHandle.h:423
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:128
GaudiHandleArray::value_type
HandleVector::value_type value_type
Definition: GaudiHandle.h:420
StatusCode::SUCCESS
Definition: StatusCode.h:31
GaudiHandle
Handle to be used in lieu of naked pointers to gaudis.
Definition: GaudiHandle.h:157
GaudiHandleArray::clear
void clear() override
Clear the list of handles.
Definition: GaudiHandle.h:496
GaudiHandle::getDefaultType
std::string getDefaultType()
Helper function to get default type string from the class type.
Definition: GaudiHandle.h:286
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
GaudiHandle::nonConst
std::remove_const< CLASS >::type * nonConst(CLASS *p) const
Cast a pointer to a non const type.
Definition: GaudiHandle.h:309
GaudiHandleArray::iterator
HandleVector::iterator iterator
Definition: GaudiHandle.h:424
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
GaudiHandle::m_pObject
T * m_pObject
Definition: GaudiHandle.h:339
StatusCode::FAILURE
Definition: StatusCode.h:31
GaudiHandleArray::getBaseArray
GaudiHandleArrayBase::BaseHandleArray getBaseArray() override
Get a read-write vector of GaudiHandleBase* pointing to the real handles.
Definition: GaudiHandle.h:463
GaudiHandleBase::setTypeAndName
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.
Definition: GaudiHandle.cpp:9
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:329
GaudiHandleArray::getBaseArray
GaudiHandleArrayBase::ConstBaseHandleArray getBaseArray() const override
Get a read-only vector of const GaudiHandleBase* pointing to the real handles.
Definition: GaudiHandle.h:471
GaudiHandleArray::HandleVector
std::vector< T > HandleVector
Definition: GaudiHandle.h:419
GaudiHandleArray::rend
const_iterator rend() const
Definition: GaudiHandle.h:492
GaudiHandleArray::const_reverse_iterator
HandleVector::const_reverse_iterator const_reverse_iterator
Definition: GaudiHandle.h:427
GaudiHandleInfo::setComponentType
void setComponentType(const std::string &componentType)
The component type.
Definition: GaudiHandle.h:62
std::is_same
GaudiHandle::getDefaultName
std::string getDefaultName()
Definition: GaudiHandle.h:288
std
STL namespace.
GaudiHandle::operator*
T & operator*()
Definition: GaudiHandle.h:259
GaudiHandle::GaudiHandle
GaudiHandle(std::string myTypeAndName, std::string myComponentType, std::string myParentName)
Definition: GaudiHandle.h:163
GaudiHandleInfo::parentName
const std::string & parentName() const
The name of the parent.
Definition: GaudiHandle.h:47
GaudiHandle::setDefaultType
void setDefaultType()
Helper function to set default type from the class type T.
Definition: GaudiHandle.h:323
GaudiHandle::assertObject
void assertObject() const
Load the pointer to the component.
Definition: GaudiHandle.h:327
GaudiHandleInfo::m_componentType
std::string m_componentType
Definition: GaudiHandle.h:71
GaudiHandleArray::retrieved
virtual bool retrieved() const override
has Array been retreived?
Definition: GaudiHandle.h:556
GaudiHandleInfo::pythonPropertyClassName
virtual std::string pythonPropertyClassName() const =0
The python class name for the property in the genconf-generated configurables.
GaudiHandleArray::GaudiHandleArray
GaudiHandleArray(const std::vector< std::string > &myTypesAndNamesList, std::string myComponentType, std::string myParentName)
Generic constructor.
Definition: GaudiHandle.h:437
GaudiHandleArray::size_type
HandleVector::size_type size_type
Definition: GaudiHandle.h:421
GaudiHandleArray::operator=
GaudiHandleArray & operator=(const std::vector< std::string > &myTypesAndNamesList)
Set the array of GaudiHandles from typeAndNames given in vector of strings.
Definition: GaudiHandle.h:457
GaudiHandleArray::reference
HandleVector::reference reference
Definition: GaudiHandle.h:422
GaudiHandleArray::push_back
virtual bool push_back(const T &myHandle)
Definition: GaudiHandle.h:521
GaudiHandleInfo::setParentName
void setParentName(const std::string &parent)
The name of the parent.
Definition: GaudiHandle.h:65
GaudiHandle::release
StatusCode release() const
Release the component.
Definition: GaudiHandle.h:227
Gaudi::Functional::details::details2::push_back
void push_back(Container &c, const Value &v, std::true_type)
Definition: FunctionalDetails.h:217
GaudiHandle::operator=
std::enable_if< std::is_const< CT >::value &&!std::is_same< CT, NCT >::value, GaudiHandle & >::type operator=(const GaudiHandle< NCT > &other)
Assignment operator for correct ref-counting.
Definition: GaudiHandle.h:189
std::enable_if
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:58
operator=
PropertyMgr & operator=(const PropertyMgr &)=delete
std::string
STL class.
GaudiHandle::operator->
std::add_const< T >::type * operator->() const
Definition: GaudiHandle.h:278
std::vector::push_back
T push_back(T...args)
GaudiHandle::setDefaultTypeAndName
void setDefaultTypeAndName()
Helper function to set default name and type.
Definition: GaudiHandle.h:316
GaudiHandleArray::operator[]
const T & operator[](int index) const
Definition: GaudiHandle.h:502
GaudiHandleInfo::propertyName
const std::string & propertyName() const
name as used in declareProperty(name,gaudiHandle)
Definition: GaudiHandle.h:41
GaudiHandleArray::m_handleArray
HandleVector m_handleArray
Definition: GaudiHandle.h:562
GaudiHandleArray::retrieve
StatusCode retrieve()
Retrieve all tools.
Definition: GaudiHandle.h:528
GaudiHandleArray::begin
const_iterator begin() const
Definition: GaudiHandle.h:486
GaudiHandle::operator*
std::add_const< T >::type & operator*() const
Definition: GaudiHandle.h:271
GaudiHandleArray::begin
iterator begin()
Definition: GaudiHandle.h:482
GaudiHandleArrayBase::setTypesAndNames
bool setTypesAndNames(const std::vector< std::string > &myTypesAndNamesList)
Set the array of handles from list of "type/name" strings in <myTypesAndNamesList>.
Definition: GaudiHandle.cpp:58
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
GaudiException.h
gaudirun.type
type
Definition: gaudirun.py:133
GaudiHandle::get
T * get()
Return the wrapped pointer, not calling retrieve() if null.
Definition: GaudiHandle.h:251
GaudiHandle::retrieve
StatusCode retrieve() const
Retrieve the component.
Definition: GaudiHandle.h:213
GaudiHandleBase::m_typeAndName
std::string m_typeAndName
Definition: GaudiHandle.h:145
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:64
GaudiHandleArrayBase::ConstBaseHandleArray
std::vector< const GaudiHandleBase * > ConstBaseHandleArray
Definition: GaudiHandle.h:358
std::move
T move(T...args)
GaudiHandleArray::empty
bool empty() const override
Return whether the list of tools is empty.
Definition: GaudiHandle.h:498
std::add_const
GaudiHandle::operator->
T * operator->()
Definition: GaudiHandle.h:265
std::is_const
std::find_if
T find_if(T...args)
GaudiHandleArray::const_iterator
HandleVector::const_iterator const_iterator
Definition: GaudiHandle.h:425
GaudiHandle::isValid
bool isValid() const
Check if the handle is valid (try to retrive the object is not done yet).
Definition: GaudiHandle.h:238
GaudiHandleArrayBase
Base class of array&#39;s of various gaudihandles.
Definition: GaudiHandle.h:348
GaudiHandleArray::rbegin
const_iterator rbegin() const
Definition: GaudiHandle.h:490
std::vector
STL class.
GaudiHandleInfo::GaudiHandleInfo
GaudiHandleInfo(std::string myComponentType, std::string myParentName)
Some basic information and helper functions shared between various handles/arrays.
Definition: GaudiHandle.h:27
GaudiHandleInfo::setPropertyName
void setPropertyName(std::string propName)
set name as used in declareProperty(name,gaudiHandle).
Definition: GaudiHandle.h:44
GaudiHandle::isSet
bool isSet() const
True if the wrapped pointer is not null.
Definition: GaudiHandle.h:257
GaudiHandleArray::reverse_iterator
HandleVector::reverse_iterator reverse_iterator
Definition: GaudiHandle.h:426
GaudiHandleArrayBase::push_back
virtual bool push_back(const std::string &myHandleTypeAndName)=0
Add a handle to the array with "type/name" given in <myHandleTypeAndName>.
GaudiHandleArrayBase::BaseHandleArray
std::vector< GaudiHandleBase * > BaseHandleArray
Definition: GaudiHandle.h:357
GaudiHandle::release
virtual StatusCode release(T *comp) const
Release the component.
Definition: GaudiHandle.h:300
GaudiHandleBase::type
std::string type() const
The concrete component class name: the part before the &#39;/&#39;.
Definition: GaudiHandle.cpp:11
operator<<
std::ostream & operator<<(std::ostream &os, const GaudiHandleInfo &handle)
Definition: GaudiHandle.cpp:104
GaudiHandleArray::end
iterator end()
Definition: GaudiHandle.h:484
GaudiHandleArray::operator[]
T & operator[](int index)
Definition: GaudiHandle.h:500
GaudiHandleArray::size
size_type size() const
Definition: GaudiHandle.h:494
GaudiHandleArray::operator[]
const T * operator[](const std::string &name) const
Get const pointer (!) to ToolHandle by instance name.
Definition: GaudiHandle.h:512
GaudiHandleArray::end
const_iterator end() const
Definition: GaudiHandle.h:488
GaudiHandleBase
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
Definition: GaudiHandle.h:83
std::remove_const
GaudiHandleBase::typeAndName
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:111
GaudiHandleArrayBase::GaudiHandleArrayBase
GaudiHandleArrayBase(std::string myComponentType, std::string myParentName)
Definition: GaudiHandle.h:351
GaudiHandleArray::operator[]
T * operator[](const std::string &name)
Get pointer (!) to ToolHandle by instance name.
Definition: GaudiHandle.h:505
GaudiHandleInfo::pythonRepr
virtual std::string pythonRepr() const =0
Python representation of handle, i.e.
GaudiHandle::GaudiHandle
GaudiHandle(const GaudiHandle< NCT > &other, typename std::enable_if< std::is_const< CT >::value &&!std::is_same< CT, NCT >::value >::type *=nullptr)
Copy constructor needed for correct ref-counting.
Definition: GaudiHandle.h:171
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
IInterface.h
std::ostream
STL class.
GaudiHandleInfo::componentType
const std::string & componentType() const
Definition: GaudiHandle.h:38
Objects::reference
TO * reference(FROM *from)
Definition: KeyedObject.cpp:21
GaudiHandleBase::GaudiHandleBase
GaudiHandleBase(std::string myTypeAndName, std::string myComponentType, std::string myParentName)
Create a handle (&#39;smart pointer&#39;) to a gaudi component.
Definition: GaudiHandle.h:100
GaudiHandleInfo::m_propertyName
std::string m_propertyName
Definition: GaudiHandle.h:72
GaudiHandle::GaudiHandle
GaudiHandle(const GaudiHandle &other)
Copy constructor needed for correct ref-counting.
Definition: GaudiHandle.h:180
GaudiHandleBase::empty
bool empty() const
Check if the handle has been set to empty string (i.e.
Definition: GaudiHandle.h:120
GaudiHandleArray
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:413
GaudiHandleInfo::m_parentName
std::string m_parentName
Definition: GaudiHandle.h:73
GaudiHandleArray::release
StatusCode release()
Release all tools.
Definition: GaudiHandle.h:545
GaudiHandleArray::GaudiHandleArray
GaudiHandleArray(const std::string &myComponentType, const std::string &myParentName)
Constructor creating an empty array.
Definition: GaudiHandle.h:448
GaudiHandleInfo
Definition: GaudiHandle.h:16