fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Base / FieldContainer / Fields / PointerFields / OSGChildPointerSField.h
blobb6b9d33be13f34650c74229a8c8421ed1e62a53e
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 _OSGCHILDPOINTERSFIELD_H_
40 #define _OSGCHILDPOINTERSFIELD_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
46 #include "OSGChildPointerSFieldBase.h"
48 OSG_BEGIN_NAMESPACE
50 /*! \ingroup GrpBaseFieldContainerFields
51 \ingroup GrpLibOSGBase
54 /*---------------------------------------------------------------------------*/
55 /* ChildPointerSField<FieldConfigT> */
56 /*---------------------------------------------------------------------------*/
58 template <class PtrTypeT,
59 typename RefCountPolicy,
60 Int32 NamespaceI = 0>
61 class ChildPointerSField :
62 public ChildPointerSFieldBase<ChildAccessHandler<RefCountPolicy>,
63 NamespaceI >
66 /*========================== PUBLIC =================================*/
68 public:
70 /*---------------------------------------------------------------------*/
71 /*! \name Public Types */
72 /*! \{ */
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,
90 RefCountPolicy,
91 FieldType::ChildPtrField> Description;
93 // handles
94 typedef EditFCPtrSFieldHandle<Self > EditHandle;
95 typedef boost::shared_ptr <EditHandle > EditHandlePtr;
97 typedef GetFCPtrSFieldHandle <Self > GetHandle;
98 typedef boost::shared_ptr <GetHandle > GetHandlePtr;
100 /*! \} */
101 /*---------------------------------------------------------------------*/
102 /*! \name Constants */
103 /*! \{ */
105 static FieldType::Cardinality const fieldCard = FieldType::SingleField;
106 static FieldType::Class const Class = FieldType::ChildPtrField;
108 /*! \} */
109 /*---------------------------------------------------------------------*/
110 /*! \name Class Type */
111 /*! \{ */
113 static FieldType const &getClassType(void);
115 /*! \} */
116 /*---------------------------------------------------------------------*/
117 /*! \name Constructors */
118 /*! \{ */
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);
129 /*! \} */
130 /*---------------------------------------------------------------------*/
131 /*! \name Destructor */
132 /*! \{ */
134 ~ChildPointerSField(void);
136 /*! \} */
137 /*---------------------------------------------------------------------*/
138 /*! \name Access */
139 /*! \{ */
141 const_value getValue ( void ) const;
143 void setValue ( const_value value );
144 void setValue (const Self &source);
146 /*! \} */
147 /*---------------------------------------------------------------------*/
148 /*! \name Binary IO */
149 /*! \{ */
151 void copyFromBin(BinaryDataHandler &pMem);
153 /*! \} */
154 /*---------------------------------------------------------------------*/
155 /*! \name MT Sync */
156 /*! \{ */
158 #ifdef OSG_MT_CPTR_ASPECT
159 void syncWith(Self &source);
160 #endif
162 /*! \} */
163 /*---------------------------------------------------------------------*/
164 /*! \name Assignment */
165 /*! \{ */
167 /*! \} */
168 /*========================= PROTECTED ===============================*/
170 protected:
172 /*---------------------------------------------------------------------*/
173 /*! \name Members */
174 /*! \{ */
176 static FieldType _fieldType;
178 /*! \} */
179 /*========================== PRIVATE ================================*/
181 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);
189 OSG_END_NAMESPACE
191 #include "OSGChildPointerSField.inl"
193 #endif // _OSGCHILDPOINTERSFIELD_H_