12#ifndef ROOT_TCollectionProxyInfo
13#define ROOT_TCollectionProxyInfo
25#include <forward_list>
34 #define TYPENAME typename
37 #define TYPENAME typename
76 static void*
get(
typename Cont_t::iterator &iter) {
77 return (
void*)&(*iter);
82 static void*
get(
typename Cont_t::iterator &iter) {
83 return (
void*)(*iter);
94 template <
typename Cont_t,
bool large = false>
135 template <
typename T>
struct Iterators<std::vector<T>,
false> {
136 typedef std::vector<T> Cont_t;
138 typedef typename Cont_t::iterator
iterator;
151 *(
void**)
dest = *(
void**)(
const_cast<void*
>(
source));
154 static void*
next(
void * ,
const void * ) {
163 R__ASSERT(0 &&
"Intentionally not implemented, do not use.");
169 static void destruct2(
void * ,
void * ) {
263 return const_cast<void*
>(
reinterpret_cast<const void*
>(&ref));
276 template <
class T,
class ALLOCATOR>
277 static size_t GetContainerSize(
const std::forward_list<T,ALLOCATOR>&
c) {
return std::distance(
c.begin(),
c.end());}
290 :
public Address<TYPENAME T::const_reference>
321 e->fIterator =
c->begin();
323 if ( 0 ==
e->fSize )
return e->fStart =
nullptr;
324 TYPENAME T::const_reference ref = *(
e->iter());
330 for (;
e->fIdx > 0 &&
e->iter() !=
c->end(); ++(
e->iter()), --
e->fIdx){ }
332 if (
e->iter() ==
c->end() )
return nullptr;
333 TYPENAME T::const_reference ref = *(
e->iter());
338 for (
size_t i=0; i<
size; ++i, ++
m)
345 for (
Iter_t i=
c->begin(); i !=
c->end(); ++i, ++
m )
351 for (
size_t i=0; i <
size; ++i, ++
m )
381 static void*
feed(
void *from,
void *to,
size_t size) {
384 for (
size_t i=0; i<
size; ++i, ++
m)
414 static void*
feed(
void *from,
void *to,
size_t size) {
416 if (
size==0)
return nullptr;
419 for (
size_t i=0; i<
size; ++i, --
m){
446 static void*
feed(
void *from,
void *to,
size_t size) {
449 for (
size_t i=0; i<
size; ++i, ++
m)
478 static void*
feed(
void *from,
void *to,
size_t size) {
481 for (
size_t i=0; i<
size; ++i, ++
m)
499 void* (*fSizeFunc)(
void*);
501 void* (*fClearFunc)(
void*);
502 void* (*fFirstFunc)(
void*);
503 void* (*fNextFunc)(
void*);
504 void* (*fConstructFunc)(
void*,size_t);
506 void* (*fFeedFunc)(
void*,
void*,size_t);
507 void* (*fCollectFunc)(
void*,
void*);
508 void* (*fCreateEnv)();
521 void* (*fNext)(
void *iter,
const void *end);
549 void* (*next)(
void *iter,
const void *end) =
nullptr,
575 (((
char*)&
p->second)-((
char*)&
p->first)),
587 T::Iterators_t::create,
588 T::Iterators_t::copy,
589 T::Iterators_t::next,
590 T::Iterators_t::destruct1,
591 T::Iterators_t::destruct2);
605 (((
char*)&
p->second)-((
char*)&
p->first)),
626 typedef std::vector<Bool_t, A>
Cont_t;
627 typedef typename Cont_t::iterator
Iter_t;
628 typedef typename Cont_t::value_type
Value_t;
655 e->fIterator =
c->begin();
656 e->fSize =
c->size();
662 for (;
e->fIdx > 0 &&
e->iter() !=
c->end(); ++(
e->iter()), --
e->fIdx){ }
673 for (
Iter_t i=
c->begin(); i !=
c->end(); ++i, ++
m )
677 static void destruct(
void*,
size_t) {
685 typedef typename Cont_t::iterator iterator;
688 PCont_t
c = PCont_t(
coll);
689 new (*begin_arena) iterator(
c->begin());
690 new (*end_arena) iterator(
c->end());
697 static void* next(
void *,
const void *) {
698 R__ASSERT(
false &&
"Intentionally not implemented, should use VectorLooper or similar for vector<bool>.");
701 static void destruct1(
void *
iter_ptr) {
716 template <
class A>
struct TCollectionProxyInfo::Pushback<std::vector<Bool_t, A> > :
public TCollectionProxyInfo::Type<std::vector<Bool_t, A> > {
717 typedef std::vector<Bool_t, A>
Cont_t;
718 typedef typename Cont_t::iterator
Iter_t;
719 typedef typename Cont_t::value_type
Value_t;
725 static void resize(
void* obj,
size_t n) {
729 static void*
feed(
void* from,
void *to,
size_t size) {
732 for (
size_t i=0; i<
size; ++i, ++
m)
742 template <
class A>
struct TCollectionProxyInfo::Address<std::vector<Bool_t, A>> {
744 static void*
address(
typename std::vector<Bool_t, A>::const_reference) {
745 R__ASSERT(
false &&
"Intentionally not implemented, should use VectorLooper or other functions specialized for "
746 "vector<bool> instead");
778 e->fIterator.first = 0;
779 e->fIterator.second =
c->size() > 0 ?
c->test(
e->fIterator.first) :
false ;
780 e->fSize =
c->size();
781 return &(
e->fIterator.second);
786 for (;
e->fIdx > 0 &&
e->fIterator.first !=
c->size(); ++(
e->fIterator.first), --
e->fIdx){ }
787 e->fIterator.second = (
e->fIterator.first !=
c->size()) ?
c->test(
e->fIterator.first) :
false;
788 return &(
e->fIterator.second);
797 for (
size_t i=0; i !=
c->size(); ++i, ++
m )
818 begin->first.fIndex = 0;
819 begin->second =
false;
821 end->first.fAddress =
coll;
833 if (iter->first.fIndex !=
c->size()) {
834 iter->second =
c->test(iter->first.fIndex);
835 ++(iter->first.fIndex);
836 return &(iter->second);
855 template <
typename Bitset_t>
868 static void*
feed(
void *from,
void *to,
size_t size) {
871 for (
size_t i=0; i<
size; ++i, ++
m)
883using namespace Detail;
Basic types used by ROOT and required by TInterpreter.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
winID h TVirtualViewer3D TVirtualGLPainter p
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
void *(* fCopyIterator)(void *dest, const void *source)
void *(* fConstructFunc)(void *, size_t)
void *(* fClearFunc)(void *)
static const UInt_t fgIteratorArenaSize
void *(* fFirstFunc)(void *)
void(* fDestructFunc)(void *, size_t)
TCollectionProxyInfo(const std::type_info &info, size_t iter_size, size_t value_diff, int value_offset, void *(*size_func)(void *), void(*resize_func)(void *, size_t), void *(*clear_func)(void *), void *(*first_func)(void *), void *(*next_func)(void *), void *(*construct_func)(void *, size_t), void(*destruct_func)(void *, size_t), void *(*feed_func)(void *, void *, size_t), void *(*collect_func)(void *, void *), void *(*create_env)(), void(*getIterators)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)=nullptr, void *(*copyIterator)(void *dest, const void *source)=nullptr, void *(*next)(void *iter, const void *end)=nullptr, void(*deleteSingleIterator)(void *iter)=nullptr, void(*deleteTwoIterators)(void *begin, void *end)=nullptr)
void(* fDeleteTwoIterators)(void *begin, void *end)
void *(* fCollectFunc)(void *, void *)
void *(* fSizeFunc)(void *)
void *(* fNextFunc)(void *)
void *(* fFeedFunc)(void *, void *, size_t)
void(* fDeleteSingleIterator)(void *iter)
void(* fResizeFunc)(void *, size_t)
static TCollectionProxyInfo Get(const T &)
void(* fCreateIterators)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
static TCollectionProxyInfo * Generate(const T &)
Generate proxy from template.
void *(* fNext)(void *iter, const void *end)
const std::type_info & fInfo
A "std::vector"-like collection of values implementing handy operation to analyse them.
Defines a common interface to inspect/change the contents of an object that represents a collection.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
static void * address(T ref)
EnvironBase(const EnvironBase &)
EnvironBase & operator=(const EnvironBase &)
Small helper to save proxy environment in the event of recursive calls.
Small helper to encapsulate all necessary data accesses for containers like set, multiset etc.
static void resize(void *, size_t)
static int value_offset()
static void * feed(void *from, void *to, size_t size)
static void * get(typename Cont_t::iterator &iter)
Small helper to encapsulate whether to return the value pointed to by the iterator or its address.
static void * get(typename Cont_t::iterator &iter)
Cont_t::iterator iterator
static void destruct2(void *begin_ptr, void *end_ptr)
static void * next(void *iter_loc, const void *end_loc)
static void create(void *coll, void **begin_arena, void **end_arena, TVirtualCollectionProxy *)
static void destruct1(void *begin_ptr)
static void * copy(void *, const void *source_ptr)
Small helper to implement the function to create,access and destroy iterators.
static void * next(void *iter_loc, const void *end_loc)
static void * copy(void *dest_arena, const void *source_ptr)
static void destruct2(void *begin_ptr, void *end_ptr)
static void create(void *coll, void **begin_arena, void **end_arena, TVirtualCollectionProxy *)
Cont_t::iterator iterator
static void destruct1(void *iter_ptr)
Small helper to encapsulate all necessary data accesses for containers like set, multiset etc.
static void resize(void *, size_t)
static int value_offset()
static void * feed(void *from, void *to, size_t size)
PairHolder & operator=(const PairHolder &)=delete
PairHolder(const PairHolder &c)
static void resize(void *, size_t)
static void * feed(void *from, void *to, size_t size)
static int value_offset()
Small helper to encapsulate all necessary data accesses for containers like vector,...
static void resize(void *obj, size_t n)
static void * feed(void *from, void *to, size_t size)
static int value_offset()
Small helper to encapsulate all necessary data accesses for containers like forward_list.
static void resize(void *obj, size_t n)
static int value_offset()
static void * feed(void *from, void *to, size_t size)
static size_t GetContainerSize(const std::forward_list< T, ALLOCATOR > &c)
static size_t GetContainerSize(const T &c)
static void destruct2(void *begin_ptr, void *end_ptr)
static void * copy(void *dest_arena, const void *source_ptr)
static void * next(void *iter_loc, const void *end_loc)
static void create(void *coll, void **begin_arena, void **end_arena, TVirtualCollectionProxy *)
std::pair< PtrSize_t, Bool_t > iterator
static void destruct1(void *iter_ptr)
static void destruct(void *, size_t)
std::pair< size_t, Bool_t > Iter_t
static void * construct(void *, size_t)
static void * collect(void *coll, void *array)
static void * next(void *env)
static void * first(void *env)
static void * clear(void *env)
static void * size(void *env)
static PCont_t object(void *ptr)
Small helper to encapsulate basic data accesses for all STL continers.
static const bool fgLargeIterator
static void * clear(void *env)
static void destruct(void *what, size_t size)
static void * first(void *env)
static void * size(void *env)
static void * next(void *env)
static void * construct(void *what, size_t size)
Iterators< Cont_t, fgLargeIterator > Iterators_t
static PCont_t object(void *ptr)
static void * collect(void *coll, void *array)