changed: gcc8 base update
[opensg.git] / Source / System / FieldContainer / Misc / OSGTraversalDataBase.cpp
blobd1b312d0e65264f0dd76e50c960175c03d96b2f4
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 TraversalData!
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 "OSGTraversalDataBase.h"
67 #include "OSGTraversalData.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::TraversalData
78 Data use for rendering by the any stage, holds bookkeeping data
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
86 /***************************************************************************\
87 * FieldType/FieldTrait Instantiation *
88 \***************************************************************************/
90 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
91 PointerType FieldTraits<TraversalData *, nsOSG>::_type(
92 "TraversalDataPtr",
93 "FieldContainerPtr",
94 TraversalData::getClassType(),
95 nsOSG);
96 #endif
98 OSG_FIELDTRAITS_GETTYPE_NS(TraversalData *, nsOSG)
100 /***************************************************************************\
101 * Field Description *
102 \***************************************************************************/
104 void TraversalDataBase::classDescInserter(TypeObject &oType)
109 TraversalDataBase::TypeObject TraversalDataBase::_type(
110 TraversalDataBase::getClassname(),
111 Inherited::getClassname(),
112 "NULL",
113 nsOSG, //Namespace
114 reinterpret_cast<PrototypeCreateF>(&TraversalDataBase::createEmptyLocal),
115 reinterpret_cast<InitContainerF>(&TraversalData::initMethod),
116 reinterpret_cast<ExitContainerF>(&TraversalData::exitMethod),
117 reinterpret_cast<InitalInsertDescFunc>(
118 reinterpret_cast<void *>(&TraversalData::classDescInserter)),
119 false,
121 "<?xml version=\"1.0\"?>\n"
122 "\n"
123 "<FieldContainer\n"
124 " name=\"TraversalData\"\n"
125 " parent=\"FieldContainer\"\n"
126 " library=\"System\"\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 " isBundle=\"true\"\n"
135 " docGroupBase=\"GrpGroupStage\"\n"
136 " >\n"
137 " Data use for rendering by the any stage, holds bookkeeping data\n"
138 "</FieldContainer>\n",
139 "Data use for rendering by the any stage, holds bookkeeping data\n"
142 /*------------------------------ get -----------------------------------*/
144 FieldContainerType &TraversalDataBase::getType(void)
146 return _type;
149 const FieldContainerType &TraversalDataBase::getType(void) const
151 return _type;
154 UInt32 TraversalDataBase::getContainerSize(void) const
156 return sizeof(TraversalData);
159 /*------------------------- decorator get ------------------------------*/
166 /*------------------------------ access -----------------------------------*/
168 SizeT TraversalDataBase::getBinSize(ConstFieldMaskArg whichField)
170 SizeT returnValue = Inherited::getBinSize(whichField);
173 return returnValue;
176 void TraversalDataBase::copyToBin(BinaryDataHandler &pMem,
177 ConstFieldMaskArg whichField)
179 Inherited::copyToBin(pMem, whichField);
183 void TraversalDataBase::copyFromBin(BinaryDataHandler &pMem,
184 ConstFieldMaskArg whichField)
186 Inherited::copyFromBin(pMem, whichField);
190 //! create a new instance of the class
191 TraversalDataTransitPtr TraversalDataBase::createLocal(BitVector bFlags)
193 TraversalDataTransitPtr fc;
195 if(getClassType().getPrototype() != NULL)
197 FieldContainerTransitPtr tmpPtr =
198 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
200 fc = dynamic_pointer_cast<TraversalData>(tmpPtr);
203 return fc;
206 //! create a new instance of the class, copy the container flags
207 TraversalDataTransitPtr TraversalDataBase::createDependent(BitVector bFlags)
209 TraversalDataTransitPtr fc;
211 if(getClassType().getPrototype() != NULL)
213 FieldContainerTransitPtr tmpPtr =
214 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
216 fc = dynamic_pointer_cast<TraversalData>(tmpPtr);
219 return fc;
222 //! create a new instance of the class
223 TraversalDataTransitPtr TraversalDataBase::create(void)
225 return createLocal();
228 TraversalData *TraversalDataBase::createEmptyLocal(BitVector bFlags)
230 TraversalData *returnValue;
232 newPtr<TraversalData>(returnValue, bFlags);
234 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
236 return returnValue;
239 //! create an empty new instance of the class, do not copy the prototype
240 TraversalData *TraversalDataBase::createEmpty(void)
242 return createEmptyLocal();
246 FieldContainerTransitPtr TraversalDataBase::shallowCopyLocal(
247 BitVector bFlags) const
249 TraversalData *tmpPtr;
251 newPtr(tmpPtr, dynamic_cast<const TraversalData *>(this), bFlags);
253 FieldContainerTransitPtr returnValue(tmpPtr);
255 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
257 return returnValue;
260 FieldContainerTransitPtr TraversalDataBase::shallowCopyDependent(
261 BitVector bFlags) const
263 TraversalData *tmpPtr;
265 newPtr(tmpPtr, dynamic_cast<const TraversalData *>(this), ~bFlags);
267 FieldContainerTransitPtr returnValue(tmpPtr);
269 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
271 return returnValue;
274 FieldContainerTransitPtr TraversalDataBase::shallowCopy(void) const
276 return shallowCopyLocal();
282 /*------------------------- constructors ----------------------------------*/
284 TraversalDataBase::TraversalDataBase(void) :
285 Inherited()
289 TraversalDataBase::TraversalDataBase(const TraversalDataBase &source) :
290 Inherited(source)
295 /*-------------------------- destructors ----------------------------------*/
297 TraversalDataBase::~TraversalDataBase(void)
303 #ifdef OSG_MT_CPTR_ASPECT
304 void TraversalDataBase::execSyncV( FieldContainer &oFrom,
305 ConstFieldMaskArg whichField,
306 AspectOffsetStore &oOffsets,
307 ConstFieldMaskArg syncMode,
308 const UInt32 uiSyncInfo)
310 TraversalData *pThis = static_cast<TraversalData *>(this);
312 pThis->execSync(static_cast<TraversalData *>(&oFrom),
313 whichField,
314 oOffsets,
315 syncMode,
316 uiSyncInfo);
318 #endif
321 #ifdef OSG_MT_CPTR_ASPECT
322 FieldContainer *TraversalDataBase::createAspectCopy(
323 const FieldContainer *pRefAspect) const
325 TraversalData *returnValue;
327 newAspectCopy(returnValue,
328 dynamic_cast<const TraversalData *>(pRefAspect),
329 dynamic_cast<const TraversalData *>(this));
331 return returnValue;
333 #endif
335 void TraversalDataBase::resolveLinks(void)
337 Inherited::resolveLinks();
343 OSG_END_NAMESPACE