12 #ifndef ROOT_TCollectionProxyInfo
13 #define ROOT_TCollectionProxyInfo
26 #include <forward_list>
33 #define TYPENAME typename
36 #define TYPENAME typename
58 static const UInt_t fgIteratorArenaSize = 16;
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) {
97 iterator *source = (iterator *)(source_ptr);
101 static void*
next(
void *iter_loc,
const void *end_loc) {
102 iterator *end = (iterator *)(end_loc);
103 iterator *iter = (iterator *)(iter_loc);
112 iterator *start = (iterator *)(iter_ptr);
116 iterator *start = (iterator *)(begin_ptr);
117 iterator *end = (iterator *)(end_ptr);
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) {
181 iterator *source = (iterator *)(source_ptr);
185 static void*
next(
void *iter_loc,
const void *end_loc) {
186 iterator *end = (iterator *)(end_loc);
187 iterator *iter = (iterator *)(iter_loc);
196 iterator *start = (iterator *)(begin_ptr);
200 iterator *start = (iterator *)(begin_ptr);
201 iterator *end = (iterator *)(end_ptr);
249 template <
typename T>
struct Environ;
265 return const_cast<void*
>(
reinterpret_cast<const void*
>(&ref));
278 template <
class T,
class ALLOCATOR>
292 :
public Address<TYPENAME T::const_reference>
304 static inline PCont_t
object(
void* ptr) {
321 ::new(e->buff)
Iter_t(c->begin());
334 if ( e->
iter() == c->end() )
return 0;
340 for (
size_t i=0; i<
size; ++i, ++
m)
344 static void*
collect(
void *coll,
void *array) {
347 for (Iter_t i=c->begin(); i != c->end(); ++i, ++
m )
353 for (
size_t i=0; i <
size; ++i, ++
m )
357 static const bool fgLargeIterator =
sizeof(
typename Cont_t::iterator) > fgIteratorArenaSize;
383 static void*
feed(
void *from,
void *to,
size_t size) {
386 for (
size_t i=0; i<
size; ++i, ++
m)
416 static void*
feed(
void *from,
void *to,
size_t size) {
418 if (size==0)
return 0;
421 for (
size_t i=0; i<
size; ++i, --
m){
448 static void*
feed(
void *from,
void *to,
size_t size) {
451 for (
size_t i=0; i<
size; ++i, ++
m)
480 static void*
feed(
void *from,
void *to,
size_t size) {
483 for (
size_t i=0; i<
size; ++i, ++
m)
503 void* (*fSizeFunc)(
void*);
505 void* (*fClearFunc)(
void*);
506 void* (*fFirstFunc)(
void*);
507 void* (*fNextFunc)(
void*);
511 void* (*fCollectFunc)(
void*,
void*);
512 void* (*fCreateEnv)();
520 void* (*fCopyIterator)(
void *
dest,
const void *source);
525 void* (*fNext)(
void *
iter,
const void *end);
541 void* (*size_func)(
void*),
542 void (*resize_func)(
void*,
size_t),
543 void* (*clear_func)(
void*),
544 void* (*first_func)(
void*),
545 void* (*next_func)(
void*),
546 void* (*construct_func)(
void*,
size_t),
547 void (*destruct_func)(
void*,
size_t),
548 void* (*feed_func)(
void*,
void*,
size_t),
549 void* (*collect_func)(
void*,
void*),
550 void* (*create_env)(),
551 void (*getIterators)(
void *collection,
void **begin_arena,
void **end_arena,
TVirtualCollectionProxy *proxy) = 0,
552 void* (*copyIterator)(
void *dest,
const void *source) = 0,
553 void* (*
next)(
void *iter,
const void *end) = 0,
554 void (*deleteSingleIterator)(
void *iter) = 0,
555 void (*deleteTwoIterators)(
void *begin,
void *end) = 0
557 fInfo(info), fIterSize(iter_size), fValueDiff(value_diff),
558 fValueOffset(value_offset),
591 T::Iterators_t::create,
592 T::Iterators_t::copy,
594 T::Iterators_t::destruct1,
595 T::Iterators_t::destruct2);
629 typedef std::vector<Bool_t>::iterator
Iter_t;
630 typedef std::vector<Bool_t>::value_type
Value_t;
638 static inline PCont_t
object(
void* ptr) {
655 ::new(e->buff)
Iter_t(c->begin());
658 e->
fSize = c->size();
672 static void*
collect(
void *coll,
void *array) {
675 for (Iter_t i=c->begin(); i != c->end(); ++i, ++
m )
692 new (*begin_arena) iterator(c->begin());
693 new (*end_arena) iterator(c->end());
695 static void*
copy(
void *dest_arena,
const void *source_ptr) {
696 const iterator *source = (
const iterator *)(source_ptr);
697 new (dest_arena) iterator(*source);
700 static void*
next(
void *iter_loc,
const void *end_loc) {
701 const iterator *end = (
const iterator *)(end_loc);
702 iterator *iter = (iterator *)(iter_loc);
712 iterator *start = (iterator *)(iter_ptr);
716 iterator *start = (iterator *)(begin_ptr);
717 iterator *end = (iterator *)(end_ptr);
739 static void*
feed(
void* from,
void *to,
size_t size) {
742 for (
size_t i=0; i<
size; ++i, ++
m)
772 static inline PCont_t
object(
void* ptr) {
789 e->
fSize = c->size();
803 static void*
collect(
void *coll,
void *array) {
806 for (
size_t i=0; i != c->size(); ++i, ++
m )
819 union PtrSize_t {
size_t fIndex;
void *fAddress; };
827 iterator *begin =
new (*begin_arena) iterator;
828 begin->first.fIndex = 0;
829 begin->second =
false;
830 iterator *end =
new (*end_arena) iterator;
831 end->first.fAddress = coll;
834 static void*
copy(
void *dest_arena,
const void *source_ptr) {
835 const iterator *source = (
const iterator *)(source_ptr);
836 new (dest_arena) iterator(*source);
839 static void*
next(
void *iter_loc,
const void *end_loc) {
840 const iterator *end = (
const iterator *)(end_loc);
841 PCont_t
c = (
PCont_t)end->first.fAddress;
842 iterator *iter = (iterator *)(iter_loc);
843 if (iter->first.fIndex != c->size()) {
844 iter->second = c->test(iter->first.fIndex);
845 ++(iter->first.fIndex);
847 return &(iter->second);
850 iterator *start = (iterator *)(iter_ptr);
854 iterator *start = (iterator *)(begin_ptr);
855 iterator *end = (iterator *)(end_ptr);
863 template <
typename Bitset_t>
875 static void*
feed(
void *from,
void *to,
size_t size) {
878 for (
size_t i=0; i<
size; ++i, ++
m)
static size_t GetContainerSize(const std::forward_list< T, ALLOCATOR > &c)
std::pair< size_t, Bool_t > Iter_t
static void * copy(void *dest_arena, const void *source_ptr)
void(* fDeleteSingleIterator)(void *iter)
void *(* fSizeFunc)(void *)
static void * first(void *env)
static int value_offset()
static void * next(void *iter_loc, const void *end_loc)
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 *(* fNext)(void *iter, const void *end)
void *(* fConstructFunc)(void *, size_t)
Namespace for new ROOT classes and functions.
static void * feed(void *from, void *to, size_t size)
void(* fResizeFunc)(void *, size_t)
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
static void destruct(void *, size_t)
static void resize(void *, size_t)
Double_t distance(const TPoint2 &p1, const TPoint2 &p2)
static void * next(void *iter_loc, const void *end_loc)
static void * size(void *env)
static PCont_t object(void *ptr)
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 *)
void *(* fFeedFunc)(void *, void *, size_t)
static void destruct2(void *begin_ptr, void *end_ptr)
static void * feed(void *from, void *to, size_t size)
void *(* fClearFunc)(void *)
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
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)
static void * collect(void *coll, void *array)
static int value_offset()
static void * size(void *env)
Cont_t::iterator iterator
static void * copy(void *dest_arena, const void *source_ptr)
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 *(* fCopyIterator)(void *dest, const void *source)
static void * get(typename Cont_t::iterator &iter)
static int value_offset()
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)
void(* fDestructFunc)(void *, size_t)
static void * size(void *env)
void *(* fNextFunc)(void *)
std::vector< Bool_t >::value_type Value_t
void *(* fFirstFunc)(void *)
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)
void *(* fCollectFunc)(void *, void *)
#define dest(otri, vertexptr)
std::vector< Bool_t > Cont_t
void(* fDeleteTwoIterators)(void *begin, void *end)
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)
void(* fCreateIterators)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
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)