The Gaudi Framework  master (01b473db)
GaudiHandle.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #pragma once
12 
13 #include <Gaudi/Property.h>
15 #include <GaudiKernel/IInterface.h>
16 #include <GaudiKernel/System.h>
17 #include <algorithm>
18 #include <iostream>
19 #include <string>
20 #include <type_traits>
21 #include <vector>
22 
23 namespace details {
25  template <class T>
26  std::remove_const_t<T>* nonConst( T* p ) {
27  return const_cast<std::remove_const_t<T>*>( p );
28  }
29 } // namespace details
30 
32 protected:
41  GaudiHandleInfo( std::string myComponentType, std::string myParentName )
42  : m_componentType( std::move( myComponentType ) ), m_parentName( std::move( myParentName ) ) {}
43 
44 public:
46  // Don't use =default here. Otherwise, in c++20 mode, clang will
47  // instantiate the handle virtual functions early, breaking the case
48  // where handles are used with a forward-declared class.
49  virtual ~GaudiHandleInfo() {}
50  //
51  // Public member functions
52  //
53  const std::string& componentType() const { return m_componentType; }
54 
56  const std::string& propertyName() const { return m_propertyName; }
57 
59  void setPropertyName( std::string propName ) { m_propertyName = std::move( propName ); }
60 
62  const std::string& parentName() const { return m_parentName; }
63 
67  virtual std::string pythonPropertyClassName() const = 0;
68 
73  virtual std::string pythonRepr() const = 0;
74 
75  // Easy printing out of Handles and HandleArrays
76  // It prints <propertyName> = <HandleType>( <HandleType(s)AndName(s)> )
77  friend std::ostream& operator<<( std::ostream& os, const GaudiHandleInfo& handle );
78 
79 protected:
81  void setComponentType( std::string componentType ) { m_componentType = std::move( componentType ); }
82 
84  void setParentName( std::string parent ) { m_parentName = std::move( parent ); }
85 
86 private:
87  //
88  // Data members
89  //
90  std::string m_componentType; // e.g.: "PublicTool","PrivateTool","Service"
91  std::string m_propertyName; // name as used in declareProperty(name,gaudiHandle)
92  std::string m_parentName; // name of the parent having this handle as a member
93 };
94 
103  //
104  // Ctors etc
105  //
106 protected:
118  GaudiHandleBase( std::string myTypeAndName, std::string myComponentType, std::string myParentName )
119  : GaudiHandleInfo( std::move( myComponentType ), std::move( myParentName ) ) {
120  setTypeAndName( std::move( myTypeAndName ) );
121  }
122 
123 public:
124  //
125  // Public member functions
126  //
128  const std::string& typeAndName() const { return m_typeAndName; }
129 
131  std::string type() const;
132 
134  std::string name() const;
135 
137  bool empty() const { return m_typeAndName.empty(); }
138 
140  void setTypeAndName( std::string myTypeAndName );
141 
143  void setName( std::string_view myName );
144 
148  std::string pythonPropertyClassName() const override;
149 
151  std::string messageName() const;
152 
156  std::string pythonRepr() const override;
157 
159 
160 private:
161  //
162  // Data member
163  //
164  std::string m_typeAndName; // the full type and name: "type/name"
165 };
166 
175 template <class T>
177  //
178  // Constructors etc.
179  //
180 protected:
181  GaudiHandle( std::string myTypeAndName, std::string myComponentType, std::string myParentName )
182  : GaudiHandleBase( std::move( myTypeAndName ), std::move( myComponentType ), std::move( myParentName ) ) {}
183 
184 public:
186  template <typename CT = T, typename NCT = std::remove_const_t<T>>
188  requires( std::is_const_v<CT> && !std::is_same_v<CT, NCT> )
189  : GaudiHandleBase( other ), m_pObject( other.get() ) {
190  if ( m_pObject ) ::details::nonConst( m_pObject.load() )->addRef();
191  }
192 
194  GaudiHandle( const GaudiHandle& other ) : GaudiHandleBase( other ), m_pObject( other.m_pObject.load() ) {
195  if ( m_pObject ) ::details::nonConst( m_pObject.load() )->addRef();
196  }
197 
199  template <typename CT = T, typename NCT = std::remove_const_t<T>>
200  requires( std::is_const_v<CT> && !std::is_same_v<CT, NCT> )
201  GaudiHandle& operator=( const GaudiHandle<NCT>& other ) {
202  GaudiHandleBase::operator=( other );
203  // release any current tool
204  release().ignore();
205  m_pObject = other.get();
206  // update ref-counting
207  if ( m_pObject ) ::details::nonConst( m_pObject.load() )->addRef();
208  return *this;
209  }
210 
212  GaudiHandle& operator=( const GaudiHandle& other ) {
213  GaudiHandleBase::operator=( other );
214  // release any current tool
215  release().ignore();
216  m_pObject = other.m_pObject.load();
217  // update ref-counting
218  if ( m_pObject ) ::details::nonConst( m_pObject.load() )->addRef();
219  return *this;
220  }
221 
223  StatusCode retrieve() const {
224  // not really const, because it updates m_pObject
225  // Do the lookup into a temporary pointer.
226  T* p = nullptr;
227  if ( retrieve( p ).isFailure() ) { return StatusCode::FAILURE; }
228 
229  // If m_pObject is null, then copy p to m_pObject.
230  // Otherwise, release p.
231  T* old = nullptr;
232  if ( m_pObject.compare_exchange_strong( old, p ) ) { return StatusCode::SUCCESS; }
233  return release( p );
234  }
235 
237  StatusCode release() const {
238  // not really const, because it updates m_pObject
240  if ( m_pObject ) {
241  sc = release( m_pObject );
242  m_pObject = nullptr;
243  }
244  return sc;
245  }
246 
248  bool isValid() const {
249  // not really const, because it may update m_pObject
250  return m_pObject || retrieve().isSuccess();
251  }
252 
255  operator bool() const {
256  // not really const, because it may update m_pObject
257  return isValid();
258  }
259 
261  T* get() { return m_pObject; }
262 
264  std::add_const_t<T>* get() const { return m_pObject; }
265 
267  bool isSet() const { return get(); }
268 
269  T& operator*() {
270  assertObject();
271  return *m_pObject;
272  }
273 
274  T* operator->() {
275  assertObject();
276  return m_pObject;
277  }
278 
279  std::add_const_t<T>& operator*() const {
280  // not really const, because it may update m_pObject
281  assertObject();
282  return *m_pObject;
283  }
284 
285  std::add_const_t<T>* operator->() const {
286  // not really const, because it may update m_pObject
287  assertObject();
288  return m_pObject;
289  }
290 
292  std::string getDefaultType() { return System::typeinfoName( typeid( T ) ); }
293 
294  std::string getDefaultName() {
295  const auto defName = GaudiHandleBase::type();
296  return ( defName.empty() ? getDefaultType() : defName );
297  }
298 
299 protected:
301  virtual StatusCode retrieve( T*& ) const = 0; // not really const, because it updates m_pObject
302 
305  virtual StatusCode release( T* comp ) const { // not really const, because it updates m_pObject
306  // const cast to support T being a const type
307  ::details::nonConst( comp )->release();
308  return StatusCode::SUCCESS;
309  }
310 
311 private:
314  void assertObject() const { // not really const, because it may update m_pObject
315  if ( !isValid() ) {
316  throw GaudiException( "Failed to retrieve " + componentType() + ": " + typeAndName(),
317  componentType() + " retrieve", StatusCode::FAILURE );
318  }
319  }
320 
321 private:
322  //
323  // Data members
324  //
325  mutable std::atomic<T*> m_pObject = nullptr;
326 };
327 
335 protected:
336  GaudiHandleArrayBase( std::string myComponentType, std::string myParentName )
337  : GaudiHandleInfo( std::move( myComponentType ), std::move( myParentName ) ) {}
338 
339 public:
341  typedef std::vector<GaudiHandleBase*> BaseHandleArray;
342  typedef std::vector<const GaudiHandleBase*> ConstBaseHandleArray;
343 
346  bool setTypesAndNames( const std::vector<std::string>& myTypesAndNamesList );
347 
350  const std::vector<std::string> typesAndNames() const;
351 
353  const std::vector<std::string> types() const;
354 
356  const std::vector<std::string> names() const;
357 
360  const std::vector<std::string> getBaseInfos( auto ( GaudiHandleBase::*pMemFunc )() const ) const;
361 
365  std::string pythonPropertyClassName() const override;
366 
370  std::string pythonRepr() const override;
371 
375  virtual bool push_back( const std::string& myHandleTypeAndName ) = 0;
376 
378  virtual void clear() = 0;
379 
381  virtual bool empty() const = 0;
382 
385  virtual ConstBaseHandleArray getBaseArray() const = 0;
386 
390 
392  virtual bool retrieved() const = 0;
393 };
394 
396 template <class T>
398 public:
399  //
400  // public nested types
401  //
402  typedef std::vector<T> HandleVector;
403  typedef typename HandleVector::value_type value_type;
404  typedef typename HandleVector::size_type size_type;
406  typedef typename HandleVector::const_reference const_reference;
407  typedef typename HandleVector::iterator iterator;
408  typedef typename HandleVector::const_iterator const_iterator;
409  typedef typename HandleVector::reverse_iterator reverse_iterator;
410  typedef typename HandleVector::const_reverse_iterator const_reverse_iterator;
411 
412 protected:
413  //
414  // Constructors
415  //
420  GaudiHandleArray( const std::vector<std::string>& myTypesAndNamesList, std::string myComponentType,
421  std::string myParentName )
422  : GaudiHandleArrayBase( std::move( myComponentType ), std::move( myParentName ) ) {
423  setTypesAndNames( myTypesAndNamesList );
424  }
425 
430  GaudiHandleArray( const std::string& myComponentType, const std::string& myParentName )
431  : GaudiHandleArrayBase( myComponentType, myParentName ) {}
432 
433 public:
435  GaudiHandleArray& operator=( const std::vector<std::string>& myTypesAndNamesList ) {
436  setTypesAndNames( myTypesAndNamesList );
437  return *this;
438  }
439 
442  for ( auto& h : m_handleArray ) baseArray.push_back( &h );
443  return baseArray;
444  }
445 
448  for ( auto& h : m_handleArray ) baseArray.push_back( &h );
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[]( std::string_view 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[]( std::string_view 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 
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 
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  //
529  bool m_retrieved{ false };
530 };
GaudiHandleArray::operator[]
T * operator[](std::string_view name)
Get pointer (!) to ToolHandle by instance name.
Definition: GaudiHandle.h:478
GaudiHandleInfo::parentName
const std::string & parentName() const
The name of the parent.
Definition: GaudiHandle.h:62
GaudiHandleArray::begin
const_iterator begin() const
Definition: GaudiHandle.h:459
GaudiHandleArray::size
size_type size() const
Definition: GaudiHandle.h:467
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:40
GaudiHandleArray::operator[]
const T & operator[](int index) const
Definition: GaudiHandle.h:475
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
GaudiPartProp.decorators.std
std
Definition: decorators.py:32
GaudiPython.Bindings.GaudiHandleArrayProperty
GaudiHandleArrayProperty
Definition: Bindings.py:81
System.h
GaudiHandleArray::retrieve
StatusCode retrieve()
Retrieve all tools.
Definition: GaudiHandle.h:498
GaudiException.h
GaudiHandleArray::push_back
virtual bool push_back(const T &myHandle)
Definition: GaudiHandle.h:492
GaudiPython.Bindings.GaudiHandleProperty
GaudiHandleProperty
Definition: Bindings.py:80
GaudiException
Definition: GaudiException.h:29
GaudiPartProp.decorators.get
get
decorate the vector of properties
Definition: decorators.py:283
GaudiHandleArray::empty
bool empty() const override
Return whether the list of tools is empty.
Definition: GaudiHandle.h:471
conf.release
string release
Definition: conf.py:27
GaudiHandleBase::empty
bool empty() const
Check if the handle has been set to empty string (i.e.
Definition: GaudiHandle.h:137
ProduceConsume.types
types
Definition: ProduceConsume.py:59
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:260
GaudiHandleInfo::componentType
const std::string & componentType() const
Definition: GaudiHandle.h:53
GaudiHandleArrayBase::ConstBaseHandleArray
std::vector< const GaudiHandleBase * > ConstBaseHandleArray
Definition: GaudiHandle.h:342
GaudiHandle::GaudiHandle
GaudiHandle(const GaudiHandle< NCT > &other) requires(std
Copy constructor needed for correct ref-counting.
Definition: GaudiHandle.h:187
Gaudi::Functional::details::detail2::requires
requires requires
Definition: details.h:419
GaudiHandle::GaudiHandle
GaudiHandle(std::string myTypeAndName, std::string myComponentType, std::string myParentName)
Definition: GaudiHandle.h:181
GaudiHandleInfo::setParentName
void setParentName(std::string parent)
The name of the parent.
Definition: GaudiHandle.h:84
GaudiHandleArray::operator[]
T & operator[](int index)
Definition: GaudiHandle.h:473
GaudiHandleArray::release
StatusCode release()
Release all tools.
Definition: GaudiHandle.h:512
GaudiHandleArray::end
iterator end()
Definition: GaudiHandle.h:457
GaudiHandleBase
Definition: GaudiHandle.h:102
GaudiHandle
Definition: GaudiHandle.h:176
GaudiHandleArray::GaudiHandleArray
GaudiHandleArray(const std::vector< std::string > &myTypesAndNamesList, std::string myComponentType, std::string myParentName)
Generic constructor.
Definition: GaudiHandle.h:420
GaudiHandleInfo::m_parentName
std::string m_parentName
Definition: GaudiHandle.h:92
GaudiHandleArray::getBaseArray
GaudiHandleArrayBase::BaseHandleArray getBaseArray() override
Get a read-write vector of GaudiHandleBase* pointing to the real handles.
Definition: GaudiHandle.h:440
GaudiHandleArray::reference
HandleVector::reference reference
Definition: GaudiHandle.h:405
GaudiHandleArray::rend
const_iterator rend() const
Definition: GaudiHandle.h:465
GaudiHandleArray::end
const_iterator end() const
Definition: GaudiHandle.h:461
GaudiHandleArray::HandleVector
std::vector< T > HandleVector
Definition: GaudiHandle.h:402
GaudiHandle::release
virtual StatusCode release(T *comp) const
Release the component.
Definition: GaudiHandle.h:305
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:135
GaudiHandleArray::const_iterator
HandleVector::const_iterator const_iterator
Definition: GaudiHandle.h:408
details::nonConst
std::remove_const_t< T > * nonConst(T *p)
Cast a pointer to a non const type.
Definition: GaudiHandle.h:26
StatusCode
Definition: StatusCode.h:64
IInterface.h
details
Definition: AnyDataWrapper.h:19
GaudiHandle::GaudiHandle
GaudiHandle(const GaudiHandle &other)
Copy constructor needed for correct ref-counting.
Definition: GaudiHandle.h:194
Gaudi::Parsers::operator<<
std::ostream & operator<<(std::ostream &o, const Catalog &c)
printout operator
Definition: Catalog.h:49
GaudiHandleBase::m_typeAndName
std::string m_typeAndName
Definition: GaudiHandle.h:164
GaudiHandleInfo::propertyName
const std::string & propertyName() const
name as used in declareProperty(name,gaudiHandle)
Definition: GaudiHandle.h:56
AlgSequencer.h
h
Definition: AlgSequencer.py:31
GaudiHandleInfo::m_propertyName
std::string m_propertyName
Definition: GaudiHandle.h:91
GaudiHandleArray::size_type
HandleVector::size_type size_type
Definition: GaudiHandle.h:404
GaudiHandleArray::GaudiHandleArray
GaudiHandleArray(const std::string &myComponentType, const std::string &myParentName)
Constructor creating an empty array.
Definition: GaudiHandle.h:430
GaudiHandle::m_pObject
std::atomic< T * > m_pObject
Definition: GaudiHandle.h:325
GaudiHandleArrayBase::clear
virtual void clear()=0
Clear the list of handles.
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:435
GaudiHandleArrayBase::retrieved
virtual bool retrieved() const =0
To be able to tell if Array was ever retreived.
GaudiHandleArrayBase::getBaseArray
virtual ConstBaseHandleArray getBaseArray() const =0
Get a read-only vector of const GaudiHandleBase* pointing to the real handles.
GaudiHandleArray::clear
void clear() override
Clear the list of handles.
Definition: GaudiHandle.h:469
GaudiHandleArray::retrieved
virtual bool retrieved() const override
has Array been retreived?
Definition: GaudiHandle.h:522
GaudiHandleArrayBase
Base class of array's of various gaudihandles.
Definition: GaudiHandle.h:334
GaudiHandleProperty
Definition: Property.h:569
GaudiHandle::requires
requires(std::is_const_v< CT > &&!std::is_same_v< CT, NCT >) GaudiHandle &operator
Assignment operator for correct ref-counting.
GaudiHandleInfo::GaudiHandleInfo
GaudiHandleInfo(std::string myComponentType, std::string myParentName)
Some basic information and helper functions shared between various handles/arrays.
Definition: GaudiHandle.h:41
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:63
GaudiHandleInfo::~GaudiHandleInfo
virtual ~GaudiHandleInfo()
virtual destructor so that derived class destructor is called.
Definition: GaudiHandle.h:49
GaudiHandleArray::const_reference
HandleVector::const_reference const_reference
Definition: GaudiHandle.h:406
GaudiHandleBase::type
std::string type() const
The concrete component class name: the part before the '/'.
Definition: GaudiHandle.cpp:21
gaudirun.type
type
Definition: gaudirun.py:160
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:99
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
GaudiHandleArray::m_handleArray
HandleVector m_handleArray
Definition: GaudiHandle.h:528
GaudiHandleArrayBase::BaseHandleArray
std::vector< GaudiHandleBase * > BaseHandleArray
Definition: GaudiHandle.h:341
GaudiHandleArrayBase::push_back
virtual bool push_back(const std::string &myHandleTypeAndName)=0
Add a handle to the array with "type/name" given in <myHandleTypeAndName>.
GaudiHandleInfo::pythonPropertyClassName
virtual std::string pythonPropertyClassName() const =0
The python class name for the property in the genconf-generated configurables.
GaudiHandleArray::reverse_iterator
HandleVector::reverse_iterator reverse_iterator
Definition: GaudiHandle.h:409
GaudiHandleInfo::setComponentType
void setComponentType(std::string componentType)
The component type.
Definition: GaudiHandle.h:81
fixtures.reference
Generator[dict, None, None] reference(request, Optional[Path] reference_path)
Definition: fixtures.py:211
GaudiHandleInfo
Definition: GaudiHandle.h:31
GaudiHandleBase::typeAndName
const std::string & typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:128
GaudiHandleBase::GaudiHandleBase
GaudiHandleBase(std::string myTypeAndName, std::string myComponentType, std::string myParentName)
Create a handle ('smart pointer') to a gaudi component.
Definition: GaudiHandle.h:118
GaudiHandleArrayBase::GaudiHandleArrayBase
GaudiHandleArrayBase(std::string myComponentType, std::string myParentName)
Definition: GaudiHandle.h:336
GaudiHandleArray::iterator
HandleVector::iterator iterator
Definition: GaudiHandle.h:407
GaudiHandleArray::begin
iterator begin()
Definition: GaudiHandle.h:455
GaudiHandleArrayBase::getBaseArray
virtual BaseHandleArray getBaseArray()=0
Get a read-write vector of GaudiHandleBase* pointing to the real handles.
GaudiHandleArray::operator[]
const T * operator[](std::string_view name) const
Get const pointer (!) to ToolHandle by instance name.
Definition: GaudiHandle.h:484
GaudiHandleArray::const_reverse_iterator
HandleVector::const_reverse_iterator const_reverse_iterator
Definition: GaudiHandle.h:410
GaudiHandleArray::rbegin
const_iterator rbegin() const
Definition: GaudiHandle.h:463
IOTest.end
end
Definition: IOTest.py:125
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:100
GaudiHandleInfo::setPropertyName
void setPropertyName(std::string propName)
set name as used in declareProperty(name,gaudiHandle).
Definition: GaudiHandle.h:59
GaudiHandleInfo::m_componentType
std::string m_componentType
Definition: GaudiHandle.h:90
GaudiHandleInfo::pythonRepr
virtual std::string pythonRepr() const =0
Python representation of handle, i.e.
GaudiHandleArray::getBaseArray
GaudiHandleArrayBase::ConstBaseHandleArray getBaseArray() const override
Get a read-only vector of const GaudiHandleBase* pointing to the real handles.
Definition: GaudiHandle.h:446
GaudiHandleArray
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:397
GaudiHandleArrayProperty
Definition: Property.h:606
GaudiHandle::assertObject
void assertObject() const
Load the pointer to the component.
Definition: GaudiHandle.h:314
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:49
GaudiHandleArray::value_type
HandleVector::value_type value_type
Definition: GaudiHandle.h:403
Property.h
Gaudi::ParticleProperties::index
size_t index(const Gaudi::ParticleProperty *property, const Gaudi::Interfaces::IParticlePropertySvc *service)
helper utility for mapping of Gaudi::ParticleProperty object into non-negative integral sequential id...
Definition: IParticlePropertySvc.cpp:39
GaudiHandleArrayBase::empty
virtual bool empty() const =0
Return whether the list of tools is empty.