| The Gaudi Framework v32r1 (f65d50dc)

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/Property.h"
8 #include "GaudiKernel/System.h"
9
10 #include <algorithm>
11 #include <iostream>
12 #include <stdexcept>
13 #include <string>
14 #include <type_traits>
15 #include <vector>
16
17 namespace details {
19 template <class T>
20 std::remove_const_t<T>* nonConst( T* p ) {
21 return const_cast<std::remove_const_t<T>*>( p );
22 }
23 } // namespace details
24
25 class GAUDI_API GaudiHandleInfo {
26 protected:
35 GaudiHandleInfo( std::string myComponentType, std::string myParentName )
36 : m_componentType( std::move( myComponentType ) ), m_parentName( std::move( myParentName ) ) {}
37
38 public:
40 virtual ~GaudiHandleInfo() = default;
41 //
42 // Public member functions
43 //
44 const std::string& componentType() const { return m_componentType; }
45
47 const std::string& propertyName() const { return m_propertyName; }
48
50 void setPropertyName( std::string propName ) { m_propertyName = std::move( propName ); }
51
53 const std::string& parentName() const { return m_parentName; }
54
58 virtual std::string pythonPropertyClassName() const = 0;
59
64 virtual std::string pythonRepr() const = 0;
65
66 protected:
68 void setComponentType( const std::string& componentType ) { m_componentType = componentType; }
69
71 void setParentName( const std::string& parent ) { m_parentName = parent; }
72
73 private:
74 //
75 // Data members
76 //
77 std::string m_componentType; // e.g.: "PublicTool","PrivateTool","Service"
78 std::string m_propertyName; // name as used in declareProperty(name,gaudiHandle)
79 std::string m_parentName; // name of the parent having this handle as a member
80 };
81
89 class GAUDI_API GaudiHandleBase : public GaudiHandleInfo {
90 //
91 // Ctors etc
92 //
93 protected:
105 GaudiHandleBase( std::string myTypeAndName, std::string myComponentType, std::string myParentName )
106 : GaudiHandleInfo( std::move( myComponentType ), std::move( myParentName ) ) {
107 setTypeAndName( std::move( myTypeAndName ) );
108 }
109
110 public:
111 //
112 // Public member functions
113 //
115 std::string typeAndName() const { return m_typeAndName; }
116
118 std::string type() const;
119
121 std::string name() const;
122
124 bool empty() const { return m_typeAndName.empty(); }
125
127 void setTypeAndName( std::string myTypeAndName );
128
130 void setName( const std::string& myName );
131
135 std::string pythonPropertyClassName() const override;
136
138 std::string messageName() const;
139
143 std::string pythonRepr() const override;
144
145 using PropertyType = GaudiHandleProperty;
146
147 private:
148 //
149 // Data member
150 //
151 std::string m_typeAndName; // the full type and name: "type/name"
152 };
153
162 template <class T>
163 class GAUDI_API GaudiHandle : public GaudiHandleBase {
164 //
165 // Constructors etc.
166 //
167 protected:
168 GaudiHandle( std::string myTypeAndName, std::string myComponentType, std::string myParentName )
169 : GaudiHandleBase( std::move( myTypeAndName ), std::move( myComponentType ), std::move( myParentName ) ) {}
170
171 public:
173 template <typename CT = T, typename NCT = std::remove_const_t<T>>
174 GaudiHandle( const GaudiHandle<NCT>& other,
175 std::enable_if_t<std::is_const_v<CT> && !std::is_same_v<CT, NCT>>* = nullptr )
176 : GaudiHandleBase( other ) {
177 m_pObject = other.get();
178 if ( m_pObject ) ::details::nonConst( m_pObject )->addRef();
179 }
180
182 GaudiHandle( const GaudiHandle& other ) : GaudiHandleBase( other ) {
183 m_pObject = other.m_pObject;
184 if ( m_pObject ) ::details::nonConst( m_pObject )->addRef();
185 }
186
188 template <typename CT = T, typename NCT = std::remove_const_t<T>>
189 std::enable_if_t<std::is_const_v<CT> && !std::is_same_v<CT, NCT>, GaudiHandle&>
190 operator=( const GaudiHandle<NCT>& other ) {
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 ) ::details::nonConst( m_pObject )->addRef();
197 return *this;
198 }
199
201 GaudiHandle& operator=( const GaudiHandle& other ) {
202 GaudiHandleBase::operator=( other );
203 // release any current tool
204 release().ignore();
205 m_pObject = other.m_pObject;
206 // update ref-counting
207 if ( m_pObject ) ::details::nonConst( m_pObject )->addRef();
208 return *this;
209 }
210
212 StatusCode retrieve() const {
213 // not really const, because it updates m_pObject
214 StatusCode sc = StatusCode::SUCCESS;
215 if ( m_pObject && release().isFailure() ) { sc = StatusCode::FAILURE; }
216 if ( sc && retrieve( m_pObject ).isFailure() ) {
217 m_pObject = nullptr;
218 sc = StatusCode::FAILURE;
219 }
220 return sc;
221 }
222
224 StatusCode release() const {
225 // not really const, because it updates m_pObject
226 StatusCode sc = StatusCode::SUCCESS;
227 if ( m_pObject ) {
228 sc = release( m_pObject );
229 m_pObject = nullptr;
230 }
231 return sc;
232 }
233
235 bool isValid() const {
236 // not really const, because it may update m_pObject
237 return m_pObject || retrieve().isSuccess();
238 }
239
242 operator bool() const {
243 // not really const, because it may update m_pObject
244 return isValid();
245 }
246
248 T* get() { return m_pObject; }
249
251 std::add_const_t<T>* get() const { return m_pObject; }
252
254 bool isSet() const { return get(); }
255
256 T& operator*() {
257 assertObject();
258 return *m_pObject;
259 }
260
261 T* operator->() {
262 assertObject();
263 return m_pObject;
264 }
265
266 std::add_const_t<T>& operator*() const {
267 // not really const, because it may update m_pObject
268 assertObject();
269 return *m_pObject;
270 }
271
272 std::add_const_t<T>* operator->() const {
273 // not really const, because it may update m_pObject
274 assertObject();
275 return m_pObject;
276 }
277
279 std::string getDefaultType() { return System::typeinfoName( typeid( T ) ); }
280
281 std::string getDefaultName() {
282 const auto defName = GaudiHandleBase::type();
283 return ( defName.empty() ? getDefaultType() : defName );
284 }
285
286 protected:
288 virtual StatusCode retrieve( T*& ) const = 0; // not really const, because it updates m_pObject
289
292 virtual StatusCode release( T* comp ) const { // not really const, because it updates m_pObject
293 // const cast to support T being a const type
294 ::details::nonConst( comp )->release();
295 return StatusCode::SUCCESS;
296 }
297
298 private:
300 void setDefaultTypeAndName() {
301 const std::string& myType = getDefaultType();
302 GaudiHandleBase::setTypeAndName( myType + '/' + myType );
303 }
304
306 void setDefaultType() { GaudiHandleBase::setTypeAndName( getDefaultType() ); }
307
310 void assertObject() const { // not really const, because it may update m_pObject
311 if ( UNLIKELY( !isValid() ) ) {
312 throw GaudiException( "Failed to retrieve " + componentType() + ": " + typeAndName(),
313 componentType() + " retrieve", StatusCode::FAILURE );
314 }
315 }
316
317 private:
318 //
319 // Data members
320 //
321 mutable T* m_pObject = nullptr;
322 };
323
330 class GAUDI_API GaudiHandleArrayBase : public GaudiHandleInfo {
331 protected:
332 GaudiHandleArrayBase( std::string myComponentType, std::string myParentName )
333 : GaudiHandleInfo( std::move( myComponentType ), std::move( myParentName ) ) {}
334
335 public:
336 using PropertyType = GaudiHandleArrayProperty;
337 typedef std::vector<GaudiHandleBase*> BaseHandleArray;
338 typedef std::vector<const GaudiHandleBase*> ConstBaseHandleArray;
339
342 bool setTypesAndNames( const std::vector<std::string>& myTypesAndNamesList );
343
346 const std::vector<std::string> typesAndNames() const;
347
349 const std::vector<std::string> types() const;
350
352 const std::vector<std::string> names() const;
353
356 const std::vector<std::string> getBaseInfos( std::string ( GaudiHandleBase::*pMemFunc )() const ) const;
357
361 std::string pythonPropertyClassName() const override;
362
366 std::string pythonRepr() const override;
367
371 virtual bool push_back( const std::string& myHandleTypeAndName ) = 0;
372
374 virtual void clear() = 0;
375
377 virtual bool empty() const = 0;
378
381 virtual ConstBaseHandleArray getBaseArray() const = 0;
382
385 virtual BaseHandleArray getBaseArray() = 0;
386
388 virtual bool retrieved() const = 0;
389 };
390
392 template <class T>
393 class GAUDI_API GaudiHandleArray : public GaudiHandleArrayBase {
394 public:
395 //
396 // public nested types
397 //
398 typedef std::vector<T> HandleVector;
399 typedef typename HandleVector::value_type value_type;
400 typedef typename HandleVector::size_type size_type;
401 typedef typename HandleVector::reference reference;
402 typedef typename HandleVector::const_reference const_reference;
403 typedef typename HandleVector::iterator iterator;
404 typedef typename HandleVector::const_iterator const_iterator;
405 typedef typename HandleVector::reverse_iterator reverse_iterator;
406 typedef typename HandleVector::const_reverse_iterator const_reverse_iterator;
407
408 protected:
409 //
410 // Constructors
411 //
416 GaudiHandleArray( const std::vector<std::string>& myTypesAndNamesList, std::string myComponentType,
417 std::string myParentName )
418 : GaudiHandleArrayBase( std::move( myComponentType ), std::move( myParentName ) ) {
419 setTypesAndNames( myTypesAndNamesList );
420 }
421
426 GaudiHandleArray( const std::string& myComponentType, const std::string& myParentName )
427 : GaudiHandleArrayBase( myComponentType, myParentName ) {}
428
429 public:
430 virtual ~GaudiHandleArray() = default;
431
433 GaudiHandleArray& operator=( const std::vector<std::string>& myTypesAndNamesList ) {
434 setTypesAndNames( myTypesAndNamesList );
435 return *this;
436 }
437
438 GaudiHandleArrayBase::BaseHandleArray getBaseArray() override {
439 GaudiHandleArrayBase::BaseHandleArray baseArray;
440 iterator it = begin(), itEnd = end();
441 for ( ; it != itEnd; ++it ) baseArray.push_back( &*it );
442 return baseArray;
443 }
444
445 GaudiHandleArrayBase::ConstBaseHandleArray getBaseArray() const override {
446 GaudiHandleArrayBase::ConstBaseHandleArray baseArray;
447 const_iterator it = begin(), itEnd = end();
448 for ( ; it != itEnd; ++it ) baseArray.push_back( &*it );
449 return baseArray;
450 }
451
452 //
453 // Simulate (part of) an std::vector
454 //
455 iterator begin() { return m_handleArray.begin(); }
456
457 iterator end() { return m_handleArray.end(); }
458
459 const_iterator begin() const { return m_handleArray.begin(); }
460
461 const_iterator end() const { return m_handleArray.end(); }
462
463 const_iterator rbegin() const { return m_handleArray.rbegin(); }
464
465 const_iterator rend() const { return m_handleArray.rend(); }
466
467 size_type size() const { return m_handleArray.size(); }
468
469 void clear() override { m_handleArray.clear(); }
470
471 bool empty() const override { return m_handleArray.empty(); }
472
473 T& operator[]( int index ) { return m_handleArray[index]; }
474
475 const T& operator[]( int index ) const { return m_handleArray[index]; }
476
478 T* operator[]( const std::string& name ) {
479 auto it = std::find_if( begin(), end(), [&]( const_reference r ) { return r.name() == name; } );
480 return it != end() ? &*it : nullptr;
481 }
482
484 const T* operator[]( const std::string& name ) const {
485 auto it = std::find_if( begin(), end(), [&]( const_reference r ) { return r.name() == name; } );
486 return it != end() ? &*it : nullptr;
487 }
488
491 using GaudiHandleArrayBase::push_back; // avoid compiler warning
492 virtual bool push_back( const T& myHandle ) {
493 m_handleArray.push_back( myHandle );
494 return true;
495 }
496
498 StatusCode retrieve() {
499 StatusCode sc = StatusCode::SUCCESS;
500 for ( auto& i : *this ) {
501 // stop at first failure
502 if ( i.retrieve().isFailure() ) {
503 sc = StatusCode::FAILURE;
504 break;
505 }
506 }
507 if ( sc ) { m_retrieved = true; }
508 return sc;
509 }
510
512 StatusCode release() {
513 StatusCode sc = StatusCode::SUCCESS;
514 for ( auto& i : *this ) {
515 // continue trying to release other tools even if we fail...
516 if ( i.release().isFailure() ) sc = StatusCode::FAILURE;
517 }
518 return sc;
519 }
520
522 virtual bool retrieved() const override { return m_retrieved; }
523
524 private:
525 //
526 // Private data members
527 //
528 HandleVector m_handleArray;
529 bool m_retrieved{false};
530 };
531
532 // Easy printing out of Handles and HandleArrays
533 // It prints <propertyName> = <HandleType>( <HandleType(s)AndName(s)> )
534 std::ostream& operator<<( std::ostream& os, const GaudiHandleInfo& handle );
535
536 #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:402
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
GaudiHandleArray::operator[]
const T * operator[](const std::string &name) const
Get const pointer (!) to ToolHandle by instance name.
Definition: GaudiHandle.h:484
GaudiHandleArray::value_type
HandleVector::value_type value_type
Definition: GaudiHandle.h:399
GaudiHandle
Handle to be used in lieu of naked pointers to gaudis.
Definition: GaudiHandle.h:163
GaudiHandle::release
StatusCode release() const
Release the component.
Definition: GaudiHandle.h:224
GaudiHandleArray::clear
void clear() override
Clear the list of handles.
Definition: GaudiHandle.h:469
GaudiHandle::getDefaultType
std::string getDefaultType()
Helper function to get default type string from the class type.
Definition: GaudiHandle.h:279
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
GaudiHandle::get
std::add_const_t< T > * get() const
Return the wrapped pointer, not calling retrieve() if null.
Definition: GaudiHandle.h:251
GaudiHandleBase::empty
bool empty() const
Check if the handle has been set to empty string (i.e.
Definition: GaudiHandle.h:124
GaudiHandleArray::iterator
HandleVector::iterator iterator
Definition: GaudiHandle.h:403
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
GaudiHandle::m_pObject
T * m_pObject
Definition: GaudiHandle.h:321
GaudiHandleArray::getBaseArray
GaudiHandleArrayBase::BaseHandleArray getBaseArray() override
Get a read-write vector of GaudiHandleBase* pointing to the real handles.
Definition: GaudiHandle.h:438
GaudiHandleBase::setTypeAndName
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.
Definition: GaudiHandle.cpp:9
GaudiHandleInfo::propertyName
const std::string & propertyName() const
name as used in declareProperty(name,gaudiHandle)
Definition: GaudiHandle.h:47
GaudiHandle::GaudiHandle
GaudiHandle(const GaudiHandle< NCT > &other, std::enable_if_t< std::is_const_v< CT > &&!std::is_same_v< CT, NCT >> *=nullptr)
Copy constructor needed for correct ref-counting.
Definition: GaudiHandle.h:174
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
GaudiHandleArray::HandleVector
std::vector< T > HandleVector
Definition: GaudiHandle.h:398
GaudiHandleBase::typeAndName
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:115
GaudiHandleArray::const_reverse_iterator
HandleVector::const_reverse_iterator const_reverse_iterator
Definition: GaudiHandle.h:406
GaudiHandleInfo::setComponentType
void setComponentType(const std::string &componentType)
The component type.
Definition: GaudiHandle.h:68
GaudiHandle::getDefaultName
std::string getDefaultName()
Definition: GaudiHandle.h:281
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
GaudiHandleArray::size
size_type size() const
Definition: GaudiHandle.h:467
std
STL namespace.
GaudiHandle::retrieve
StatusCode retrieve() const
Retrieve the component.
Definition: GaudiHandle.h:212
GaudiHandleProperty
Definition: Property.h:845
GaudiHandle::GaudiHandle
GaudiHandle(std::string myTypeAndName, std::string myComponentType, std::string myParentName)
Definition: GaudiHandle.h:168
GaudiHandle::setDefaultType
void setDefaultType()
Helper function to set default type from the class type T.
Definition: GaudiHandle.h:306
GaudiHandleInfo::m_componentType
std::string m_componentType
Definition: GaudiHandle.h:77
GaudiHandleArray::GaudiHandleArray
GaudiHandleArray(const std::vector< std::string > &myTypesAndNamesList, std::string myComponentType, std::string myParentName)
Generic constructor.
Definition: GaudiHandle.h:416
GaudiHandleArray::size_type
HandleVector::size_type size_type
Definition: GaudiHandle.h:400
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:433
GaudiHandleArray::empty
bool empty() const override
Return whether the list of tools is empty.
Definition: GaudiHandle.h:471
GaudiHandleArray::reference
HandleVector::reference reference
Definition: GaudiHandle.h:401
GaudiHandleArray::push_back
virtual bool push_back(const T &myHandle)
Definition: GaudiHandle.h:492
GaudiHandle::operator=
std::enable_if_t< std::is_const_v< CT > &&!std::is_same_v< CT, NCT >, GaudiHandle & > operator=(const GaudiHandle< NCT > &other)
Assignment operator for correct ref-counting.
Definition: GaudiHandle.h:190
GaudiHandleInfo::setParentName
void setParentName(const std::string &parent)
The name of the parent.
Definition: GaudiHandle.h:71
Gaudi::Functional::details::details2::push_back
void push_back(Container &c, const Value &v, std::true_type)
Definition: FunctionalDetails.h:184
GaudiHandleArray::operator[]
const T & operator[](int index) const
Definition: GaudiHandle.h:475
Gaudi::Accumulators::operator *
auto operator *(const std::chrono::duration< Rep1, Period > &lhs, const std::chrono::duration< Rep2, Period > &rhs)
Multiplication of two std::chrono::duration objects with same Period.
Definition: Counters.h:34
GaudiHandle::operator->
std::add_const_t< T > * operator->() const
Definition: GaudiHandle.h:272
std::string
STL class.
std::vector::push_back
T push_back(T... args)
GaudiHandle::setDefaultTypeAndName
void setDefaultTypeAndName()
Helper function to set default name and type.
Definition: GaudiHandle.h:300
GaudiHandleInfo::pythonRepr
virtual std::string pythonRepr() const =0
Python representation of handle, i.e.
GaudiHandleArray::m_handleArray
HandleVector m_handleArray
Definition: GaudiHandle.h:528
GaudiHandleArray::retrieve
StatusCode retrieve()
Retrieve all tools.
Definition: GaudiHandle.h:498
GaudiHandleArray::rend
const_iterator rend() const
Definition: GaudiHandle.h:465
GaudiHandleArray::begin
iterator begin()
Definition: GaudiHandle.h:455
details
Definition: AnyDataWrapper.h:10
details::nonConst
std::remove_const_t< T > * nonConst(T *p)
Cast a pointer to a non const type.
Definition: GaudiHandle.h:20
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:53
GaudiHandleArray::end
const_iterator end() const
Definition: GaudiHandle.h:461
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
GaudiHandleInfo::parentName
const std::string & parentName() const
The name of the parent.
Definition: GaudiHandle.h:53
GaudiException.h
gaudirun.type
type
Definition: gaudirun.py:142
GaudiHandleArray::retrieved
virtual bool retrieved() const override
has Array been retreived?
Definition: GaudiHandle.h:522
GaudiHandle::get
T * get()
Return the wrapped pointer, not calling retrieve() if null.
Definition: GaudiHandle.h:248
GaudiHandleArray::getBaseArray
GaudiHandleArrayBase::ConstBaseHandleArray getBaseArray() const override
Get a read-only vector of const GaudiHandleBase* pointing to the real handles.
Definition: GaudiHandle.h:445
GaudiHandleBase::m_typeAndName
std::string m_typeAndName
Definition: GaudiHandle.h:151
GaudiPython.Bindings.GaudiHandleArrayProperty
GaudiHandleArrayProperty
Definition: Bindings.py:54
IOTest.end
def end
Definition: IOTest.py:112
GaudiHandleArray::rbegin
const_iterator rbegin() const
Definition: GaudiHandle.h:463
GaudiHandleArrayBase::ConstBaseHandleArray
std::vector< const GaudiHandleBase * > ConstBaseHandleArray
Definition: GaudiHandle.h:338
std::move
T move(T... args)
GaudiHandle::operator->
T * operator->()
Definition: GaudiHandle.h:261
GaudiHandle::assertObject
void assertObject() const
Load the pointer to the component.
Definition: GaudiHandle.h:310
GaudiHandleInfo::componentType
const std::string & componentType() const
Definition: GaudiHandle.h:44
std::find_if
T find_if(T... args)
GaudiHandleArray::const_iterator
HandleVector::const_iterator const_iterator
Definition: GaudiHandle.h:404
GaudiHandleArrayBase
Base class of array's of various gaudihandles.
Definition: GaudiHandle.h:330
GaudiHandle::release
virtual StatusCode release(T *comp) const
Release the component.
Definition: GaudiHandle.h:292
GaudiHandleInfo::pythonPropertyClassName
virtual std::string pythonPropertyClassName() const =0
The python class name for the property in the genconf-generated configurables.
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:332
std::vector
STL class.
GaudiHandle::isSet
bool isSet() const
True if the wrapped pointer is not null.
Definition: GaudiHandle.h:254
GaudiHandleBase::type
std::string type() const
The concrete component class name: the part before the '/'.
Definition: GaudiHandle.cpp:11
GaudiHandleInfo::GaudiHandleInfo
GaudiHandleInfo(std::string myComponentType, std::string myParentName)
Some basic information and helper functions shared between various handles/arrays.
Definition: GaudiHandle.h:35
GaudiHandleInfo::setPropertyName
void setPropertyName(std::string propName)
set name as used in declareProperty(name,gaudiHandle).
Definition: GaudiHandle.h:50
GaudiHandleArray::reverse_iterator
HandleVector::reverse_iterator reverse_iterator
Definition: GaudiHandle.h:405
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:337
Property.h
GaudiPython.Bindings.GaudiHandleProperty
GaudiHandleProperty
Definition: Bindings.py:53
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
operator<<
std::ostream & operator<<(std::ostream &os, const GaudiHandleInfo &handle)
Definition: GaudiHandle.cpp:95
GaudiHandleArray::end
iterator end()
Definition: GaudiHandle.h:457
GaudiHandleArray::operator[]
T & operator[](int index)
Definition: GaudiHandle.h:473
GaudiHandleArray::begin
const_iterator begin() const
Definition: GaudiHandle.h:459
GaudiHandleBase
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
Definition: GaudiHandle.h:89
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:120
GaudiHandleArrayBase::GaudiHandleArrayBase
GaudiHandleArrayBase(std::string myComponentType, std::string myParentName)
Definition: GaudiHandle.h:332
GaudiHandleArray::operator[]
T * operator[](const std::string &name)
Get pointer (!) to ToolHandle by instance name.
Definition: GaudiHandle.h:478
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
GaudiHandleArrayProperty
Definition: Property.h:882
IInterface.h
std::ostream
STL class.
GaudiHandleBase::GaudiHandleBase
GaudiHandleBase(std::string myTypeAndName, std::string myComponentType, std::string myParentName)
Create a handle ('smart pointer') to a gaudi component.
Definition: GaudiHandle.h:105
GaudiHandleInfo::m_propertyName
std::string m_propertyName
Definition: GaudiHandle.h:78
GaudiHandle::GaudiHandle
GaudiHandle(const GaudiHandle &other)
Copy constructor needed for correct ref-counting.
Definition: GaudiHandle.h:182
GaudiHandle::isValid
bool isValid() const
Check if the handle is valid (try to retrive the object is not done yet).
Definition: GaudiHandle.h:235
GaudiHandleArray
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:393
GaudiHandleInfo::m_parentName
std::string m_parentName
Definition: GaudiHandle.h:79
GaudiHandleArray::release
StatusCode release()
Release all tools.
Definition: GaudiHandle.h:512
GaudiHandleArray::GaudiHandleArray
GaudiHandleArray(const std::string &myComponentType, const std::string &myParentName)
Constructor creating an empty array.
Definition: GaudiHandle.h:426
GaudiHandleInfo
Definition: GaudiHandle.h:25