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 _OSGCHILDPOINTERSFIELD_H_
40 #define _OSGCHILDPOINTERSFIELD_H_
46 #include "OSGChildPointerSFieldBase.h"
50 /*! \ingroup GrpBaseFieldContainerFields
51 \ingroup GrpLibOSGBase
54 /*---------------------------------------------------------------------------*/
55 /* ChildPointerSField<FieldConfigT> */
56 /*---------------------------------------------------------------------------*/
58 template <class PtrTypeT
,
59 typename RefCountPolicy
,
61 class ChildPointerSField
:
62 public ChildPointerSFieldBase
<ChildAccessHandler
<RefCountPolicy
>,
66 /*========================== PUBLIC =================================*/
70 /*---------------------------------------------------------------------*/
71 /*! \name Public Types */
74 typedef ChildPointerSFieldBase
<
75 ChildAccessHandler
<RefCountPolicy
>,
76 NamespaceI
> Inherited
;
78 typedef ChildPointerSField Self
;
80 typedef PtrTypeT value_type
;
81 typedef PtrTypeT
const const_value
;
83 typedef value_type StoredType
;
85 typedef FieldTraits
<value_type
,
86 NamespaceI
> SFieldTraits
;
88 typedef FieldDescription
<SFieldTraits
,
89 FieldType::SingleField
,
91 FieldType::ChildPtrField
> Description
;
94 typedef EditFCPtrSFieldHandle
<Self
> EditHandle
;
95 typedef boost::shared_ptr
<EditHandle
> EditHandlePtr
;
97 typedef GetFCPtrSFieldHandle
<Self
> GetHandle
;
98 typedef boost::shared_ptr
<GetHandle
> GetHandlePtr
;
101 /*---------------------------------------------------------------------*/
102 /*! \name Constants */
105 static FieldType::Cardinality
const fieldCard
= FieldType::SingleField
;
106 static FieldType::Class
const Class
= FieldType::ChildPtrField
;
109 /*---------------------------------------------------------------------*/
110 /*! \name Class Type */
113 static FieldType
const &getClassType(void);
116 /*---------------------------------------------------------------------*/
117 /*! \name Constructors */
120 ChildPointerSField(FieldContainer
* const pParent
,
121 UInt16 usChildFieldId
,
122 UInt16 usParentFieldId
);
124 ChildPointerSField(const_value value
,
125 FieldContainer
* const pParent
,
126 UInt16 usChildFieldId
,
127 UInt16 usParentFieldId
);
130 /*---------------------------------------------------------------------*/
131 /*! \name Destructor */
134 ~ChildPointerSField(void);
137 /*---------------------------------------------------------------------*/
141 const_value
getValue ( void ) const;
143 void setValue ( const_value value
);
144 void setValue (const Self
&source
);
147 /*---------------------------------------------------------------------*/
148 /*! \name Binary IO */
151 void copyFromBin(BinaryDataHandler
&pMem
);
154 /*---------------------------------------------------------------------*/
158 #ifdef OSG_MT_CPTR_ASPECT
159 void syncWith(Self
&source
);
163 /*---------------------------------------------------------------------*/
164 /*! \name Assignment */
168 /*========================= PROTECTED ===============================*/
172 /*---------------------------------------------------------------------*/
176 static FieldType _fieldType
;
179 /*========================== PRIVATE ================================*/
183 /*!\brief prohibit default function (move to 'public' if needed) */
184 ChildPointerSField(const Self
&source
);
185 /*!\brief prohibit default function (move to 'public' if needed) */
186 void operator = (const Self
&source
);
191 #include "OSGChildPointerSField.inl"
193 #endif // _OSGCHILDPOINTERSFIELD_H_