ATLAS Offline Software
Loading...
Searching...
No Matches
IDTPM2::IFinder< T > Class Template Referenceabstract

#include <AncestorFinder.h>

Inheritance diagram for IDTPM2::IFinder< T >:
Collaboration diagram for IDTPM2::IFinder< T >:

Public Member Functions

virtual ~IFinder ()=default
const T * findAncestor (const T *t) const
virtual bool predicate (const T *t) const =0

Detailed Description

template<typename T>
class IDTPM2::IFinder< T >

Definition at line 27 of file AncestorFinder.h.

Constructor & Destructor Documentation

◆ ~IFinder()

template<typename T>
virtual IDTPM2::IFinder< T >::~IFinder ( )
virtualdefault

Member Function Documentation

◆ findAncestor()

template<typename T>
const T * IDTPM2::IFinder< T >::findAncestor ( const T * t) const
inline

successful stopping condition ...

isn't recursion great boys and girls ?

Definition at line 33 of file AncestorFinder.h.

33 {
34
35 // reached the end ...
36 if (!t) return 0;
37
39 if ( predicate(t) ) return t;
40
41 for ( size_t p=0 ; p<t->nParents() ; p++ ) {
42 const T* parent = t->parent(p);
43
44 if ( parent==t ) continue;
45
47 if ( const T* found = findAncestor(parent) ) return found;
48 }
49
50 return 0;
51 }
const T * findAncestor(const T *t) const
virtual bool predicate(const T *t) const =0

◆ predicate()


The documentation for this class was generated from the following file: