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 /* PointerSField<PtrTypeT, */
44 /*-------------------------------------------------------------------------*/
46 /*-------------------------------------------------------------------------*/
49 /*-------------------------------------------------------------------------*/
52 template <class PtrTypeT,
53 typename RefCountPolicy,
54 Int32 NamespaceI > inline
55 PointerSField<PtrTypeT,
57 NamespaceI >::PointerSField(void) :
62 template <class PtrTypeT,
63 typename RefCountPolicy,
64 Int32 NamespaceI > inline
65 PointerSField<PtrTypeT,
67 NamespaceI >::PointerSField(const Self &source) :
72 template <class PtrTypeT,
73 typename RefCountPolicy,
74 Int32 NamespaceI > inline
75 PointerSField<PtrTypeT,
77 NamespaceI >::PointerSField(const_value value) :
82 /*-------------------------------------------------------------------------*/
85 template <class PtrTypeT,
86 typename RefCountPolicy,
87 Int32 NamespaceI > inline
88 PointerSField<PtrTypeT,
90 NamespaceI >::~PointerSField(void)
94 /*-------------------------------------------------------------------------*/
97 template <class PtrTypeT,
98 typename RefCountPolicy,
99 Int32 NamespaceI > inline
100 typename PointerSField<PtrTypeT,
102 NamespaceI >::const_value
103 PointerSField<PtrTypeT,
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,
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,
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,
136 NamespaceI >::createFieldDescription (
137 const Char8 *szFieldname,
139 FieldEditMethod fEditMethod,
140 FieldGetMethod fGetMethod )
142 if(szFieldname == NULL)
144 FWARNING(("createFieldDescription no fieldname given"));
149 if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
151 uiFieldFlags = (Field::SFDefaultFlags | Field::FStdAccess);
154 FieldDescriptionBase *returnValue = new typename Self::Description(
168 template <class PtrTypeT,
169 typename RefCountPolicy,
170 Int32 NamespaceI > inline
171 FieldDescriptionBase *
172 PointerSField<PtrTypeT,
174 NamespaceI >::createIdxFieldDescription(
175 const Char8 *szFieldname,
177 FieldIndexEditMethod fEditMethod,
178 FieldIndexGetMethod fGetMethod )
180 if(szFieldname == NULL)
182 FWARNING(("createFieldDescriptionIdx no fieldname given"));
187 if(uiFieldFlags == FieldDescFactoryBase::AutoFlags)
189 uiFieldFlags = (Field::SFDefaultFlags | Field::FStdAccess);
192 FieldDescriptionBase *returnValue = new typename Self::Description(
206 template <class PtrTypeT,
207 typename RefCountPolicy,
208 Int32 NamespaceI > inline
209 void PointerSField<PtrTypeT,
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,
222 NamespaceI >::syncWith(Self &source)
224 Inherited::syncWith(source);
228 /*-------------------------------------------------------------------------*/
231 template <class PtrTypeT,
232 typename RefCountPolicy,
233 Int32 NamespaceI > inline
234 const typename PointerSField<PtrTypeT,
237 PointerSField<PtrTypeT,
239 NamespaceI >::operator =(const Self &other)
241 this->ptrStoreSet(other.ptrStoreGet());