gatelib  2.1
g_cont_ref_vect.h
1 #pragma once
2 
3 #include "g_cont_vect_base.h"
4 #include "private/g_cont_vect_priv.h"
5 
6 namespace g
7 {
8 namespace cont
9 {
10 
11 template<class T, class REF = ref<T> , class REF_C = ref_const<T> , class IT = it_ref<T,REF,REF_C> , class IT_C=it_ref_const<T,REF,REF_C> >
12  class ref_vect : public vect_base<T,REF,REF_C,IT,IT_C>
13 {
14 public:
15  template <typename> friend class priv::vect_positioner;
16  template <typename> friend struct priv::vect_content;
17 
18  typedef REF Ref_t;
19  typedef REF_C RefConst_t;
20  typedef it_ref<T,REF,REF_C> It_t;
21  typedef it_ref_const<T,REF,REF_C> ItConst_t;
23 
24  ref_vect ( AllocationPolicyAbstract* ap = AllocationPolicyAbstract::get_FromStandardPolicy() , int aAllocDeltaRBits = G_VECT_AL_DELTA_MASK_BITS ) : Base_t ( ap ,aAllocDeltaRBits ) {}
25  ref_vect ( ref_vect& o , AllocationPolicyAbstract* ap = AllocationPolicyAbstract::get_FromStandardPolicy() , int aAllocDeltaRBits = G_VECT_AL_DELTA_MASK_BITS ): Base_t ( ap ,aAllocDeltaRBits ) { this->mContent.replaceContent ( o.getLbound ( ) , o.getUbound ( ) , o.mContent.data ); }
26 
27  virtual ~ref_vect ( ) { }
28 
29  class Ref : public ref_custom< ref_vect<T> >
30  {
31  public:
32  Ref(){}
33  Ref(const Ref& other ){ G_VERBOSE_MSG_L5("ref_vect::Ref::Ref(Ref& other )"); this->mRefTake(other); }
34 
36 
37  RefVect_t& operator *() { G_VERBOSE_MSG_L5("T& ref_vect::Ref::operator *()"); return *this->mGetObjP(); }
38  RefVect_t* operator ->() { G_VERBOSE_MSG_L5("T& ref_vect::Ref::operator ->()");return this->mGetObjP(); }
39  const RefVect_t& operator *() const { G_VERBOSE_MSG_L5("const T& ref_vect::Ref::operator *()");return *this->mGetObjP(); }
40  const RefVect_t* operator ->() const { G_VERBOSE_MSG_L5("const T* ref_vect::Ref::operator ->()");return this->mGetObjP(); }
41 
42  Ref& operator = ( const Ref& other ) { this->mRefTake(*this); return *this; }
43 
44  static Ref g_cont_new ( AllocationPolicyAbstract* aAllocPolicyP = AllocationPolicyAbstract::get_FromStandardPolicy ( ) , int aAllocDeltaRBits = G_VECT_AL_DELTA_MASK_BITS )
45  {
46  Ref result;
47 
48  new ( result.mAllocateMemForObject(aAllocPolicyP) )ref_vect<T>(aAllocPolicyP,aAllocDeltaRBits);
49  result.mIncRef ( );
50 
51  return result;
52  }
53  };
54 };
55 
56 
57 }//namespace cont
58 }//namespace g
59 
Definition: g_cont_ref_base.h:37
Definition: g_cont_ref_vect.h:12
Definition: g_cont_it_ref.h:16
Definition: g_cont_AllocationPolicyAbstract.h:16
Definition: g.mthread.ThreadSimpleEvent.h:5
Definition: g_cont_it_ref.h:14
Definition: g_cont_ref_vect.h:29
Definition: g_cont_vect_base.h:14
Definition: g_cont_vect_priv.h:24
Definition: g_cont_vect_priv.h:237