changed: gcc8 base update
[opensg.git] / Source / Base / FieldContainer / Fields / PointerFields / OSGPointerSField.h
blob1bae6eee27b63901c8abfd7eaa9577d3f0f5dd61
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 #ifndef _OSGPOINTERSFIELD_H_
40 #define _OSGPOINTERSFIELD_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
46 #include "OSGConfig.h"
47 #include "OSGPointerSFieldCommon.h"
48 #include "OSGPointerAccessHandler.h"
50 OSG_BEGIN_NAMESPACE
52 /*---------------------------------------------------------------------------*/
53 /* WeakPointerSField<FieldConfigT> */
54 /*---------------------------------------------------------------------------*/
56 /*! \ingroup GrpBaseFieldContainerFields
57 \ingroup GrpLibOSGBase
60 template <class PtrTypeT,
61 typename RefCountPolicy,
62 Int32 NamespaceI = 0>
63 class PointerSField :
64 public PointerSFieldCommon<PointerAccessHandler<RefCountPolicy>,
65 NamespaceI >
68 /*========================== PUBLIC =================================*/
70 public:
72 /*---------------------------------------------------------------------*/
73 /*! \name Public Types */
74 /*! \{ */
76 typedef PointerSFieldCommon<
77 PointerAccessHandler<RefCountPolicy>,
78 NamespaceI > Inherited;
81 typedef PointerSField Self;
83 typedef PtrTypeT value_type;
84 typedef PtrTypeT const const_value;
86 typedef value_type StoredType;
88 typedef FieldTraits <value_type,
89 NamespaceI > SFieldTraits;
91 typedef FieldDescription <SFieldTraits,
92 FieldType::SingleField,
93 RefCountPolicy,
94 FieldType::PtrField > Description;
97 // handles
99 typedef EditFCPtrSFieldHandle<Self > EditHandle;
100 typedef boost::shared_ptr <EditHandle > EditHandlePtr;
102 typedef GetFCPtrSFieldHandle <Self > GetHandle;
103 typedef boost::shared_ptr <GetHandle > GetHandlePtr;
105 // handles for dynamic fields -- XXX TODO
106 // typedef EditPointerSFieldHandle<Self> DynamicEditHandle;
107 // typedef typename EditPointerSFieldHandle<Self>::Ptr DynamicEditHandlePtr;
109 // typedef GetPointerSFieldHandle <Self> DynamicGetHandle;
110 // typedef typename GetPointerSFieldHandle <Self>::Ptr DynamicGetHandlePtr;
113 /*! \} */
114 /*---------------------------------------------------------------------*/
115 /*! \name Constants */
116 /*! \{ */
118 static FieldType::Cardinality const Card = FieldType::SingleField;
119 static FieldType::Class const Class = FieldType::PtrField;
121 /*! \} */
122 /*---------------------------------------------------------------------*/
123 /*! \name Class Type */
124 /*! \{ */
126 static const FieldType &getClassType(void);
128 /*! \} */
129 /*---------------------------------------------------------------------*/
130 /*! \name Constructors */
131 /*! \{ */
133 PointerSField( void );
134 PointerSField(const Self &source);
136 explicit PointerSField( const_value value );
138 /*! \} */
139 /*---------------------------------------------------------------------*/
140 /*! \name Destructor */
141 /*! \{ */
143 ~PointerSField(void);
145 /*! \} */
146 /*---------------------------------------------------------------------*/
147 /*! \name Access */
148 /*! \{ */
150 const_value getValue( void ) const;
152 void setValue( const_value value );
153 void setValue(const Self &source);
155 /*! \} */
156 /*---------------------------------------------------------------------*/
157 /*! \name FieldDesc creation */
158 /*! \{ */
160 static FieldDescriptionBase *
161 createFieldDescription (const Char8 *szFieldname,
162 UInt32 uiFieldFlags,
163 FieldEditMethod fEditMethod,
164 FieldGetMethod fGetMethod );
166 static FieldDescriptionBase *
167 createIdxFieldDescription(const Char8 *szFieldname,
168 UInt32 uiFieldFlags,
169 FieldIndexEditMethod fEditMethod,
170 FieldIndexGetMethod fGetMethod );
172 /*! \} */
173 /*---------------------------------------------------------------------*/
174 /*! \name Binary IO */
175 /*! \{ */
177 void copyFromBin(BinaryDataHandler &pMem);
179 /*! \} */
180 /*---------------------------------------------------------------------*/
181 /*! \name MT Sync */
182 /*! \{ */
184 #ifdef OSG_MT_CPTR_ASPECT
185 void syncWith(Self &source);
186 #endif
188 /*! \} */
189 /*---------------------------------------------------------------------*/
190 /*! \name Assignment */
191 /*! \{ */
193 const Self &operator = (const Self &source);
195 /*! \} */
196 /*========================= PROTECTED ===============================*/
198 protected:
200 /*---------------------------------------------------------------------*/
201 /*! \name Members */
202 /*! \{ */
204 static FieldType _fieldType;
206 /*! \} */
207 /*========================== PRIVATE ================================*/
209 private:
212 OSG_END_NAMESPACE
214 #include "OSGPointerSField.inl"
216 #endif // _OSGWEAKPOINTERSFIELD_H_