fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Base / FieldContainer / Fields / PointerFields / OSGChildPointerSFieldBase.h
blob0d2400b14e045d383d3836cc21887ba24904a7a2
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 _OSGCHILDPOINTERSFIELDBASE_H_
40 #define _OSGCHILDPOINTERSFIELDBASE_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
46 #include "OSGConfig.h"
48 #include "OSGPointerSFieldCommon.h"
49 #include "OSGChildAccessHandler.h"
51 OSG_BEGIN_NAMESPACE
53 /*! \ingroup GrpBaseFieldContainerFields
54 \ingroup GrpLibOSGBase
57 template <typename AccessHandlerT,
58 Int32 NamespaceI = 0>
59 class ChildPointerSFieldBase
60 : public PointerSFieldCommon<AccessHandlerT, NamespaceI>
62 /*========================== PUBLIC =================================*/
64 public:
66 /*---------------------------------------------------------------------*/
67 /*! \name Public Types */
68 /*! \{ */
70 typedef PointerSFieldCommon <AccessHandlerT,
71 NamespaceI > Inherited;
72 typedef ChildPointerSFieldBase Self;
74 typedef FieldContainer * const const_value;
76 /*! \} */
77 /*---------------------------------------------------------------------*/
78 /*! \name Child Linking Information */
79 /*! \{ */
81 FieldContainer *getEnclosingObject(void) const;
82 UInt16 getChildFieldId (void) const;
83 UInt16 getParentFieldId (void) const;
85 /*! \} */
86 /*========================= PROTECTED ===============================*/
88 protected:
90 /*---------------------------------------------------------------------*/
91 /*! \name Constructors */
92 /*! \{ */
94 ChildPointerSFieldBase(FieldContainer * const pParent,
95 UInt16 usChildFieldId,
96 UInt16 usParentFieldId);
98 ChildPointerSFieldBase(const_value value,
99 FieldContainer * const pParent,
100 UInt16 usChildFieldId,
101 UInt16 usParentFieldId);
103 /*! \} */
104 /*---------------------------------------------------------------------*/
105 /*! \name Destructor */
106 /*! \{ */
108 ~ChildPointerSFieldBase(void);
110 /*! \} */
111 /*---------------------------------------------------------------------*/
112 /*! \name Child Linking Information */
113 /*! \{ */
115 void setEnclosingObject(FieldContainer * const pObj );
116 void setChildFieldId (UInt16 const childFieldId );
117 void setParentFieldId (UInt16 const usParentFieldId);
119 /*! \} */
120 /*---------------------------------------------------------------------*/
121 /*! \name Members */
122 /*! \{ */
124 FieldContainer *_pEnclosingObj;
125 UInt16 _childFieldId;
126 UInt16 _usParentFieldId;
128 /*! \} */
129 /*========================== PRIVATE ================================*/
131 private:
133 template<typename RefCountPolicyT>
134 friend class ChildAccessHandler;
136 /*!\brief prohibit default function (move to 'public' if needed) */
137 ChildPointerSFieldBase(const Self &source);
138 /*!\brief prohibit default function (move to 'public' if needed) */
139 void operator = (const Self &source);
142 OSG_END_NAMESPACE
144 #include "OSGChildPointerSFieldBase.inl"
146 #endif // _OSGCHILDPOINTERSFIELDBASE_H_