fixed: gcc8 compile issues
[opensg.git] / Source / Contrib / ComputeBase / Base / OSGComputeCallbackAlgorithmBase.cpp
bloba09b8c0e19793ec9d727f8cae0f2a873be945762
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 ComputeCallbackAlgorithm!
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 "OSGComputeCallbackAlgorithmBase.h"
67 #include "OSGComputeCallbackAlgorithm.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::ComputeCallbackAlgorithm
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var ComputeFunctorCallback ComputeCallbackAlgorithmBase::_sfCallback
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits<ComputeCallbackAlgorithm *, nsOSG>::_type(
96 "ComputeCallbackAlgorithmPtr",
97 "ComputeAlgorithmPtr",
98 ComputeCallbackAlgorithm::getClassType(),
99 nsOSG);
100 #endif
102 OSG_FIELDTRAITS_GETTYPE_NS(ComputeCallbackAlgorithm *, nsOSG)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
105 ComputeCallbackAlgorithm *,
106 nsOSG)
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
109 ComputeCallbackAlgorithm *,
110 nsOSG)
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void ComputeCallbackAlgorithmBase::classDescInserter(TypeObject &oType)
118 FieldDescriptionBase *pDesc = NULL;
121 pDesc = new SFComputeFunctorCallback::Description(
122 SFComputeFunctorCallback::getClassType(),
123 "callback",
125 CallbackFieldId, CallbackFieldMask,
126 false,
127 (Field::SFDefaultFlags | Field::FStdAccess),
128 static_cast <FieldEditMethodSig>(&ComputeCallbackAlgorithm::invalidEditField),
129 static_cast <FieldGetMethodSig >(&ComputeCallbackAlgorithm::invalidGetField));
131 oType.addInitialDesc(pDesc);
135 ComputeCallbackAlgorithmBase::TypeObject ComputeCallbackAlgorithmBase::_type(
136 ComputeCallbackAlgorithmBase::getClassname(),
137 Inherited::getClassname(),
138 "NULL",
139 nsOSG, //Namespace
140 reinterpret_cast<PrototypeCreateF>(&ComputeCallbackAlgorithmBase::createEmptyLocal),
141 reinterpret_cast<InitContainerF>(&ComputeCallbackAlgorithm::initMethod),
142 reinterpret_cast<ExitContainerF>(&ComputeCallbackAlgorithm::exitMethod),
143 reinterpret_cast<InitalInsertDescFunc>(&ComputeCallbackAlgorithm::classDescInserter),
144 false,
146 "<?xml version=\"1.0\"?>\n"
147 "\n"
148 "<FieldContainer\n"
149 " name=\"ComputeCallbackAlgorithm\"\n"
150 " parent=\"ComputeAlgorithm\"\n"
151 " library=\"ContribComputeBase\"\n"
152 " pointerfieldtypes=\"both\"\n"
153 " structure=\"concrete\"\n"
154 " systemcomponent=\"true\"\n"
155 " parentsystemcomponent=\"true\"\n"
156 " decoratable=\"false\"\n"
157 " useLocalIncludes=\"false\"\n"
158 " isNodeCore=\"false\"\n"
159 " >\n"
160 " <Field\n"
161 " name=\"callback\"\n"
162 " type=\"ComputeFunctorCallback\"\n"
163 " cardinality=\"single\"\n"
164 " visibility=\"external\"\n"
165 " access=\"none\"\n"
166 " >\n"
167 " </Field>\n"
168 "</FieldContainer>\n",
172 /*------------------------------ get -----------------------------------*/
174 FieldContainerType &ComputeCallbackAlgorithmBase::getType(void)
176 return _type;
179 const FieldContainerType &ComputeCallbackAlgorithmBase::getType(void) const
181 return _type;
184 UInt32 ComputeCallbackAlgorithmBase::getContainerSize(void) const
186 return sizeof(ComputeCallbackAlgorithm);
189 /*------------------------- decorator get ------------------------------*/
197 /*------------------------------ access -----------------------------------*/
199 SizeT ComputeCallbackAlgorithmBase::getBinSize(ConstFieldMaskArg whichField)
201 SizeT returnValue = Inherited::getBinSize(whichField);
203 if(FieldBits::NoField != (CallbackFieldMask & whichField))
205 returnValue += _sfCallback.getBinSize();
208 return returnValue;
211 void ComputeCallbackAlgorithmBase::copyToBin(BinaryDataHandler &pMem,
212 ConstFieldMaskArg whichField)
214 Inherited::copyToBin(pMem, whichField);
216 if(FieldBits::NoField != (CallbackFieldMask & whichField))
218 _sfCallback.copyToBin(pMem);
222 void ComputeCallbackAlgorithmBase::copyFromBin(BinaryDataHandler &pMem,
223 ConstFieldMaskArg whichField)
225 Inherited::copyFromBin(pMem, whichField);
227 if(FieldBits::NoField != (CallbackFieldMask & whichField))
229 editSField(CallbackFieldMask);
230 _sfCallback.copyFromBin(pMem);
234 //! create a new instance of the class
235 ComputeCallbackAlgorithmTransitPtr ComputeCallbackAlgorithmBase::createLocal(BitVector bFlags)
237 ComputeCallbackAlgorithmTransitPtr fc;
239 if(getClassType().getPrototype() != NULL)
241 FieldContainerTransitPtr tmpPtr =
242 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
244 fc = dynamic_pointer_cast<ComputeCallbackAlgorithm>(tmpPtr);
247 return fc;
250 //! create a new instance of the class, copy the container flags
251 ComputeCallbackAlgorithmTransitPtr ComputeCallbackAlgorithmBase::createDependent(BitVector bFlags)
253 ComputeCallbackAlgorithmTransitPtr fc;
255 if(getClassType().getPrototype() != NULL)
257 FieldContainerTransitPtr tmpPtr =
258 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
260 fc = dynamic_pointer_cast<ComputeCallbackAlgorithm>(tmpPtr);
263 return fc;
266 //! create a new instance of the class
267 ComputeCallbackAlgorithmTransitPtr ComputeCallbackAlgorithmBase::create(void)
269 ComputeCallbackAlgorithmTransitPtr fc;
271 if(getClassType().getPrototype() != NULL)
273 FieldContainerTransitPtr tmpPtr =
274 getClassType().getPrototype()-> shallowCopy();
276 fc = dynamic_pointer_cast<ComputeCallbackAlgorithm>(tmpPtr);
279 return fc;
282 ComputeCallbackAlgorithm *ComputeCallbackAlgorithmBase::createEmptyLocal(BitVector bFlags)
284 ComputeCallbackAlgorithm *returnValue;
286 newPtr<ComputeCallbackAlgorithm>(returnValue, bFlags);
288 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
290 return returnValue;
293 //! create an empty new instance of the class, do not copy the prototype
294 ComputeCallbackAlgorithm *ComputeCallbackAlgorithmBase::createEmpty(void)
296 ComputeCallbackAlgorithm *returnValue;
298 newPtr<ComputeCallbackAlgorithm>(returnValue, Thread::getCurrentLocalFlags());
300 returnValue->_pFieldFlags->_bNamespaceMask &=
301 ~Thread::getCurrentLocalFlags();
303 return returnValue;
307 FieldContainerTransitPtr ComputeCallbackAlgorithmBase::shallowCopyLocal(
308 BitVector bFlags) const
310 ComputeCallbackAlgorithm *tmpPtr;
312 newPtr(tmpPtr, dynamic_cast<const ComputeCallbackAlgorithm *>(this), bFlags);
314 FieldContainerTransitPtr returnValue(tmpPtr);
316 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
318 return returnValue;
321 FieldContainerTransitPtr ComputeCallbackAlgorithmBase::shallowCopyDependent(
322 BitVector bFlags) const
324 ComputeCallbackAlgorithm *tmpPtr;
326 newPtr(tmpPtr, dynamic_cast<const ComputeCallbackAlgorithm *>(this), ~bFlags);
328 FieldContainerTransitPtr returnValue(tmpPtr);
330 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
332 return returnValue;
335 FieldContainerTransitPtr ComputeCallbackAlgorithmBase::shallowCopy(void) const
337 ComputeCallbackAlgorithm *tmpPtr;
339 newPtr(tmpPtr,
340 dynamic_cast<const ComputeCallbackAlgorithm *>(this),
341 Thread::getCurrentLocalFlags());
343 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
345 FieldContainerTransitPtr returnValue(tmpPtr);
347 return returnValue;
353 /*------------------------- constructors ----------------------------------*/
355 ComputeCallbackAlgorithmBase::ComputeCallbackAlgorithmBase(void) :
356 Inherited(),
357 _sfCallback ()
361 ComputeCallbackAlgorithmBase::ComputeCallbackAlgorithmBase(const ComputeCallbackAlgorithmBase &source) :
362 Inherited(source),
363 _sfCallback (source._sfCallback )
368 /*-------------------------- destructors ----------------------------------*/
370 ComputeCallbackAlgorithmBase::~ComputeCallbackAlgorithmBase(void)
375 GetFieldHandlePtr ComputeCallbackAlgorithmBase::getHandleCallback (void) const
377 SFComputeFunctorCallback::GetHandlePtr returnValue;
379 return returnValue;
382 EditFieldHandlePtr ComputeCallbackAlgorithmBase::editHandleCallback (void)
384 EditFieldHandlePtr returnValue;
386 return returnValue;
390 #ifdef OSG_MT_CPTR_ASPECT
391 void ComputeCallbackAlgorithmBase::execSyncV( FieldContainer &oFrom,
392 ConstFieldMaskArg whichField,
393 AspectOffsetStore &oOffsets,
394 ConstFieldMaskArg syncMode,
395 const UInt32 uiSyncInfo)
397 ComputeCallbackAlgorithm *pThis = static_cast<ComputeCallbackAlgorithm *>(this);
399 pThis->execSync(static_cast<ComputeCallbackAlgorithm *>(&oFrom),
400 whichField,
401 oOffsets,
402 syncMode,
403 uiSyncInfo);
405 #endif
408 #ifdef OSG_MT_CPTR_ASPECT
409 FieldContainer *ComputeCallbackAlgorithmBase::createAspectCopy(
410 const FieldContainer *pRefAspect) const
412 ComputeCallbackAlgorithm *returnValue;
414 newAspectCopy(returnValue,
415 dynamic_cast<const ComputeCallbackAlgorithm *>(pRefAspect),
416 dynamic_cast<const ComputeCallbackAlgorithm *>(this));
418 return returnValue;
420 #endif
422 void ComputeCallbackAlgorithmBase::resolveLinks(void)
424 Inherited::resolveLinks();
430 OSG_END_NAMESPACE