12 #ifndef ROOT_TCollectionProxyInfo
13 #define ROOT_TCollectionProxyInfo
26 #include <forward_list>
33 #define TYPENAME typename
36 #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>
93 new (*begin_arena)
iterator(c->begin());
96 static void*
copy(
void *dest_arena,
const void *source_ptr) {
101 static void*
next(
void *iter_loc,
const void *end_loc) {
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.");
171 template <
typename Cont_t>
struct Iterators<Cont_t, true > {
177 *begin_arena =
new iterator(c->begin());
178 *end_arena =
new iterator(c->end());
180 static void*
copy(
void * ,
const void *source_ptr) {
185 static void*
next(
void *iter_loc,
const void *end_loc) {
246 template <
typename T>
struct Environ;
262 return const_cast<void*
>(
reinterpret_cast<const void*
>(&ref));
275 template <
class T,
class ALLOCATOR>
289 :
public Address<TYPENAME T::const_reference>
318 ::new(e->buff)
Iter_t(c->begin());
331 if ( e->
iter() == c->end() )
return 0;
337 for (
size_t i=0; i<
size; ++i, ++
m)
341 static void*
collect(
void *coll,
void *array) {
344 for (
Iter_t i=c->begin(); i != c->end(); ++i, ++
m )
350 for (
size_t i=0; i <
size; ++i, ++
m )
380 static void*
feed(
void *from,
void *to,
size_t size) {
383 for (
size_t i=0; i<
size; ++i, ++
m)
413 static void*
feed(
void *from,
void *to,
size_t size) {
415 if (size==0)
return 0;
418 for (
size_t i=0; i<
size; ++i, --
m){
445 static void*
feed(
void *from,
void *to,
size_t size) {
448 for (
size_t i=0; i<
size; ++i, ++
m)
477 static void*
feed(
void *from,
void *to,
size_t size) {
480 for (
size_t i=0; i<
size; ++i, ++
m)
500 void* (*fSizeFunc)(
void*);
502 void* (*fClearFunc)(
void*);
503 void* (*fFirstFunc)(
void*);
504 void* (*fNextFunc)(
void*);
508 void* (*fCollectFunc)(
void*,
void*);
509 void* (*fCreateEnv)();
517 void* (*fCopyIterator)(
void *
dest,
const void *source);
522 void* (*fNext)(
void *
iter,
const void *end);
538 void* (*size_func)(
void*),
539 void (*resize_func)(
void*,
size_t),
540 void* (*clear_func)(
void*),
541 void* (*first_func)(
void*),
542 void* (*next_func)(
void*),
543 void* (*construct_func)(
void*,
size_t),
544 void (*destruct_func)(
void*,
size_t),
545 void* (*feed_func)(
void*,
void*,
size_t),
546 void* (*collect_func)(
void*,
void*),
547 void* (*create_env)(),
548 void (*getIterators)(
void *collection,
void **begin_arena,
void **end_arena,
TVirtualCollectionProxy *proxy) = 0,
549 void* (*copyIterator)(
void *dest,
const void *source) = 0,
550 void* (*
next)(
void *iter,
const void *end) = 0,
551 void (*deleteSingleIterator)(
void *iter) = 0,
552 void (*deleteTwoIterators)(
void *begin,
void *end) = 0
588 T::Iterators_t::create,
589 T::Iterators_t::copy,
591 T::Iterators_t::destruct1,
592 T::Iterators_t::destruct2);
626 typedef std::vector<Bool_t>::iterator
Iter_t;
627 typedef std::vector<Bool_t>::value_type
Value_t;
652 ::new(e->buff)
Iter_t(c->begin());
655 e->
fSize = c->size();
669 static void*
collect(
void *coll,
void *array) {
672 for (
Iter_t i=c->begin(); i != c->end(); ++i, ++
m )
689 new (*begin_arena)
iterator(c->begin());
690 new (*end_arena)
iterator(c->end());
692 static void*
copy(
void *dest_arena,
const void *source_ptr) {
697 static void*
next(
void *iter_loc,
const void *end_loc) {
736 static void*
feed(
void* from,
void *to,
size_t size) {
739 for (
size_t i=0; i<
size; ++i, ++
m)
786 e->
fSize = c->size();
800 static void*
collect(
void *coll,
void *array) {
803 for (
size_t i=0; i != c->size(); ++i, ++
m )
816 union PtrSize_t {
size_t fIndex;
void *fAddress; };
825 begin->first.fIndex = 0;
826 begin->second =
false;
827 iterator *end =
new (*end_arena) iterator;
828 end->first.fAddress = coll;
831 static void*
copy(
void *dest_arena,
const void *source_ptr) {
836 static void*
next(
void *iter_loc,
const void *end_loc) {
840 if (iter->first.fIndex != c->size()) {
841 iter->second = c->test(iter->first.fIndex);
842 ++(iter->first.fIndex);
844 return &(iter->second);
860 template <
typename Bitset_t>
872 static void*
feed(
void *from,
void *to,
size_t size) {
875 for (
size_t i=0; i<
size; ++i, ++
m)
888 using namespace Detail;
static size_t GetContainerSize(const std::forward_list< T, ALLOCATOR > &c)
void *(* fSizeFunc)(void *)
std::pair< size_t, Bool_t > Iter_t
static void * copy(void *dest_arena, const void *source_ptr)
void *(* fNext)(void *iter, const void *end)
static void * first(void *env)
static int value_offset()
static void * next(void *iter_loc, const void *end_loc)
void(* fDeleteTwoIterators)(void *begin, void *end)
static void * copy(void *, const void *source_ptr)
Cont_t::iterator iterator
static void resize(void *obj, size_t n)
static void * next(void *iter_loc, const void *end_loc)
static void * collect(void *coll, void *array)
static PCont_t object(void *ptr)
void *(* fCollectFunc)(void *, void *)
static void * feed(void *from, void *to, size_t size)
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
void(* fDestructFunc)(void *, size_t)
static void destruct(void *, size_t)
static void resize(void *, size_t)
void *(* fCopyIterator)(void *dest, const void *source)
Double_t distance(const TPoint2 &p1, const TPoint2 &p2)
static void * next(void *iter_loc, const void *end_loc)
static void * size(void *env)
void *(* fFeedFunc)(void *, void *, size_t)
static PCont_t object(void *ptr)
void(* fResizeFunc)(void *, size_t)
std::pair< PtrSize_t, Bool_t > iterator
static void destruct2(void *begin_ptr, void *end_ptr)
static void create(void *coll, void **begin_arena, void **end_arena, TVirtualCollectionProxy *)
static void destruct2(void *begin_ptr, void *end_ptr)
static void * feed(void *from, void *to, size_t size)
static void * clear(void *env)
static void * next(void *iter_loc, const void *end_loc)
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
static void * next(void *env)
static const bool fgLargeIterator
static void create(void *coll, void **begin_arena, void **end_arena, TVirtualCollectionProxy *)
static void * next(void *, const void *)
Cont_t::iterator iterator
std::vector< Bool_t >::iterator Iter_t
std::vector< Bool_t > Cont_t
static void create(void *coll, void **begin_arena, void **end_arena, TVirtualCollectionProxy *)
static int value_offset()
static void * first(void *env)
static void * next(void *env)
TCollectionProxyInfo(const 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)
static void resize(void *obj, size_t n)
std::map< std::string, std::string >::const_iterator iter
void *(* fConstructFunc)(void *, size_t)
static void * address(T ref)
Cont_t::value_type Value_t
static void create(void *coll, void **begin_arena, void **end_arena, TVirtualCollectionProxy *)
static void destruct2(void *, void *)
static void * construct(void *what, size_t size)
static void * next(void *env)
void *(* fNextFunc)(void *)
static void * collect(void *coll, void *array)
static int value_offset()
static void * size(void *env)
Cont_t::iterator iterator
void *(* fClearFunc)(void *)
static void * copy(void *dest_arena, const void *source_ptr)
static const UInt_t fgIteratorArenaSize
static void * construct(void *, size_t)
static int value_offset()
static void * feed(void *from, void *to, size_t size)
static void * copy(void *dest, const void *source)
Iterators< Cont_t, fgLargeIterator > Iterators_t
static void destruct(void *what, size_t size)
EnvironBase & operator=(const EnvironBase &)
void(* fDeleteSingleIterator)(void *iter)
void(* fCreateIterators)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
static void * get(typename Cont_t::iterator &iter)
static int value_offset()
void *(* fFirstFunc)(void *)
static void destruct1(void *iter_ptr)
static void * clear(void *env)
static void * feed(void *from, void *to, size_t size)
static void destruct1(void *iter_ptr)
static size_t GetContainerSize(const T &c)
static void * size(void *env)
std::vector< Bool_t >::value_type Value_t
static void create(void *coll, void **begin_arena, void **end_arena, TVirtualCollectionProxy *)
static TCollectionProxyInfo Get(const T &)
static void resize(void *obj, size_t n)
static int value_offset()
static void destruct(void *, size_t)
static void destruct1(void *)
static void * construct(void *, size_t)
static void * feed(void *from, void *to, size_t size)
typedef void((*Func_t)())
static void destruct2(void *begin_ptr, void *end_ptr)
static void * first(void *env)
#define dest(otri, vertexptr)
std::vector< Bool_t > Cont_t
static void * clear(void *env)
static void * feed(void *from, void *to, size_t size)
static void destruct2(void *begin_ptr, void *end_ptr)
static void resize(void *, size_t)
static TCollectionProxyInfo * Generate(const T &)
Generate proxy from template.
static void resize(void *, size_t)
PairHolder & operator=(const PairHolder &)
static void * collect(void *coll, void *array)
static PCont_t object(void *ptr)
static void * copy(void *dest_arena, const void *source_ptr)
PairHolder(const PairHolder &c)
Cont_t::iterator iterator
static void destruct1(void *iter_ptr)
static void destruct1(void *begin_ptr)