Logo ROOT  
Reference Guide
No Matches
RooFit::Detail::HashAssistedFind Struct Reference

Helper for hash-map-assisted finding of elements by name.

Create this helper if finding of elements by name is needed. Upon creation, this object checks the global RooNameReg::renameCounter() and tracks elements of this collection by name. If an element gets renamed, this counter will be increased, and the name to object map becomes invalid. In this case, it has to be recreated.

Definition at line 67 of file RooAbsCollection.cxx.

Public Member Functions

template<typename It_t >
 HashAssistedFind (It_t first, It_t last)
 Initialise empty hash map for fast finding by name.
void erase (const RooAbsArg *elm)
RooAbsArgfind (const TNamed *nptr) const
void insert (const RooAbsArg *elm)
bool isValid () const
void replace (const RooAbsArg *out, const RooAbsArg *in)

Public Attributes

const std::size_t & currentRooNameRegCounter
std::unordered_map< const TNamed *, const RooAbsArg *const > nameToItemMap
std::size_t rooNameRegCounterWhereMapWasValid = 0

Constructor & Destructor Documentation

◆ HashAssistedFind()

template<typename It_t >
RooFit::Detail::HashAssistedFind::HashAssistedFind ( It_t  first,
It_t  last 

Initialise empty hash map for fast finding by name.

Definition at line 71 of file RooAbsCollection.cxx.

Member Function Documentation

◆ erase()

void RooFit::Detail::HashAssistedFind::erase ( const RooAbsArg elm)

Definition at line 101 of file RooAbsCollection.cxx.

◆ find()

RooAbsArg * RooFit::Detail::HashAssistedFind::find ( const TNamed nptr) const

Definition at line 85 of file RooAbsCollection.cxx.

◆ insert()

void RooFit::Detail::HashAssistedFind::insert ( const RooAbsArg elm)

Definition at line 97 of file RooAbsCollection.cxx.

◆ isValid()

bool RooFit::Detail::HashAssistedFind::isValid ( ) const

Definition at line 81 of file RooAbsCollection.cxx.

◆ replace()

void RooFit::Detail::HashAssistedFind::replace ( const RooAbsArg out,
const RooAbsArg in 

Definition at line 92 of file RooAbsCollection.cxx.

Member Data Documentation

◆ currentRooNameRegCounter

const std::size_t& RooFit::Detail::HashAssistedFind::currentRooNameRegCounter

Definition at line 106 of file RooAbsCollection.cxx.

◆ nameToItemMap

std::unordered_map<const TNamed *, const RooAbsArg * const> RooFit::Detail::HashAssistedFind::nameToItemMap

Definition at line 105 of file RooAbsCollection.cxx.

◆ rooNameRegCounterWhereMapWasValid

std::size_t RooFit::Detail::HashAssistedFind::rooNameRegCounterWhereMapWasValid = 0

Definition at line 107 of file RooAbsCollection.cxx.

Collaboration diagram for RooFit::Detail::HashAssistedFind:

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