fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Base / FieldContainer / Fields / PointerFields / OSGPointerSFieldBase.h
blobe6a77ef531f02858fc107dc3656ac6c0bbfe7844
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 _OSGPOINTERSFIELDBASE_H_
40 #define _OSGPOINTERSFIELDBASE_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
46 #include "OSGBaseDef.h"
47 #include "OSGSField.h"
48 #include "OSGFieldContainerFieldTraits.h"
50 OSG_BEGIN_NAMESPACE
52 /*! \ingroup GrpBaseFieldContainerFields
53 \ingroup GrpLibOSGBase
56 class OSG_BASE_DLLMAPPING PointerSFieldBase : public Field
58 /*========================== PUBLIC =================================*/
60 public:
62 /*---------------------------------------------------------------------*/
63 /*! \name Public Types */
64 /*! \{ */
66 typedef Field Inherited;
68 typedef PointerSFieldBase Self;
69 typedef FieldTraits <FieldContainer *, 0> SFieldTraits;
71 // storage
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;
89 /*! \} */
90 /*---------------------------------------------------------------------*/
91 /*! \name Class Get */
92 /*! \{ */
94 static const FieldType &getClassType(void);
96 /*! \} */
97 /*---------------------------------------------------------------------*/
98 /*! \name Raw Store Access */
99 /*! \{ */
101 value_type getValue(void) const;
103 /*! \} */
104 /*---------------------------------------------------------------------*/
105 /*! \name Binary Interface */
106 /*! \{ */
108 SizeT getBinSize(void ) const;
110 void copyToBin (BinaryDataHandler &pMem) const;
112 /*! \} */
113 /*---------------------------------------------------------------------*/
114 /*! \name Raw Store Access */
115 /*! \{ */
117 bool operator ==(const Self &source) const;
119 /*! \} */
120 /*========================= PROTECTED ===============================*/
122 protected:
124 /*---------------------------------------------------------------------*/
125 /*! \name Members */
126 /*! \{ */
128 static FieldType _fieldType;
130 StoredType _fieldValue;
132 /*! \} */
133 /*---------------------------------------------------------------------*/
134 /*! \name Constructors */
135 /*! \{ */
137 PointerSFieldBase(void);
139 /*! \} */
140 /*---------------------------------------------------------------------*/
141 /*! \name Destructor */
142 /*! \{ */
144 ~PointerSFieldBase(void);
146 /*! \} */
147 /*---------------------------------------------------------------------*/
148 /*! \name Assign */
149 /*! \{ */
151 /*! \} */
152 /*========================== PRIVATE ================================*/
154 StoredType &editRawStore(void);
155 StoredType const &getRawStore (void) const;
157 private:
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;
167 OSG_END_NAMESPACE
169 #include "OSGPointerSFieldBase.inl"
171 #endif // _OSGPOINTERSFIELDBASE_H_