fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Base / FieldContainer / Fields / PointerFields / OSGChildPointerSField.inl
blob731009f2e1ff6a34414ff34c1c823737d3108da3
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 OSG_BEGIN_NAMESPACE
41 /*-------------------------------------------------------------------------*/
42 /* ChildPointerSField<PtrTypeT,                                         */
43 /*                    NamespaceI  >                                        */
44 /*-------------------------------------------------------------------------*/
46 /*-------------------------------------------------------------------------*/
47 /* Class Type                                                              */
49 /*-------------------------------------------------------------------------*/
50 /* Constructors                                                            */
52 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
53 ChildPointerSField<PtrTypeT,
54                    RefCountPolicy,
55                    NamespaceI    >::ChildPointerSField(
56                        FieldContainer * const pParent,
57                        UInt16                 usChildFieldId,
58                        UInt16                 usParentFieldId) : 
59     Inherited(pParent, 
60               usChildFieldId,
61               usParentFieldId)
65 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
66 ChildPointerSField<PtrTypeT,
67                    RefCountPolicy,
68                    NamespaceI    >::ChildPointerSField(
69                        const_value            value,
70                        FieldContainer * const pParent,
71                        UInt16                 usChildFieldId,
72                        UInt16                 usParentFieldId) :
73     Inherited(value,
74               pParent,
75               usChildFieldId,
76               usParentFieldId)
80 /*-------------------------------------------------------------------------*/
81 /* Destructor                                                              */
83 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline
84 ChildPointerSField<PtrTypeT,
85                    RefCountPolicy,
86                    NamespaceI    >::~ChildPointerSField(void)
90 /*-------------------------------------------------------------------------*/
91 /* Access                                                                  */
93 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline 
94 typename ChildPointerSField<PtrTypeT,
95                             RefCountPolicy,
96                             NamespaceI    >::const_value
97     ChildPointerSField<PtrTypeT,
98                        RefCountPolicy,
99                        NamespaceI    >::getValue(void) const
101     return static_cast<const_value>(this->ptrStoreGet());
104 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline 
105 void ChildPointerSField<PtrTypeT,
106                         RefCountPolicy,
107                         NamespaceI    >::setValue(const_value value)
109     this->ptrStoreSet(value);
112 template <class PtrTypeT, typename RefCountPolicy, Int32 NamespaceI> inline 
113 void ChildPointerSField<PtrTypeT,
114                         RefCountPolicy,
115                         NamespaceI    >::setValue(const Self &source)
117     this->ptrStoreSet(source.ptrStoreGet());
120 template <class    PtrTypeT, 
121           typename RefCountPolicy,
122           Int32    NamespaceI    > inline 
123 void ChildPointerSField<PtrTypeT,
124                         RefCountPolicy,
125                         NamespaceI    >::copyFromBin(BinaryDataHandler &pMem)
127     Inherited::copyFromBin(pMem);
130 #ifdef OSG_MT_CPTR_ASPECT
131 template <class    PtrTypeT, 
132           typename RefCountPolicy,
133           Int32    NamespaceI    > inline 
134 void ChildPointerSField<PtrTypeT,
135                         RefCountPolicy,
136                         NamespaceI    >::syncWith(Self &source)
138     Inherited::syncWith(source);
140 #endif
142 /*-------------------------------------------------------------------------*/
143 /* Comparison                                                              */
145 // template <class PtrTypeT, Int32 NamespaceI>
146 // inline bool
147 //     ChildPointerSField<ObjectTypeT,
148 //                        NamespaceI  >::operator==(Self const &other)
149 // {   
150 // }
152 /*-------------------------------------------------------------------------*/
153 /* Assignment                                                              */
155 OSG_END_NAMESPACE