fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Contrib / ComputeBase / Base / OSGComputeElementHandlerMixin.inl
blob852659054a5e25f143a1728010966712fd06e1ed
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *           Copyright (C) 2003 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 template <class ParentT> inline
42 bool ComputeElementHandlerMixin<ParentT>::requestRun(void)
44     Self::editSField(Self::RequestRunFieldMask);
46     return true;
49 template <class ParentT> inline
50 void ComputeElementHandlerMixin<ParentT>::changed(ConstFieldMaskArg whichField, 
51                                                   UInt32            origin,
52                                                   BitVector         details)
54 #if 0
55     if(0x0000 != (whichField & RequestRunFieldMask))
56     {
57         Window::requestStageRun(_iStageId);
58     }
59 #endif
61     Inherited::changed(whichField, origin, details);
64 #ifdef WIN32
65 template <class ParentT> inline
66 void ComputeElementHandlerMixin<ParentT>::setData(TraversalData    *pData, 
67                                                   Int32             iDataSlotId,
68                                                   RenderActionBase *pAction    )
70     Inherited::setData(pData, iDataSlotId, pAction);
72 #endif
74 template <class ParentT> inline
75 void ComputeElementHandlerMixin<ParentT>::setData(
76     HardwareContextData *pData, 
77     Int32                iDataSlotId,
78     HardwareContext     *pContext   )
80     HardwareContextData *pStoredData = 
81         pContext->template getData<HardwareContextData *>(this->_iDataSlotId);
83     OSG_ASSERT(iDataSlotId == this->_iDataSlotId);
85     if(pStoredData == NULL)
86     {
87         pContext->setData(pData, this->_iDataSlotId);
89         if(this->hasDestroyedFunctor(
90                boost::bind(&ContextDataSlotHandler::clearData,
91                            pContext,
92                            _1,
93                            _2,
94                            this->_iDataSlotId)) == false)
95         {
96             this->addDestroyedFunctor(
97                 boost::bind(&ContextDataSlotHandler::clearData,
98                             static_cast<ContextDataSlotHandler *>(pContext),
99                             _1,
100                             _2,
101                             this->_iDataSlotId), "");
103             pContext->addDestroyedFunctorFor(
104                 boost::bind(&Self::template clearDestroyedFunctorFor<
105                                 ContextDataSlotHandler>,
106                             this,
107                             _1),
108                 this);
109         }
110     }
113 /*-------------------------------------------------------------------------*/
114 /*                                Set                                      */
116 /*-------------------------------------------------------------------------*/
117 /* Binary access                                                           */
119 /*-------------------------------------------------------------------------*/
120 /*                             Assignment                                  */
123 /*-------------------------------------------------------------------------*/
124 /*                            Constructors                                 */
126 template <class ParentT> inline
127 ComputeElementHandlerMixin<ParentT>::ComputeElementHandlerMixin(void) :
128     Inherited()
130 #if 0
131     _tmpStatus = StageValidator::Finished;
132 #endif
135 template <class ParentT> inline
136 ComputeElementHandlerMixin<ParentT>::ComputeElementHandlerMixin(
137     const ComputeElementHandlerMixin &source) :
139     Inherited(source)
141 #if 0
142     _tmpStatus = StageValidator::Finished;
143 #endif
146 template <class ParentT> inline
147 ComputeElementHandlerMixin<ParentT>::~ComputeElementHandlerMixin(void)
151 template <class ParentT> inline
152 void ComputeElementHandlerMixin<ParentT>::dump(      UInt32    uiIndent,
153                                                const BitVector bvFlags ) const
157 /*-------------------------------------------------------------------------*/
158 /*                             Destructor                                  */
160 /*-------------------------------------------------------------------------*/
161 /*                             Assignment                                  */
163 /*-------------------------------------------------------------------------*/
164 /*                             Comparison                                  */
166 OSG_END_NAMESPACE