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 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGPOINTERSFIELDCOMMON_H_
40 #define _OSGPOINTERSFIELDCOMMON_H_
46 #include "OSGConfig.h"
47 #include "OSGPointerSFieldBase.h"
48 #include "OSGBinaryDataHandler.h"
53 // forward declarations
54 template <Int32 NamespaceI
>
55 class PointerFieldTraitsBase
;
57 /*! \ingroup GrpBaseFieldContainerFields
58 \ingroup GrpLibOSGBase
61 template <class AccessHandlerT
,
63 class PointerSFieldCommon
: public PointerSFieldBase
65 /*========================== PUBLIC =================================*/
69 /*---------------------------------------------------------------------*/
70 /*! \name Public Types */
74 typedef PointerSFieldBase Inherited
;
75 typedef PointerSFieldCommon Self
;
77 typedef typename
Inherited::const_value const_value
;
78 typedef typename
Inherited::value_type value_type
;
80 typedef typename
Inherited::StoredType StoredType
;
82 typedef AccessHandlerT AccessHandler
;
84 typedef FieldTraitsFCPtrBase
<
86 NamespaceI
> PtrBaseTraitsType
;
89 /*---------------------------------------------------------------------*/
90 /*! \name Constants */
93 static const Int32 Namespace
= NamespaceI
;
96 /*========================= PROTECTED ===============================*/
100 /*---------------------------------------------------------------------*/
101 /*! \name Constructors */
104 PointerSFieldCommon( void );
105 PointerSFieldCommon(const Self
&source
);
106 explicit PointerSFieldCommon( const_value value
);
109 /*---------------------------------------------------------------------*/
110 /*! \name Destructor */
113 ~PointerSFieldCommon(void);
116 /*---------------------------------------------------------------------*/
117 /*! \name Store Interface */
120 value_type
ptrStoreGet (void ) const;
122 void ptrStoreSet (const_value pNewObj
);
123 void ptrStoreClear(void );
126 /*---------------------------------------------------------------------*/
127 /*! \name Binary IO */
130 void copyFromBin(BinaryDataHandler
&pMem
);
133 /*---------------------------------------------------------------------*/
134 /*! \name FieldDesc creation */
137 static FieldDescriptionBase
*
138 createFieldDescription (const Char8
*szFieldname
,
140 FieldEditMethod fEditMethod
,
141 FieldGetMethod fGetMethod
);
143 static FieldDescriptionBase
*
144 createIdxFieldDescription(const Char8
*szFieldname
,
146 FieldIndexEditMethod fEditMethod
,
147 FieldIndexGetMethod fGetMethod
);
150 /*---------------------------------------------------------------------*/
154 #ifdef OSG_MT_CPTR_ASPECT
155 void syncWith(Self
&source
);
159 /*========================== PRIVATE ================================*/
163 /*!\brief prohibit default function (move to 'public' if needed) */
164 void operator =(const Self
&source
);
169 #include "OSGPointerSFieldCommon.inl"
171 #endif // _OSGPOINTERSFIELDCOMMON_H_