changed: gcc8 base update
[opensg.git] / Source / Contrib / ComputeBase / Base / OSGComputeElementBase.cpp
blobd3a4e8fcdfa6990624334eec719955b62b35cdc7
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>(
128 reinterpret_cast<void *>(&ComputeElement::classDescInserter)),
129 false,
131 "<?xml version=\"1.0\"?>\n"
132 "\n"
133 "<FieldContainer\n"
134 " name=\"ComputeElement\"\n"
135 " parent=\"Group\"\n"
136 " mixinparent=\"ComputeElementParent\"\n"
137 " library=\"ContribComputeBase\"\n"
138 " pointerfieldtypes=\"both\"\n"
139 " structure=\"concrete\"\n"
140 " systemcomponent=\"true\"\n"
141 " parentsystemcomponent=\"true\"\n"
142 " decoratable=\"false\"\n"
143 " useLocalIncludes=\"false\"\n"
144 " isNodeCore=\"true\"\n"
145 " >\n"
146 " Base of compute elements. \n"
147 "</FieldContainer>\n",
148 "Base of compute elements. \n"
151 /*------------------------------ get -----------------------------------*/
153 FieldContainerType &ComputeElementBase::getType(void)
155 return _type;
158 const FieldContainerType &ComputeElementBase::getType(void) const
160 return _type;
163 UInt32 ComputeElementBase::getContainerSize(void) const
165 return sizeof(ComputeElement);
168 /*------------------------- decorator get ------------------------------*/
175 /*------------------------------ access -----------------------------------*/
177 SizeT ComputeElementBase::getBinSize(ConstFieldMaskArg whichField)
179 SizeT returnValue = Inherited::getBinSize(whichField);
182 return returnValue;
185 void ComputeElementBase::copyToBin(BinaryDataHandler &pMem,
186 ConstFieldMaskArg whichField)
188 Inherited::copyToBin(pMem, whichField);
192 void ComputeElementBase::copyFromBin(BinaryDataHandler &pMem,
193 ConstFieldMaskArg whichField)
195 Inherited::copyFromBin(pMem, whichField);
199 //! create a new instance of the class
200 ComputeElementTransitPtr ComputeElementBase::createLocal(BitVector bFlags)
202 ComputeElementTransitPtr fc;
204 if(getClassType().getPrototype() != NULL)
206 FieldContainerTransitPtr tmpPtr =
207 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
209 fc = dynamic_pointer_cast<ComputeElement>(tmpPtr);
212 return fc;
215 //! create a new instance of the class, copy the container flags
216 ComputeElementTransitPtr ComputeElementBase::createDependent(BitVector bFlags)
218 ComputeElementTransitPtr fc;
220 if(getClassType().getPrototype() != NULL)
222 FieldContainerTransitPtr tmpPtr =
223 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
225 fc = dynamic_pointer_cast<ComputeElement>(tmpPtr);
228 return fc;
231 //! create a new instance of the class
232 ComputeElementTransitPtr ComputeElementBase::create(void)
234 ComputeElementTransitPtr fc;
236 if(getClassType().getPrototype() != NULL)
238 FieldContainerTransitPtr tmpPtr =
239 getClassType().getPrototype()-> shallowCopy();
241 fc = dynamic_pointer_cast<ComputeElement>(tmpPtr);
244 return fc;
247 ComputeElement *ComputeElementBase::createEmptyLocal(BitVector bFlags)
249 ComputeElement *returnValue;
251 newPtr<ComputeElement>(returnValue, bFlags);
253 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
255 return returnValue;
258 //! create an empty new instance of the class, do not copy the prototype
259 ComputeElement *ComputeElementBase::createEmpty(void)
261 ComputeElement *returnValue;
263 newPtr<ComputeElement>(returnValue, Thread::getCurrentLocalFlags());
265 returnValue->_pFieldFlags->_bNamespaceMask &=
266 ~Thread::getCurrentLocalFlags();
268 return returnValue;
272 FieldContainerTransitPtr ComputeElementBase::shallowCopyLocal(
273 BitVector bFlags) const
275 ComputeElement *tmpPtr;
277 newPtr(tmpPtr, dynamic_cast<const ComputeElement *>(this), bFlags);
279 FieldContainerTransitPtr returnValue(tmpPtr);
281 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
283 return returnValue;
286 FieldContainerTransitPtr ComputeElementBase::shallowCopyDependent(
287 BitVector bFlags) const
289 ComputeElement *tmpPtr;
291 newPtr(tmpPtr, dynamic_cast<const ComputeElement *>(this), ~bFlags);
293 FieldContainerTransitPtr returnValue(tmpPtr);
295 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
297 return returnValue;
300 FieldContainerTransitPtr ComputeElementBase::shallowCopy(void) const
302 ComputeElement *tmpPtr;
304 newPtr(tmpPtr,
305 dynamic_cast<const ComputeElement *>(this),
306 Thread::getCurrentLocalFlags());
308 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
310 FieldContainerTransitPtr returnValue(tmpPtr);
312 return returnValue;
318 /*------------------------- constructors ----------------------------------*/
320 ComputeElementBase::ComputeElementBase(void) :
321 Inherited()
325 ComputeElementBase::ComputeElementBase(const ComputeElementBase &source) :
326 Inherited(source)
331 /*-------------------------- destructors ----------------------------------*/
333 ComputeElementBase::~ComputeElementBase(void)
339 #ifdef OSG_MT_CPTR_ASPECT
340 void ComputeElementBase::execSyncV( FieldContainer &oFrom,
341 ConstFieldMaskArg whichField,
342 AspectOffsetStore &oOffsets,
343 ConstFieldMaskArg syncMode,
344 const UInt32 uiSyncInfo)
346 ComputeElement *pThis = static_cast<ComputeElement *>(this);
348 pThis->execSync(static_cast<ComputeElement *>(&oFrom),
349 whichField,
350 oOffsets,
351 syncMode,
352 uiSyncInfo);
354 #endif
357 #ifdef OSG_MT_CPTR_ASPECT
358 FieldContainer *ComputeElementBase::createAspectCopy(
359 const FieldContainer *pRefAspect) const
361 ComputeElement *returnValue;
363 newAspectCopy(returnValue,
364 dynamic_cast<const ComputeElement *>(pRefAspect),
365 dynamic_cast<const ComputeElement *>(this));
367 return returnValue;
369 #endif
371 void ComputeElementBase::resolveLinks(void)
373 Inherited::resolveLinks();
379 OSG_END_NAMESPACE