12#ifndef ROOT_TCollectionProxyInfo
13#define ROOT_TCollectionProxyInfo
25#include <forward_list>
32 #define TYPENAME typename
35 #define TYPENAME typename
68 static void*
get(
typename Cont_t::iterator &iter) {
69 return (
void*)&(*iter);
73 template <
typename Cont_t,
typename value_ptr>
struct IteratorValue<Cont_t, value_ptr*> {
74 static void*
get(
typename Cont_t::iterator &iter) {
75 return (
void*)(*iter);
86 template <
typename Cont_t,
bool large = false>
96 static void*
copy(
void *dest_arena,
const void *source_ptr) {
101 static void*
next(
void *iter_loc,
const void *end_loc) {
127 template <
typename T>
struct Iterators<std::vector<T>, false> {
128 typedef std::vector<T> Cont_t;
130 typedef typename Cont_t::iterator
iterator;
139 *begin_arena = &(*
c->begin());
140#ifdef R__VISUAL_CPLUSPLUS
141 *end_arena = &(*(
c->end()-1)) + 1;
144 *end_arena = &(*
c->end());
147 static void*
copy(
void *
dest,
const void *source) {
148 *(
void**)
dest = *(
void**)(
const_cast<void*
>(source));
151 static void*
next(
void * ,
const void * ) {
160 R__ASSERT(0 &&
"Intentionally not implemented, do not use.");
166 static void destruct2(
void * ,
void * ) {
171 template <
typename Cont_t>
struct Iterators<Cont_t, true > {
180 static void*
copy(
void * ,
const void *source_ptr) {
185 static void*
next(
void *iter_loc,
const void *end_loc) {
260 return const_cast<void*
>(
reinterpret_cast<const void*
>(&ref));
273 template <
class T,
class ALLOCATOR>
274 static size_t GetContainerSize(
const std::forward_list<T,ALLOCATOR>&
c) {
return std::distance(
c.begin(),
c.end());}
287 :
public Address<TYPENAME T::const_reference>
318 e->fIterator =
c->begin();
320 if ( 0 ==
e->fSize )
return e->fStart = 0;
321 TYPENAME T::const_reference ref = *(
e->iter());
327 for (;
e->fIdx > 0 &&
e->iter() !=
c->end(); ++(
e->iter()), --
e->fIdx){ }
329 if (
e->iter() ==
c->end() )
return 0;
330 TYPENAME T::const_reference ref = *(
e->iter());
335 for (
size_t i=0; i<
size; ++i, ++
m)
339 static void*
collect(
void *coll,
void *array) {
342 for (
Iter_t i=
c->begin(); i !=
c->end(); ++i, ++
m )
348 for (
size_t i=0; i <
size; ++i, ++
m )
378 static void*
feed(
void *from,
void *to,
size_t size) {
381 for (
size_t i=0; i<
size; ++i, ++
m)
411 static void*
feed(
void *from,
void *to,
size_t size) {
413 if (
size==0)
return 0;
416 for (
size_t i=0; i<
size; ++i, --
m){
443 static void*
feed(
void *from,
void *to,
size_t size) {
446 for (
size_t i=0; i<
size; ++i, ++
m)
475 static void*
feed(
void *from,
void *to,
size_t size) {
478 for (
size_t i=0; i<
size; ++i, ++
m)
496 void* (*fSizeFunc)(
void*);
498 void* (*fClearFunc)(
void*);
499 void* (*fFirstFunc)(
void*);
500 void* (*fNextFunc)(
void*);
501 void* (*fConstructFunc)(
void*,size_t);
503 void* (*fFeedFunc)(
void*,
void*,size_t);
504 void* (*fCollectFunc)(
void*,
void*);
505 void* (*fCreateEnv)();
513 void* (*fCopyIterator)(
void *
dest,
const void *source);
518 void* (*fNext)(
void *iter,
const void *end);
534 void* (*size_func)(
void*),
535 void (*resize_func)(
void*,
size_t),
536 void* (*clear_func)(
void*),
537 void* (*first_func)(
void*),
538 void* (*next_func)(
void*),
539 void* (*construct_func)(
void*,
size_t),
540 void (*destruct_func)(
void*,
size_t),
541 void* (*feed_func)(
void*,
void*,
size_t),
542 void* (*collect_func)(
void*,
void*),
543 void* (*create_env)(),
544 void (*getIterators)(
void *collection,
void **begin_arena,
void **end_arena,
TVirtualCollectionProxy *proxy) = 0,
545 void* (*copyIterator)(
void *
dest,
const void *source) = 0,
546 void* (*next)(
void *iter,
const void *end) = 0,
547 void (*deleteSingleIterator)(
void *iter) = 0,
548 void (*deleteTwoIterators)(
void *begin,
void *end) = 0
584 T::Iterators_t::create,
585 T::Iterators_t::copy,
586 T::Iterators_t::next,
587 T::Iterators_t::destruct1,
588 T::Iterators_t::destruct2);
623 typedef std::vector<Bool_t, A>
Cont_t;
624 typedef typename Cont_t::iterator
Iter_t;
625 typedef typename Cont_t::value_type
Value_t;
626 typedef Environ<Iter_t>
Env_t;
636 static void*
size(
void* env) {
641 static void*
clear(
void* env) {
645 static void*
first(
void* env) {
652 e->fIterator =
c->begin();
653 e->fSize =
c->size();
656 static void*
next(
void* env) {
659 for (;
e->fIdx > 0 &&
e->iter() !=
c->end(); ++(
e->iter()), --
e->fIdx){ }
667 static void*
collect(
void *coll,
void *array) {
670 for (
Iter_t i=
c->begin(); i !=
c->end(); ++i, ++
m )
674 static void destruct(
void*,
size_t) {
682 typedef typename Cont_t::iterator iterator;
686 new (*begin_arena) iterator(
c->begin());
687 new (*end_arena) iterator(
c->end());
689 static void* copy(
void *dest_arena,
const void *source_ptr) {
690 const iterator *source = (
const iterator *)(source_ptr);
691 new (dest_arena) iterator(*source);
694 static void*
next(
void *iter_loc,
const void *end_loc) {
695 const iterator *end = (
const iterator *)(end_loc);
696 iterator *iter = (iterator *)(iter_loc);
705 static void destruct1(
void *iter_ptr) {
706 iterator *start = (iterator *)(iter_ptr);
709 static void destruct2(
void *begin_ptr,
void *end_ptr) {
710 iterator *start = (iterator *)(begin_ptr);
711 iterator *end = (iterator *)(end_ptr);
720 template <
class A>
struct TCollectionProxyInfo::Pushback<std::vector<Bool_t, A> > :
public TCollectionProxyInfo::Type<std::vector<Bool_t, A> > {
721 typedef std::vector<Bool_t, A>
Cont_t;
722 typedef typename Cont_t::iterator
Iter_t;
723 typedef typename Cont_t::value_type
Value_t;
724 typedef Environ<Iter_t>
Env_t;
729 static void resize(
void* obj,
size_t n) {
733 static void*
feed(
void* from,
void *to,
size_t size) {
736 for (
size_t i=0; i<
size; ++i, ++
m)
746 template <
class A>
struct TCollectionProxyInfo::Address<std::vector<Bool_t, A>> {
748 static void*
address(
typename std::vector<Bool_t, A>::const_reference ref) {
782 e->fIterator.first = 0;
783 e->fIterator.second =
c->size() > 0 ?
c->test(
e->fIterator.first) : false ;
784 e->fSize =
c->size();
785 return &(
e->fIterator.second);
790 for (;
e->fIdx > 0 &&
e->fIterator.first !=
c->size(); ++(
e->fIterator.first), --
e->fIdx){ }
791 e->fIterator.second = (
e->fIterator.first !=
c->size()) ?
c->test(
e->fIterator.first) :
false;
792 return &(
e->fIterator.second);
798 static void*
collect(
void *coll,
void *array) {
801 for (
size_t i=0; i !=
c->size(); ++i, ++
m )
813 union PtrSize_t {
size_t fIndex;
void *
fAddress; };
822 begin->first.fIndex = 0;
823 begin->second =
false;
825 end->first.fAddress = coll;
828 static void*
copy(
void *dest_arena,
const void *source_ptr) {
833 static void*
next(
void *iter_loc,
const void *end_loc) {
837 if (iter->first.fIndex !=
c->size()) {
838 iter->second =
c->test(iter->first.fIndex);
839 ++(iter->first.fIndex);
841 return &(iter->second);
857 template <
typename Bitset_t>
870 static void*
feed(
void *from,
void *to,
size_t size) {
873 for (
size_t i=0; i<
size; ++i, ++
m)
885using namespace Detail;
typedef void((*Func_t)())
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)
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
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)=0, void *(*copyIterator)(void *dest, const void *source)=0, void *(*next)(void *iter, const void *end)=0, void(*deleteSingleIterator)(void *iter)=0, void(*deleteTwoIterators)(void *begin, void *end)=0)
Type
enumeration specifying the integration types.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
static constexpr double second
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(const PairHolder &c)
PairHolder & operator=(const PairHolder &)
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)
#define dest(otri, vertexptr)