1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2008 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
41 /*-------------------------------------------------------------------------*/
42 /* ParentPointerSField<PtrTypeT, */
44 /*-------------------------------------------------------------------------*/
46 /*-------------------------------------------------------------------------*/
49 /*-------------------------------------------------------------------------*/
52 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
53 ParentPointerSField<PtrTypeT,
55 NamespaceI >::ParentPointerSField(void) :
57 _uiParentFieldPos(0xFFFF)
61 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
62 ParentPointerSField<PtrTypeT,
64 NamespaceI >::ParentPointerSField(
66 UInt16 uiParentFieldPos) :
68 _uiParentFieldPos(uiParentFieldPos)
72 /*-------------------------------------------------------------------------*/
75 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
76 ParentPointerSField<PtrTypeT,
78 NamespaceI >::~ParentPointerSField(void)
83 /*-------------------------------------------------------------------------*/
86 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
87 UInt16 ParentPointerSField<PtrTypeT,
89 NamespaceI >::getParentFieldPos(void) const
91 return _uiParentFieldPos;
94 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
95 typename ParentPointerSField<PtrTypeT,
97 NamespaceI >::const_value
98 ParentPointerSField<PtrTypeT,
100 NamespaceI >::getValue(void) const
102 return static_cast<const_value>(this->ptrStoreGet());
105 /*-------------------------------------------------------------------------*/
106 /* Changing Values */
108 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
109 void ParentPointerSField<PtrTypeT,
111 NamespaceI >::setValue(
113 UInt16 uiParentFieldPos)
115 this->ptrStoreSet(value);
117 _uiParentFieldPos = uiParentFieldPos;
121 /*-------------------------------------------------------------------------*/
124 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
125 SizeT ParentPointerSField<PtrTypeT,
127 NamespaceI >::getBinSize(void) const
129 return (Inherited ::getBinSize() +
130 PosSFieldTraits::getBinSize(_uiParentFieldPos));
133 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
134 void ParentPointerSField<PtrTypeT,
136 NamespaceI >::copyToBin(
137 BinaryDataHandler &pMem) const
139 Inherited ::copyToBin(pMem);
141 PosSFieldTraits::copyToBin(pMem, _uiParentFieldPos);
144 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
145 void ParentPointerSField<PtrTypeT,
147 NamespaceI >::copyFromBin(BinaryDataHandler &pMem)
149 Inherited::copyFromBin(pMem);
151 PosSFieldTraits::copyFromBin(pMem, _uiParentFieldPos);
154 /*-------------------------------------------------------------------------*/
157 #ifdef OSG_MT_CPTR_ASPECT
158 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
159 void ParentPointerSField<PtrTypeT,
161 NamespaceI >::syncWith(Self &source)
163 Inherited::syncWith(source);
165 _uiParentFieldPos = source._uiParentFieldPos;
169 /*-------------------------------------------------------------------------*/
173 /*-------------------------------------------------------------------------*/
176 // template <class ObjectTypeT, Int32 NamespaceI>
178 // ParentPointerSField<ObjectTypeT,
179 // NamespaceI >::operator==(Self const &other)