changed: gcc8 base update
[opensg.git] / Source / Base / FieldContainer / Fields / PointerFields / OSGParentPointerSField.inl
blob68b6002aba1cb026f5732c089f5f44e43c8f1069
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *                 Copyright (C) 2008 by the OpenSG Forum                    *
6  *                                                                           *
7  *                            www.opensg.org                                 *
8  *                                                                           *
9  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
10  *                                                                           *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13  *                                License                                    *
14  *                                                                           *
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.                               *
18  *                                                                           *
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.                          *
23  *                                                                           *
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.                 *
27  *                                                                           *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30  *                                Changes                                    *
31  *                                                                           *
32  *                                                                           *
33  *                                                                           *
34  *                                                                           *
35  *                                                                           *
36  *                                                                           *
37 \*---------------------------------------------------------------------------*/
39 OSG_BEGIN_NAMESPACE
41 /*-------------------------------------------------------------------------*/
42 /* ParentPointerSField<PtrTypeT,                                           */
43 /*                     NamespaceI  >                                       */
44 /*-------------------------------------------------------------------------*/
46 /*-------------------------------------------------------------------------*/
47 /* Class Type                                                              */
49 /*-------------------------------------------------------------------------*/
50 /* Constructors                                                            */
52 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
53 ParentPointerSField<PtrTypeT,
54                     RefCountPolicy,
55                     NamespaceI    >::ParentPointerSField(void) : 
56      Inherited       (      ),
57     _uiParentFieldPos(0xFFFF)
61 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
62 ParentPointerSField<PtrTypeT,
63                     RefCountPolicy,
64                     NamespaceI    >::ParentPointerSField(
65                         const_value value, 
66                         UInt16      uiParentFieldPos) :
67      Inherited       (value           ),
68     _uiParentFieldPos(uiParentFieldPos)
72 /*-------------------------------------------------------------------------*/
73 /* Destructor                                                              */
75 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
76 ParentPointerSField<PtrTypeT,
77                     RefCountPolicy,
78                     NamespaceI    >::~ParentPointerSField(void)
83 /*-------------------------------------------------------------------------*/
84 /* Reading Values                                                          */
86 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline 
87 UInt16 ParentPointerSField<PtrTypeT, 
88                            RefCountPolicy,
89                            NamespaceI    >::getParentFieldPos(void) const
91     return _uiParentFieldPos;
94 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline 
95 typename ParentPointerSField<PtrTypeT,
96                              RefCountPolicy,
97                              NamespaceI    >::const_value
98     ParentPointerSField<PtrTypeT,
99                         RefCountPolicy,
100                         NamespaceI >::getValue(void) const
102     return static_cast<const_value>(this->ptrStoreGet());
104     
105 /*-------------------------------------------------------------------------*/
106 /* Changing Values                                                         */
108 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline 
109 void ParentPointerSField<PtrTypeT, 
110                            RefCountPolicy,
111                            NamespaceI    >::setValue(
112                                const_value  value,
113                                UInt16       uiParentFieldPos)
115     this->ptrStoreSet(value);
116     
117     _uiParentFieldPos = uiParentFieldPos;
121 /*-------------------------------------------------------------------------*/
122 /* Binary IO                                                               */
124 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
125 SizeT ParentPointerSField<PtrTypeT, 
126                           RefCountPolicy,
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, 
135                          RefCountPolicy,
136                          NamespaceI    >::copyToBin(
137                              BinaryDataHandler &pMem) const
139     Inherited      ::copyToBin(pMem);
140     
141     PosSFieldTraits::copyToBin(pMem, _uiParentFieldPos);
144 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline 
145 void ParentPointerSField<PtrTypeT, 
146                          RefCountPolicy,
147                          NamespaceI    >::copyFromBin(BinaryDataHandler &pMem)
149     Inherited::copyFromBin(pMem);
150     
151     PosSFieldTraits::copyFromBin(pMem, _uiParentFieldPos);
154 /*-------------------------------------------------------------------------*/
155 /* MT Sync                                                                 */
157 #ifdef OSG_MT_CPTR_ASPECT
158 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline 
159 void ParentPointerSField<PtrTypeT, 
160                          RefCountPolicy,
161                          NamespaceI    >::syncWith(Self &source)
163     Inherited::syncWith(source);
164     
165     _uiParentFieldPos = source._uiParentFieldPos;
167 #endif
169 /*-------------------------------------------------------------------------*/
170 /* Access                                                                  */
173 /*-------------------------------------------------------------------------*/
174 /* Comparison                                                              */
176 // template <class ObjectTypeT, Int32 NamespaceI>
177 // inline bool
178 //     ParentPointerSField<ObjectTypeT,
179 //                         NamespaceI  >::operator==(Self const &other)
180 // {   
181 // }
183 OSG_END_NAMESPACE