fixed: gcc8 compile issues
[opensg.git] / Source / Contrib / ComputeBase / Base / OSGComputeElementBase.cpp
blobefcab52e6cd0446072319a9de9138639a369e726
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 ComputeElement!
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 "OSGComputeElementBase.h"
67 #include "OSGComputeElement.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::ComputeElement
78 Base of compute elements.
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
86 /***************************************************************************\
87 * FieldType/FieldTrait Instantiation *
88 \***************************************************************************/
90 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
91 PointerType FieldTraits<ComputeElement *, nsOSG>::_type(
92 "ComputeElementPtr",
93 "GroupPtr",
94 ComputeElement::getClassType(),
95 nsOSG);
96 #endif
98 OSG_FIELDTRAITS_GETTYPE_NS(ComputeElement *, nsOSG)
100 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
101 ComputeElement *,
102 nsOSG)
104 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
105 ComputeElement *,
106 nsOSG)
108 /***************************************************************************\
109 * Field Description *
110 \***************************************************************************/
112 void ComputeElementBase::classDescInserter(TypeObject &oType)
114 Inherited::classDescInserter(oType);
119 ComputeElementBase::TypeObject ComputeElementBase::_type(
120 ComputeElementBase::getClassname(),
121 Inherited::getClassname(),
122 "NULL",
123 nsOSG, //Namespace
124 reinterpret_cast<PrototypeCreateF>(&ComputeElementBase::createEmptyLocal),
125 reinterpret_cast<InitContainerF>(&ComputeElement::initMethod),
126 reinterpret_cast<ExitContainerF>(&ComputeElement::exitMethod),
127 reinterpret_cast<InitalInsertDescFunc>(&ComputeElement::classDescInserter),
128 false,
130 "<?xml version=\"1.0\"?>\n"
131 "\n"
132 "<FieldContainer\n"
133 " name=\"ComputeElement\"\n"
134 " parent=\"Group\"\n"
135 " mixinparent=\"ComputeElementParent\"\n"
136 " library=\"ContribComputeBase\"\n"
137 " pointerfieldtypes=\"both\"\n"
138 " structure=\"concrete\"\n"
139 " systemcomponent=\"true\"\n"
140 " parentsystemcomponent=\"true\"\n"
141 " decoratable=\"false\"\n"
142 " useLocalIncludes=\"false\"\n"
143 " isNodeCore=\"true\"\n"
144 " >\n"
145 " Base of compute elements. \n"
146 "</FieldContainer>\n",
147 "Base of compute elements. \n"
150 /*------------------------------ get -----------------------------------*/
152 FieldContainerType &ComputeElementBase::getType(void)
154 return _type;
157 const FieldContainerType &ComputeElementBase::getType(void) const
159 return _type;
162 UInt32 ComputeElementBase::getContainerSize(void) const
164 return sizeof(ComputeElement);
167 /*------------------------- decorator get ------------------------------*/
174 /*------------------------------ access -----------------------------------*/
176 SizeT ComputeElementBase::getBinSize(ConstFieldMaskArg whichField)
178 SizeT returnValue = Inherited::getBinSize(whichField);
181 return returnValue;
184 void ComputeElementBase::copyToBin(BinaryDataHandler &pMem,
185 ConstFieldMaskArg whichField)
187 Inherited::copyToBin(pMem, whichField);
191 void ComputeElementBase::copyFromBin(BinaryDataHandler &pMem,
192 ConstFieldMaskArg whichField)
194 Inherited::copyFromBin(pMem, whichField);
198 //! create a new instance of the class
199 ComputeElementTransitPtr ComputeElementBase::createLocal(BitVector bFlags)
201 ComputeElementTransitPtr fc;
203 if(getClassType().getPrototype() != NULL)
205 FieldContainerTransitPtr tmpPtr =
206 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
208 fc = dynamic_pointer_cast<ComputeElement>(tmpPtr);
211 return fc;
214 //! create a new instance of the class, copy the container flags
215 ComputeElementTransitPtr ComputeElementBase::createDependent(BitVector bFlags)
217 ComputeElementTransitPtr fc;
219 if(getClassType().getPrototype() != NULL)
221 FieldContainerTransitPtr tmpPtr =
222 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
224 fc = dynamic_pointer_cast<ComputeElement>(tmpPtr);
227 return fc;
230 //! create a new instance of the class
231 ComputeElementTransitPtr ComputeElementBase::create(void)
233 ComputeElementTransitPtr fc;
235 if(getClassType().getPrototype() != NULL)
237 FieldContainerTransitPtr tmpPtr =
238 getClassType().getPrototype()-> shallowCopy();
240 fc = dynamic_pointer_cast<ComputeElement>(tmpPtr);
243 return fc;
246 ComputeElement *ComputeElementBase::createEmptyLocal(BitVector bFlags)
248 ComputeElement *returnValue;
250 newPtr<ComputeElement>(returnValue, bFlags);
252 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
254 return returnValue;
257 //! create an empty new instance of the class, do not copy the prototype
258 ComputeElement *ComputeElementBase::createEmpty(void)
260 ComputeElement *returnValue;
262 newPtr<ComputeElement>(returnValue, Thread::getCurrentLocalFlags());
264 returnValue->_pFieldFlags->_bNamespaceMask &=
265 ~Thread::getCurrentLocalFlags();
267 return returnValue;
271 FieldContainerTransitPtr ComputeElementBase::shallowCopyLocal(
272 BitVector bFlags) const
274 ComputeElement *tmpPtr;
276 newPtr(tmpPtr, dynamic_cast<const ComputeElement *>(this), bFlags);
278 FieldContainerTransitPtr returnValue(tmpPtr);
280 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
282 return returnValue;
285 FieldContainerTransitPtr ComputeElementBase::shallowCopyDependent(
286 BitVector bFlags) const
288 ComputeElement *tmpPtr;
290 newPtr(tmpPtr, dynamic_cast<const ComputeElement *>(this), ~bFlags);
292 FieldContainerTransitPtr returnValue(tmpPtr);
294 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
296 return returnValue;
299 FieldContainerTransitPtr ComputeElementBase::shallowCopy(void) const
301 ComputeElement *tmpPtr;
303 newPtr(tmpPtr,
304 dynamic_cast<const ComputeElement *>(this),
305 Thread::getCurrentLocalFlags());
307 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
309 FieldContainerTransitPtr returnValue(tmpPtr);
311 return returnValue;
317 /*------------------------- constructors ----------------------------------*/
319 ComputeElementBase::ComputeElementBase(void) :
320 Inherited()
324 ComputeElementBase::ComputeElementBase(const ComputeElementBase &source) :
325 Inherited(source)
330 /*-------------------------- destructors ----------------------------------*/
332 ComputeElementBase::~ComputeElementBase(void)
338 #ifdef OSG_MT_CPTR_ASPECT
339 void ComputeElementBase::execSyncV( FieldContainer &oFrom,
340 ConstFieldMaskArg whichField,
341 AspectOffsetStore &oOffsets,
342 ConstFieldMaskArg syncMode,
343 const UInt32 uiSyncInfo)
345 ComputeElement *pThis = static_cast<ComputeElement *>(this);
347 pThis->execSync(static_cast<ComputeElement *>(&oFrom),
348 whichField,
349 oOffsets,
350 syncMode,
351 uiSyncInfo);
353 #endif
356 #ifdef OSG_MT_CPTR_ASPECT
357 FieldContainer *ComputeElementBase::createAspectCopy(
358 const FieldContainer *pRefAspect) const
360 ComputeElement *returnValue;
362 newAspectCopy(returnValue,
363 dynamic_cast<const ComputeElement *>(pRefAspect),
364 dynamic_cast<const ComputeElement *>(this));
366 return returnValue;
368 #endif
370 void ComputeElementBase::resolveLinks(void)
372 Inherited::resolveLinks();
378 OSG_END_NAMESPACE