- Timestamp:
- 10/20/07 18:11:52 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork/Source/System/FieldContainer/Base/OSGParentPointer.h
r973 r976 54 54 OSG_BEGIN_NAMESPACE 55 55 56 template <class ContainerT>57 class ParentPointer56 template <class ObjectT, class RootObjectT = FieldContainer> 57 class OSG_SYSTEM_DLLMAPPING ParentPointer 58 58 { 59 59 /*========================== PUBLIC =================================*/ … … 63 63 /*! \{ */ 64 64 65 typedef ContainerT Container; 66 typedef typename WeakRefCountPtrBuilder<FieldContainer>::Ptr PointerType; 67 typedef ParentPointer<ContainerT, PointerTypeT> Self; 65 typedef ObjectT Object; 66 typedef RootObjectT RootObject; 67 typedef typename WeakRefCountPtrBuilder<ObjectT, 68 RootObject >::Ptr PointerType; 69 typedef ParentPointer<ObjectT, RootObjectT> Self; 68 70 69 OSG_GEN_NAMED_CONTAINER_PTR(Container, Container) 71 OSG_GEN_NAMED_CONTAINER_PTR(Object, Object ) 72 OSG_GEN_NAMED_CONTAINER_PTR(RootObject, RootObject) 73 74 template <class OtherObjectT> 75 struct rebind 76 { 77 typedef ParentPointer<OtherObjectT, RootObject> Type; 78 }; 70 79 71 80 /*! \} */ … … 75 84 76 85 ParentPointer(void ); 77 ParentPointer(Self const &other );86 ParentPointer(Self const &other ); 78 87 79 88 explicit 80 89 ParentPointer( 81 ContainerPtrConstArg pContainer,82 UInt16 const fieldId = 0xFFFF);90 ObjectPtrConstArg objectPtr, 91 UInt16 const fieldId = 0xFFFF); 83 92 84 template <class OtherContainerT, class OtherPointerTypeT> 93 template <class OtherObjectT> 94 explicit 95 ParentPointer(ParentPointer<OtherObjectT, 96 RootObject > const &parentPtr ); 97 98 template <class OtherObjectT, class OtherRefCountPolicyT> 85 99 explicit 86 100 ParentPointer( 87 ParentPointer<OtherContainerT, 88 OtherPointerTypeT> const &parentPtr ); 89 90 template <class OtherContainerT, class OtherRefCountPolicyT> 91 explicit 92 ParentPointer( 93 ReferenceCountPointer<OtherContainerT, 94 OtherRefCountPolicyT> const &refPtr, 95 UInt16 const fieldId = 0xFFFF); 101 ReferenceCountPointer<OtherObjectT, 102 OtherRefCountPolicyT, 103 RootObject > const &refPtr, 104 UInt16 const fieldId = 0xFFFF); 96 105 97 106 /*! \} */ … … 107 116 /*! \{ */ 108 117 109 Self &operator=(Self const &other ); 110 Self &operator=(ContainerPtrConstArg pContainer, 111 UInt16 const fieldId = 0xFFFF); 118 Self &operator=(Self const &other ); 119 Self &operator=(ObjectPtrConstArg objectPtr); 112 120 113 template <class Other ContainerT, class OtherPointerTypeT>121 template <class OtherObjectT> 114 122 Self &operator=( 115 ParentPointer<OtherContainerT, 116 OtherPointerTypeT> const &parentPtr ); 123 ParentPointer<OtherObjectT, RootObject> const &parentPtr); 117 124 118 template <class Other ContainerT, class OtherRefCountPolicy>125 template <class OtherObjectT, class OtherRefCountPolicy> 119 126 Self &operator=( 120 ReferenceCountPointer<Other ContainerT,121 OtherRefCountPolicy > const &refPtr,122 UInt16 const fieldId = 0xFFFF);127 ReferenceCountPointer<OtherObjectT, 128 OtherRefCountPolicy, 129 RootObject > const &refPtr ); 123 130 124 131 /*! \} */ … … 127 134 /*! \{ */ 128 135 129 operator ContainerPtr (void) const;136 operator ObjectPtr (void) const; 130 137 131 138 /*! \} */ … … 134 141 /*! \{ */ 135 142 136 ContainerPtr operator->(void) const;137 Container &operator* (void) const;143 ObjectPtr operator->(void ) const; 144 Object &operator* (void ) const; 138 145 139 ContainerPtr get (void) const;140 void set (ContainerPtrConstArg pContainer);146 ObjectPtr get (void ) const; 147 void set (ObjectPtrConstArg objectPtr); 141 148 142 UInt16 getFieldId(void) const;143 void setFieldId(UInt16 const fieldId);149 UInt16 getFieldId(void ) const; 150 void setFieldId(UInt16 const fieldId ); 144 151 145 void swap (Self &other);152 void swap (Self &other ); 146 153 147 154 /*! \} */ … … 155 162 /*! \{ */ 156 163 157 static FieldContainerPtr 158 castPtrUp (ContainerPtrConstArg pContainer) const; 159 160 static ContainerPtr 161 castPtrDown(FieldContainerPtrConstArg pContainer) const; 164 static RootObjectPtr castPtrUp (ObjectPtrConstArg objectPtr ); 165 static ObjectPtr castPtrDown(RootObjectPtrConstArg rootObjectPtr); 162 166 163 167 /*! \} */ … … 173 177 }; 174 178 175 176 177 // template <class PointerTypeT = ReferenceCountPointer<FieldContainerPtr,178 // WeakRefCountPolicy> >179 // class ParentPointer<FieldContainer, PointerTypeT>180 // {181 // /*========================== PUBLIC =================================*/182 // public:183 // /*---------------------------------------------------------------------*/184 // /*! \name Public Types */185 // /*! \{ */186 //187 // typedef FieldContainer Container;188 // typedef PointerTypeT PointerType;189 // typedef ParentPointer<FieldContainer, PointerTypeT> Self;190 //191 // OSG_GEN_NAMED_CONTAINER_PTR(FieldContainer, Container)192 //193 // /*! \} */194 // /*---------------------------------------------------------------------*/195 // /*! \name Constructors */196 // /*! \{ */197 //198 // ParentPointer(void );199 // ParentPointer(Self const &other );200 //201 // explicit202 // ParentPointer(203 // FieldContainerPtrConstArg pContainer,204 // UInt16 const fieldId = 0xFFFF);205 //206 // template <class OtherContainerT, class OtherPointerTypeT>207 // explicit208 // ParentPointer(209 // ParentPointer<OtherContainerT,210 // OtherPointerTypeT> const &parentPtr );211 //212 // template <class OtherContainerT, class OtherRefCountPolicyT>213 // explicit214 // ParentPointer(215 // ReferenceCountPointer<OtherContainerT,216 // OtherRefCountPolicyT> const &refPtr,217 // UInt16 const fieldId = 0xFFFF);218 //219 // /*! \} */220 // /*---------------------------------------------------------------------*/221 // /*! \name Desctructor */222 // /*! \{ */223 //224 // ~ParentPointer(void);225 //226 // /*! \} */227 // /*---------------------------------------------------------------------*/228 // /*! \name Assignment */229 // /*! \{ */230 //231 // Self &operator=(Self const &other );232 // Self &operator=(FieldContainerPtrConstArg pContainer);233 //234 // template <class OtherContainerT, class OtherPointerTypeT>235 // Self &operator=(236 // ParentPointer<OtherContainerT,237 // OtherPointerTypeT> const &parentPtr );238 //239 // template <class OtherContainerT, class OtherRefCountPolicy>240 // Self &operator=(241 // ReferenceCountPointer<OtherContainerT,242 // OtherRefCountPolicy> const &refPtr );243 //244 // /*! \} */245 // /*---------------------------------------------------------------------*/246 // /*! \name Conversion */247 // /*! \{ */248 //249 // operator FieldContainerPtr (void) const;250 //251 // /*! \} */252 // /*---------------------------------------------------------------------*/253 // /*! \name Access */254 // /*! \{ */255 //256 // FieldContainerPtr operator->(void ) const;257 // FieldContainer &operator* (void ) const;258 //259 // FieldContainerPtr get (void ) const;260 // void set (FieldContainerPtrConstArg pContainer);261 //262 // UInt16 getFieldId(void ) const;263 // void setFieldId(UInt16 const fieldId );264 //265 // void swap (Self &other );266 //267 // /*! \} */268 // /*========================= PROTECTED ===============================*/269 // protected:270 //271 // /*========================== PRIVATE ================================*/272 // private:273 // PointerType _pointer;274 // UInt16 _parentFieldId;275 // };276 277 278 179 OSG_END_NAMESPACE 279 180
