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 _OSGPOINTERSFIELDBASE_H_
40 #define _OSGPOINTERSFIELDBASE_H_
46 #include "OSGBaseDef.h"
47 #include "OSGSField.h"
48 #include "OSGFieldContainerFieldTraits.h"
52 /*! \ingroup GrpBaseFieldContainerFields
53 \ingroup GrpLibOSGBase
56 class OSG_BASE_DLLMAPPING PointerSFieldBase
: public Field
58 /*========================== PUBLIC =================================*/
62 /*---------------------------------------------------------------------*/
63 /*! \name Public Types */
66 typedef Field Inherited
;
68 typedef PointerSFieldBase Self
;
69 typedef FieldTraits
<FieldContainer
*, 0> SFieldTraits
;
72 typedef FieldContainer
* StoredType
;
73 typedef FieldContainer
* const const_value
;
74 typedef FieldContainer
* value_type
;
76 typedef EditSFieldHandle
<Self
> EditHandle
;
77 typedef boost::shared_ptr
<EditHandle
> EditHandlePtr
;
79 typedef GetSFieldHandle
<Self
> GetHandle
;
80 typedef boost::shared_ptr
<GetHandle
> GetHandlePtr
;
82 /*---------------------------------------------------------------------*/
84 static const bool isSField
= true;
85 static const bool isMField
= false;
87 static const bool isPointerField
= true;
90 /*---------------------------------------------------------------------*/
91 /*! \name Class Get */
94 static const FieldType
&getClassType(void);
97 /*---------------------------------------------------------------------*/
98 /*! \name Raw Store Access */
101 value_type
getValue(void) const;
104 /*---------------------------------------------------------------------*/
105 /*! \name Binary Interface */
108 SizeT
getBinSize(void ) const;
110 void copyToBin (BinaryDataHandler
&pMem
) const;
113 /*---------------------------------------------------------------------*/
114 /*! \name Raw Store Access */
117 bool operator ==(const Self
&source
) const;
120 /*========================= PROTECTED ===============================*/
124 /*---------------------------------------------------------------------*/
128 static FieldType _fieldType
;
130 StoredType _fieldValue
;
133 /*---------------------------------------------------------------------*/
134 /*! \name Constructors */
137 PointerSFieldBase(void);
140 /*---------------------------------------------------------------------*/
141 /*! \name Destructor */
144 ~PointerSFieldBase(void);
147 /*---------------------------------------------------------------------*/
152 /*========================== PRIVATE ================================*/
154 StoredType
&editRawStore(void);
155 StoredType
const &getRawStore (void) const;
159 /*!\brief prohibit default function (move to 'public' if needed) */
160 PointerSFieldBase(const Self
&source
);
161 /*!\brief prohibit default function (move to 'public' if needed) */
162 void operator =(const Self
&source
);
165 typedef PointerSFieldBase FieldContainerPtrSFieldBase
;
169 #include "OSGPointerSFieldBase.inl"
171 #endif // _OSGPOINTERSFIELDBASE_H_