12#ifndef ROOT_TVirtualCollectionIterators
13#define ROOT_TVirtualCollectionIterators
56 ::Fatal(
"TIterators::TIterators",
"Created with out a collection proxy!\n");
115 virtual operator bool()
const = 0;
132 fNext( proxy->GetFunctionNext(read_from_file) ),
169 if ( ! (
bool)*
this )
return nullptr;
254 ::Fatal(
"TIterators::TIterators",
"Created with out a collection proxy!\n");
283 static void *
Next(
void *iter,
const void *end)
288 void **ptr = (
void**)internal_iter->
fNext(internal_iter->
fIter,internal_end->
fIter);
306 void *newiter = internal_source->
fCopy(
dest,internal_source->
fIter);
307 if (newiter ==
dest) {
308 internal_dest->
fDelete =
nullptr;
310 internal_dest->
fIter = newiter;
311 return internal_dest;
353 std::vector<char> *
vec = (std::vector<char>*)collection;
360#ifdef R__VISUAL_CPLUSPLUS
void Fatal(const char *location, const char *msgfmt,...)
Use this function in case of a fatal error. It will abort the program.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
TVirtualCollectionProxy::Next_t Next_t
RegularIterator(void *collection, TVirtualCollectionProxy *proxy, Bool_t read_from_file)
void * operator*() const override
VectorIterator(void *collection, TVirtualCollectionProxy *proxy, Bool_t read_from_file)
void * operator*() const override
TVirtualCollectionIterators fIterators
TGenericCollectionIterator(const TGenericCollectionIterator &)=delete
TGenericCollectionIterator & operator++()
TGenericCollectionIterator()=delete
static TGenericCollectionIterator * New(void *collection, TVirtualCollectionProxy *proxy)
virtual void * operator*() const =0
TGenericCollectionIterator(void *collection, TVirtualCollectionProxy *proxy, Bool_t read_from_file=kTRUE)
virtual ~TGenericCollectionIterator()
Small helper class to generically acquire and release iterators.
TVirtualCollectionIterators(const TVirtualCollectionIterators &)=delete
TVirtualCollectionProxy::CreateIterators_t CreateIterators_t
void CreateIterators(void *collection, TVirtualCollectionProxy *proxy)
TVirtualCollectionIterators(TVirtualCollectionProxy *proxy, Bool_t read_from_file=kTRUE)
DeleteTwoIterators_t fDeleteTwoIterators
TVirtualCollectionProxy::DeleteTwoIterators_t DeleteTwoIterators_t
char fEndBuffer[TVirtualCollectionProxy::fgIteratorArenaSize]
TVirtualCollectionIterators()=delete
CreateIterators_t fCreateIterators
~TVirtualCollectionIterators()
TVirtualCollectionIterators(CreateIterators_t creator, DeleteTwoIterators_t destruct)
char fBeginBuffer[TVirtualCollectionProxy::fgIteratorArenaSize]
Defines a common interface to inspect/change the contents of an object that represents a collection.
void(* CreateIterators_t)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
*begin_arena and *end_arena should contain the location of a memory arena of size fgIteratorArenaSize...
void *(* CopyIterator_t)(void *dest, const void *source)
Copy the iterator source into dest.
void *(* Next_t)(void *iter, const void *end)
iter and end should be pointers to an iterator to be incremented and an iterator that points to the e...
virtual Int_t GetCollectionType() const =0
Return the type of the proxied collection (see enumeration TClassEdit::ESTLType)
virtual Next_t GetFunctionNext(Bool_t read=kTRUE)=0
Return a pointer to a function that can advance an iterator (see Next_t).
virtual DeleteTwoIterators_t GetFunctionDeleteTwoIterators(Bool_t read=kTRUE)=0
void(* DeleteTwoIterators_t)(void *begin, void *end)
void(* DeleteIterator_t)(void *iter)
If the size of the iterator is greater than fgIteratorArenaSize, call delete on the addresses; otherw...
static const Int_t fgIteratorArenaSize
The size of a small buffer that can be allocated on the stack to store iterator-specific information.
virtual CreateIterators_t GetFunctionCreateIterators(Bool_t read=kTRUE)=0
Return a pointer to a function that can create an iterator pair, where each iterator points to the be...
virtual DeleteIterator_t GetFunctionDeleteIterator(Bool_t read=kTRUE)=0
Return a pointer to a function that can delete an iterator (pair) (see DeleteIterator_t).
virtual CopyIterator_t GetFunctionCopyIterator(Bool_t read=kTRUE)=0
Return a pointer to a function that can copy an iterator (see CopyIterator_t).
TVirtualCollectionPtrIterators(const TVirtualCollectionPtrIterators &)
TVirtualCollectionProxy::DeleteIterator_t Delete_t
char fRawBeginBuffer[TVirtualCollectionProxy::fgIteratorArenaSize]
TVirtualCollectionProxy::CreateIterators_t CreateIterators_t
TVirtualCollectionProxy::Next_t Next_t
DeleteTwoIterators_t fDeleteTwoIterators
void CreateIterators(void *collection, TVirtualCollectionProxy *proxy)
TVirtualCollectionPtrIterators()
static void DeleteIterator(void *iter)
TVirtualCollectionPtrIterators(TVirtualCollectionProxy *proxy)
TVirtualCollectionProxy::DeleteTwoIterators_t DeleteTwoIterators_t
TInternalIterator fBeginBuffer
TVirtualCollectionProxy::CopyIterator_t Copy_t
char fRawEndBuffer[TVirtualCollectionProxy::fgIteratorArenaSize]
static void * Next(void *iter, const void *end)
TInternalIterator fEndBuffer
CreateIterators_t fCreateIterators
static void * CopyIterator(void *dest, const void *source)
~TVirtualCollectionPtrIterators()
TInternalIterator & operator=(const TInternalIterator &)
TInternalIterator(const TInternalIterator &source)
TVirtualVectorIterators(TVirtualCollectionProxy *)
void CreateIterators(void *collection)
TVirtualCollectionProxy::CreateIterators_t CreateIterators_t
TVirtualVectorIterators(const TVirtualVectorIterators &)
TVirtualVectorIterators(CreateIterators_t)
TVirtualVectorIterators()