00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef POINTERTOARRAYBASE_H
00016 #define POINTERTOARRAYBASE_H
00017
00018 #include "pandabase.h"
00019 #include "pStatCollectorForwardBase.h"
00020 #include "nodeReferenceCount.h"
00021 #include "pointerTo.h"
00022 #include "pvector.h"
00023 #include "memoryBase.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 template <class Element>
00043 class ReferenceCountedVector : public NodeReferenceCount, public pvector<Element> {
00044 public:
00045 typedef TYPENAME pvector<Element>::iterator iterator;
00046 typedef TYPENAME pvector<Element>::size_type size_type;
00047
00048 INLINE ReferenceCountedVector(TypeHandle type_handle);
00049 INLINE ReferenceCountedVector(const ReferenceCountedVector<Element> ©);
00050 INLINE ReferenceCountedVector(size_type initial_size, TypeHandle type_handle);
00051 INLINE ~ReferenceCountedVector();
00052 ALLOC_DELETED_CHAIN(ReferenceCountedVector<Element>);
00053
00054 INLINE size_type size() const;
00055
00056 INLINE iterator insert(iterator position, const Element &x);
00057 INLINE void insert(iterator position, size_type n, const Element &x);
00058
00059 INLINE void erase(iterator position);
00060 INLINE void erase(iterator first, iterator last);
00061
00062 INLINE void pop_back();
00063 INLINE void clear();
00064 };
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 template <class Element>
00077 class PointerToArrayBase : public PointerToBase<ReferenceCountedVector<Element> > {
00078 public:
00079 typedef TYPENAME PointerToBase<ReferenceCountedVector<Element> >::To To;
00080
00081 protected:
00082 INLINE PointerToArrayBase(ReferenceCountedVector<Element> *ptr);
00083 INLINE PointerToArrayBase(const PointerToArrayBase<Element> ©);
00084
00085 PUBLISHED:
00086 INLINE ~PointerToArrayBase();
00087 };
00088
00089 #include "pointerToArrayBase.I"
00090
00091 #endif
00092