changed: gcc8 base update
[opensg.git] / Source / Base / FieldContainer / Fields / PointerFields / OSGPointerSField.inl
blob47409f5a6b6ed4aecc12a71ff2e5001b06835da7
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 /* PointerSField<PtrTypeT,                                          */
43 /*               NamespaceI  >                                         */
44 /*-------------------------------------------------------------------------*/
46 /*-------------------------------------------------------------------------*/
47 /* Class Type                                                              */
49 /*-------------------------------------------------------------------------*/
50 /* Constructors                                                            */
52 template <class    PtrTypeT, 
53           typename RefCountPolicy,
54           Int32    NamespaceI    > inline
55 PointerSField<PtrTypeT,
56               RefCountPolicy,
57               NamespaceI    >::PointerSField(void) : 
58     Inherited()
62 template <class    PtrTypeT, 
63           typename RefCountPolicy,
64           Int32    NamespaceI    > inline
65 PointerSField<PtrTypeT,
66               RefCountPolicy,
67               NamespaceI    >::PointerSField(const Self &source) :
68      Inherited(source)
72 template <class    PtrTypeT, 
73           typename RefCountPolicy,
74           Int32    NamespaceI    > inline
75 PointerSField<PtrTypeT,
76               RefCountPolicy,
77               NamespaceI    >::PointerSField(const_value value) :
78     Inherited(value)
82 /*-------------------------------------------------------------------------*/
83 /* Destructor                                                              */
85 template <class    PtrTypeT, 
86           typename RefCountPolicy,
87           Int32    NamespaceI    > inline
88 PointerSField<PtrTypeT, 
89               RefCountPolicy,
90               NamespaceI    >::~PointerSField(void)
94 /*-------------------------------------------------------------------------*/
95 /* Access                                                                  */
97 template <class    PtrTypeT, 
98           typename RefCountPolicy,
99           Int32    NamespaceI    > inline 
100 typename PointerSField<PtrTypeT,
101                        RefCountPolicy,
102                        NamespaceI    >::const_value
103     PointerSField<PtrTypeT,
104                   RefCountPolicy,
105                   NamespaceI    >::getValue(void) const
107     return static_cast<const_value>(this->ptrStoreGet());
110 template <class    PtrTypeT, 
111           typename RefCountPolicy,
112           Int32    NamespaceI    > inline 
113 void PointerSField<PtrTypeT,
114                    RefCountPolicy,
115                    NamespaceI    >::setValue(const_value value)
117     this->ptrStoreSet(value);
120 template <class    PtrTypeT, 
121           typename RefCountPolicy,
122           Int32    NamespaceI    > inline 
123 void PointerSField<PtrTypeT,
124                    RefCountPolicy,
125                    NamespaceI    >::setValue(const Self &source)
127     this->ptrStoreSet(source.ptrStoreGet());
130 template <class    PtrTypeT, 
131           typename RefCountPolicy,
132           Int32    NamespaceI    > inline 
133 FieldDescriptionBase *
134     PointerSField<PtrTypeT,
135                    RefCountPolicy,
136                    NamespaceI    >::createFieldDescription   (
137                        const Char8                *szFieldname,
138                              UInt32                uiFieldFlags,
139                              FieldEditMethod       fEditMethod,
140                              FieldGetMethod        fGetMethod  )
142     if(szFieldname == NULL)
143     {
144         FWARNING(("createFieldDescription no fieldname given"));
146         return NULL;
147     }
149     if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
150     {
151         uiFieldFlags = (Field::SFDefaultFlags | Field::FStdAccess);
152     }
154     FieldDescriptionBase *returnValue = new typename Self::Description(
155         _fieldType, 
156         szFieldname,
157         "",
158         0,
159         0,
160         false,
161         uiFieldFlags,
162         fEditMethod,
163         fGetMethod);
165     return returnValue;
168 template <class    PtrTypeT, 
169           typename RefCountPolicy,
170           Int32    NamespaceI    > inline 
171 FieldDescriptionBase *
172     PointerSField<PtrTypeT,
173                    RefCountPolicy,
174                    NamespaceI    >::createIdxFieldDescription(
175                        const Char8                *szFieldname,
176                              UInt32                uiFieldFlags,
177                              FieldIndexEditMethod  fEditMethod,
178                              FieldIndexGetMethod   fGetMethod  )
180     if(szFieldname == NULL)
181     {
182         FWARNING(("createFieldDescriptionIdx no fieldname given"));
184         return NULL;
185     }
187     if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
188     {
189         uiFieldFlags = (Field::SFDefaultFlags | Field::FStdAccess);
190     }
192     FieldDescriptionBase *returnValue = new typename Self::Description(
193         _fieldType, 
194         szFieldname,
195         "",
196         0,
197         0,
198         false,
199         uiFieldFlags,
200         fEditMethod,
201         fGetMethod);
203     return returnValue;
206 template <class    PtrTypeT, 
207           typename RefCountPolicy,
208           Int32    NamespaceI    > inline 
209 void PointerSField<PtrTypeT,
210                    RefCountPolicy,
211                    NamespaceI    >::copyFromBin(BinaryDataHandler &pMem)
213     Inherited::copyFromBin(pMem);
216 #ifdef OSG_MT_CPTR_ASPECT
217 template <class    PtrTypeT, 
218           typename RefCountPolicy,
219           Int32    NamespaceI    > inline 
220 void PointerSField<PtrTypeT,
221                    RefCountPolicy,
222                    NamespaceI    >::syncWith(Self &source)
224     Inherited::syncWith(source);
226 #endif
228 /*-------------------------------------------------------------------------*/
229 /* Assignment                                                              */
231 template <class    PtrTypeT, 
232           typename RefCountPolicy,
233           Int32    NamespaceI    > inline 
234 const typename PointerSField<PtrTypeT,
235                              RefCountPolicy,
236                              NamespaceI    >::Self &
237     PointerSField<PtrTypeT,
238                   RefCountPolicy,
239                   NamespaceI    >::operator =(const Self &other)
241     this->ptrStoreSet(other.ptrStoreGet());
243     return *this;
246 OSG_END_NAMESPACE