gatelib  2.1
g_cont_ref_lst.h
1 #pragma once
2 
3 #include "g_cont_lst_base.h"
4 
5 namespace g
6 {
7 namespace cont
8 {
9 
10 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> > class ref_lst : public lst_base<T,REF,REF_C,IT,IT_C>
11 {
12 public:
13  typedef REF Ref_t;
14  typedef REF_C RefConst_t;
15  typedef IT It_t;
16  typedef IT_C ItConst_t;
18 
19  template <class> friend class priv::list_positioner;
20 
21  ref_lst ( AllocationPolicyAbstract* ap = AllocationPolicyAbstract::get_FromStandardPolicy() , int aListPageRightBits = G_LST_PAGE_MASK_BITS , int aVectorAllocDeltaRightBits = G_VECT_AL_DELTA_MASK_BITS ) : Base_t(ap,aListPageRightBits,aVectorAllocDeltaRightBits){}
22 
23  virtual ~ref_lst ( ) {}
24 
25  class Ref : public ref_custom< ref_lst<T,REF,REF_C> >
26  {
27  public:
28  Ref(){}
29  Ref(const Ref& other ){ G_VERBOSE_MSG_L5("vect::Ref::Ref(Ref& other )"); this->mRefTake(other); }
30 
32 
33  Lst_t& operator *() { G_VERBOSE_MSG_L5("T& vect::Ref::operator *()"); return *this->mGetObjP(); }
34  Lst_t* operator ->() { G_VERBOSE_MSG_L5("T& vect::Ref::operator ->()");return this->mGetObjP(); }
35  const Lst_t& operator *() const { G_VERBOSE_MSG_L5("const T& vect::Ref::operator *()");return *this->mGetObjP(); }
36  const Lst_t* operator ->() const { G_VERBOSE_MSG_L5("const T* vect::Ref::operator ->()");return this->mGetObjP(); }
37 
38  Ref& operator = ( const Ref& other ) { this->mRefTake(*this); return *this; }
39 
40  static Ref g_cont_new ( AllocationPolicyAbstract* aAllocPolicyP = AllocationPolicyAbstract::get_FromStandardPolicy() , int aListPageRightBits = G_LST_PAGE_MASK_BITS , int aVectorAllocDeltaRightBits = G_VECT_AL_DELTA_MASK_BITS )
41  {
42  Ref result;
43 
44  new ( result.mAllocateMemForObject(aAllocPolicyP) )ref_lst<T>(aAllocPolicyP,aListPageRightBits,aVectorAllocDeltaRightBits);
45  result.mIncRef ( );
46 
47  return result;
48  }
49  };
50 };
51 
52 
53 }//namespace cont
54 }//namespace g
55 
Definition: g_cont_ref_base.h:37
Definition: g_cont_lst_priv.h:412
Definition: g_cont_lst_base.h:12
Definition: g_cont_AllocationPolicyAbstract.h:16
Definition: g_cont_ref_lst.h:10
Definition: g.mthread.ThreadSimpleEvent.h:5
Definition: g_cont_ref_lst.h:25