changed: gcc8 base update
[opensg.git] / Source / Contrib / ComputeBase / Base / OSGAlgorithmComputeElementDataBase.cpp
blobe75e6395c19e93a247c0b8c820201c9ca430cf49
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class AlgorithmComputeElementData!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
66 #include "OSGAlgorithmComputeElementDataBase.h"
67 #include "OSGAlgorithmComputeElementData.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::AlgorithmComputeElementData
78 Data use for rendering by the HDR stage
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
86 /***************************************************************************\
87 * FieldType/FieldTrait Instantiation *
88 \***************************************************************************/
90 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
91 PointerType FieldTraits<AlgorithmComputeElementData *, nsOSG>::_type(
92 "AlgorithmComputeElementDataPtr",
93 "TraversalDataPtr",
94 AlgorithmComputeElementData::getClassType(),
95 nsOSG);
96 #endif
98 OSG_FIELDTRAITS_GETTYPE_NS(AlgorithmComputeElementData *, nsOSG)
100 /***************************************************************************\
101 * Field Description *
102 \***************************************************************************/
104 void AlgorithmComputeElementDataBase::classDescInserter(TypeObject &oType)
109 AlgorithmComputeElementDataBase::TypeObject AlgorithmComputeElementDataBase::_type(
110 AlgorithmComputeElementDataBase::getClassname(),
111 Inherited::getClassname(),
112 "NULL",
113 nsOSG, //Namespace
114 reinterpret_cast<PrototypeCreateF>(&AlgorithmComputeElementDataBase::createEmptyLocal),
115 reinterpret_cast<InitContainerF>(&AlgorithmComputeElementData::initMethod),
116 reinterpret_cast<ExitContainerF>(&AlgorithmComputeElementData::exitMethod),
117 reinterpret_cast<InitalInsertDescFunc>(
118 reinterpret_cast<void *>(&AlgorithmComputeElementData::classDescInserter)),
119 false,
121 "<?xml version=\"1.0\"?>\n"
122 "\n"
123 "<FieldContainer\n"
124 " name=\"AlgorithmComputeElementData\"\n"
125 " parent=\"TraversalData\"\n"
126 " library=\"ContribComputeBase\"\n"
127 " pointerfieldtypes=\"none\"\n"
128 " structure=\"concrete\"\n"
129 " systemcomponent=\"true\"\n"
130 " parentsystemcomponent=\"true\"\n"
131 " decoratable=\"false\"\n"
132 " useLocalIncludes=\"false\"\n"
133 " isNodeCore=\"false\"\n"
134 " docGroupBase=\"GrpEffectsGroupsHDR\"\n"
135 " >\n"
136 " Data use for rendering by the HDR stage\n"
137 "\n"
138 "</FieldContainer>\n",
139 "Data use for rendering by the HDR stage\n"
142 /*------------------------------ get -----------------------------------*/
144 FieldContainerType &AlgorithmComputeElementDataBase::getType(void)
146 return _type;
149 const FieldContainerType &AlgorithmComputeElementDataBase::getType(void) const
151 return _type;
154 UInt32 AlgorithmComputeElementDataBase::getContainerSize(void) const
156 return sizeof(AlgorithmComputeElementData);
159 /*------------------------- decorator get ------------------------------*/
166 /*------------------------------ access -----------------------------------*/
168 SizeT AlgorithmComputeElementDataBase::getBinSize(ConstFieldMaskArg whichField)
170 SizeT returnValue = Inherited::getBinSize(whichField);
173 return returnValue;
176 void AlgorithmComputeElementDataBase::copyToBin(BinaryDataHandler &pMem,
177 ConstFieldMaskArg whichField)
179 Inherited::copyToBin(pMem, whichField);
183 void AlgorithmComputeElementDataBase::copyFromBin(BinaryDataHandler &pMem,
184 ConstFieldMaskArg whichField)
186 Inherited::copyFromBin(pMem, whichField);
190 //! create a new instance of the class
191 AlgorithmComputeElementDataTransitPtr AlgorithmComputeElementDataBase::createLocal(BitVector bFlags)
193 AlgorithmComputeElementDataTransitPtr fc;
195 if(getClassType().getPrototype() != NULL)
197 FieldContainerTransitPtr tmpPtr =
198 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
200 fc = dynamic_pointer_cast<AlgorithmComputeElementData>(tmpPtr);
203 return fc;
206 //! create a new instance of the class, copy the container flags
207 AlgorithmComputeElementDataTransitPtr AlgorithmComputeElementDataBase::createDependent(BitVector bFlags)
209 AlgorithmComputeElementDataTransitPtr fc;
211 if(getClassType().getPrototype() != NULL)
213 FieldContainerTransitPtr tmpPtr =
214 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
216 fc = dynamic_pointer_cast<AlgorithmComputeElementData>(tmpPtr);
219 return fc;
222 //! create a new instance of the class
223 AlgorithmComputeElementDataTransitPtr AlgorithmComputeElementDataBase::create(void)
225 AlgorithmComputeElementDataTransitPtr fc;
227 if(getClassType().getPrototype() != NULL)
229 FieldContainerTransitPtr tmpPtr =
230 getClassType().getPrototype()-> shallowCopy();
232 fc = dynamic_pointer_cast<AlgorithmComputeElementData>(tmpPtr);
235 return fc;
238 AlgorithmComputeElementData *AlgorithmComputeElementDataBase::createEmptyLocal(BitVector bFlags)
240 AlgorithmComputeElementData *returnValue;
242 newPtr<AlgorithmComputeElementData>(returnValue, bFlags);
244 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
246 return returnValue;
249 //! create an empty new instance of the class, do not copy the prototype
250 AlgorithmComputeElementData *AlgorithmComputeElementDataBase::createEmpty(void)
252 AlgorithmComputeElementData *returnValue;
254 newPtr<AlgorithmComputeElementData>(returnValue, Thread::getCurrentLocalFlags());
256 returnValue->_pFieldFlags->_bNamespaceMask &=
257 ~Thread::getCurrentLocalFlags();
259 return returnValue;
263 FieldContainerTransitPtr AlgorithmComputeElementDataBase::shallowCopyLocal(
264 BitVector bFlags) const
266 AlgorithmComputeElementData *tmpPtr;
268 newPtr(tmpPtr, dynamic_cast<const AlgorithmComputeElementData *>(this), bFlags);
270 FieldContainerTransitPtr returnValue(tmpPtr);
272 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
274 return returnValue;
277 FieldContainerTransitPtr AlgorithmComputeElementDataBase::shallowCopyDependent(
278 BitVector bFlags) const
280 AlgorithmComputeElementData *tmpPtr;
282 newPtr(tmpPtr, dynamic_cast<const AlgorithmComputeElementData *>(this), ~bFlags);
284 FieldContainerTransitPtr returnValue(tmpPtr);
286 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
288 return returnValue;
291 FieldContainerTransitPtr AlgorithmComputeElementDataBase::shallowCopy(void) const
293 AlgorithmComputeElementData *tmpPtr;
295 newPtr(tmpPtr,
296 dynamic_cast<const AlgorithmComputeElementData *>(this),
297 Thread::getCurrentLocalFlags());
299 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
301 FieldContainerTransitPtr returnValue(tmpPtr);
303 return returnValue;
309 /*------------------------- constructors ----------------------------------*/
311 AlgorithmComputeElementDataBase::AlgorithmComputeElementDataBase(void) :
312 Inherited()
316 AlgorithmComputeElementDataBase::AlgorithmComputeElementDataBase(const AlgorithmComputeElementDataBase &source) :
317 Inherited(source)
322 /*-------------------------- destructors ----------------------------------*/
324 AlgorithmComputeElementDataBase::~AlgorithmComputeElementDataBase(void)
330 #ifdef OSG_MT_CPTR_ASPECT
331 void AlgorithmComputeElementDataBase::execSyncV( FieldContainer &oFrom,
332 ConstFieldMaskArg whichField,
333 AspectOffsetStore &oOffsets,
334 ConstFieldMaskArg syncMode,
335 const UInt32 uiSyncInfo)
337 AlgorithmComputeElementData *pThis = static_cast<AlgorithmComputeElementData *>(this);
339 pThis->execSync(static_cast<AlgorithmComputeElementData *>(&oFrom),
340 whichField,
341 oOffsets,
342 syncMode,
343 uiSyncInfo);
345 #endif
348 #ifdef OSG_MT_CPTR_ASPECT
349 FieldContainer *AlgorithmComputeElementDataBase::createAspectCopy(
350 const FieldContainer *pRefAspect) const
352 AlgorithmComputeElementData *returnValue;
354 newAspectCopy(returnValue,
355 dynamic_cast<const AlgorithmComputeElementData *>(pRefAspect),
356 dynamic_cast<const AlgorithmComputeElementData *>(this));
358 return returnValue;
360 #endif
362 void AlgorithmComputeElementDataBase::resolveLinks(void)
364 Inherited::resolveLinks();
370 OSG_END_NAMESPACE