Logo ROOT   6.16/01
Reference Guide
List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions | Friends | List of all members
ROOT::Detail::TTypedIter< Containee > Class Template Reference

template<class Containee>
class ROOT::Detail::TTypedIter< Containee >

TTypedIter is a typed version of TIter.

This requires the collection to contains elements of the type requested (or a derived class). Any deviation from this expectation will only be caught/reported by an assert in debug builds.

This is best used with a TClonesArray, for other cases prefered TRangeDynCast.

The typical use is: ~~~ {.cpp} TTypedIter<TBaseClass> next(tbaseClassClonesArrayPtr); while(auto bcl = next()) { ... use bcl as a TBaseClass* } ~~~ {.cpp}

Definition at line 336 of file TCollection.h.

Public Member Functions

 TTypedIter (const TIter &iter)
 
 ClassDefInline (TTypedIter, 0)
 
Containee * Next ()
 
Containee * operator() ()
 
Containee * operator* () const
 
 TIter ()
 
 TIter (const TCollection *col, Bool_t dir=kIterForward)
 
 TIter (const TIter &iter)
 Copy a TIter. More...
 
 TIter (TIterator *it)
 
- Public Member Functions inherited from TIter
 TIter (const TCollection *col, Bool_t dir=kIterForward)
 
 TIter (const TIter &iter)
 Copy a TIter. More...
 
 TIter (TIterator *it)
 
virtual ~TIter ()
 
TIterBegin ()
 Pointing to the first element of the container. More...
 
const TCollectionGetCollection () const
 
Option_tGetOption () const
 
TObjectNext ()
 
Bool_t operator!= (const TIter &aIter) const
 
TObjectoperator() ()
 
TObjectoperator* () const
 
TIteroperator++ ()
 
TIteroperator= (const TIter &rhs)
 Assigning an TIter to another. More...
 
Bool_t operator== (const TIter &aIter) const
 
void Reset ()
 

Private Member Functions

 TTypedIter ()=default
 

Static Private Member Functions

static Containee * StaticCast (TObject *obj)
 

Friends

template<class T >
class ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector
 This is a workaround against ClassDefInline not supporting classes missing their default constructor or having them private. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from TIter
static TIter End ()
 Pointing to the element after the last - to a nullptr value in our case. More...
 
- Protected Member Functions inherited from TIter
 TIter ()
 

#include <TCollection.h>

Inheritance diagram for ROOT::Detail::TTypedIter< Containee >:
[legend]

Constructor & Destructor Documentation

◆ TTypedIter() [1/2]

template<class Containee >
ROOT::Detail::TTypedIter< Containee >::TTypedIter ( )
privatedefault

◆ TTypedIter() [2/2]

template<class Containee >
ROOT::Detail::TTypedIter< Containee >::TTypedIter ( const TIter iter)
inline

Definition at line 354 of file TCollection.h.

Member Function Documentation

◆ ClassDefInline()

template<class Containee >
ROOT::Detail::TTypedIter< Containee >::ClassDefInline ( TTypedIter< Containee >  ,
 
)

◆ Next()

template<class Containee >
Containee * ROOT::Detail::TTypedIter< Containee >::Next ( )
inline

Definition at line 357 of file TCollection.h.

◆ operator()()

template<class Containee >
Containee * ROOT::Detail::TTypedIter< Containee >::operator() ( )
inline

Definition at line 356 of file TCollection.h.

◆ operator*()

template<class Containee >
Containee * ROOT::Detail::TTypedIter< Containee >::operator* ( ) const
inline

Definition at line 358 of file TCollection.h.

◆ StaticCast()

template<class Containee >
static Containee * ROOT::Detail::TTypedIter< Containee >::StaticCast ( TObject obj)
inlinestaticprivate

Definition at line 346 of file TCollection.h.

◆ TIter() [1/4]

template<class Containee >
TIter::TIter ( )
inline

Definition at line 239 of file TCollection.h.

◆ TIter() [2/4]

template<class Containee >
TIter::TIter ( const TCollection col,
Bool_t  dir = kIterForward 
)
inline

Definition at line 242 of file TCollection.h.

◆ TIter() [3/4]

template<class Containee >
TIter::TIter ( const TIter iter)

Copy a TIter.

This involves allocating a new TIterator of the right sub class and assigning it with the original.

Definition at line 245 of file TCollection.cxx.

◆ TIter() [4/4]

template<class Containee >
TIter::TIter ( TIterator it)
inline

Definition at line 244 of file TCollection.h.

Friends And Related Function Documentation

◆ ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector

template<class Containee >
template<class T >
friend class ROOT::Internal::ClassDefGenerateInitInstanceLocalInjector
friend

This is a workaround against ClassDefInline not supporting classes missing their default constructor or having them private.

Definition at line 342 of file TCollection.h.

Libraries for ROOT::Detail::TTypedIter< Containee >:
[legend]

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