changed: gcc8 base update
[opensg.git] / Source / System / NodeCores / Groups / Base / OSGGroupBase.cpp
bloba632609612cb8d208b6e9a70a01ec3376a1d7d5c
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 Group!
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 "OSGGroupBase.h"
67 #include "OSGGroup.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::Group
78 Group is the simplest form of a NodeCore. A group
79 carries no predefined data and most actions will only traverse the
80 children list. So usually the group does nothing.
83 /***************************************************************************\
84 * Field Documentation *
85 \***************************************************************************/
88 /***************************************************************************\
89 * FieldType/FieldTrait Instantiation *
90 \***************************************************************************/
92 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
93 PointerType FieldTraits<Group *, nsOSG>::_type(
94 "GroupPtr",
95 "NodeCorePtr",
96 Group::getClassType(),
97 nsOSG);
98 #endif
100 OSG_FIELDTRAITS_GETTYPE_NS(Group *, nsOSG)
102 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
103 Group *,
104 nsOSG)
106 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
107 Group *,
108 nsOSG)
110 /***************************************************************************\
111 * Field Description *
112 \***************************************************************************/
114 void GroupBase::classDescInserter(TypeObject &oType)
119 GroupBase::TypeObject GroupBase::_type(
120 GroupBase::getClassname(),
121 Inherited::getClassname(),
122 "NULL",
123 nsOSG, //Namespace
124 reinterpret_cast<PrototypeCreateF>(&GroupBase::createEmptyLocal),
125 reinterpret_cast<InitContainerF>(&Group::initMethod),
126 reinterpret_cast<ExitContainerF>(&Group::exitMethod),
127 reinterpret_cast<InitalInsertDescFunc>(
128 reinterpret_cast<void *>(&Group::classDescInserter)),
129 false,
131 "<?xml version=\"1.0\" ?>\n"
132 "\n"
133 "<FieldContainer\n"
134 " name=\"Group\"\n"
135 " parent=\"NodeCore\"\n"
136 " library=\"System\"\n"
137 " structure=\"concrete\"\n"
138 " pointerfieldtypes=\"both\"\n"
139 " systemcomponent=\"true\"\n"
140 " parentsystemcomponent=\"true\"\n"
141 " isNodeCore=\"true\"\n"
142 " docGroupBase=\"GrpSystemNodeCoreGroups\"\n"
143 " >\n"
144 "\n"
145 " Group is the simplest form of a NodeCore. A group\n"
146 " carries no predefined data and most actions will only traverse the\n"
147 " children list. So usually the group does nothing.\n"
148 "</FieldContainer>\n",
149 "Group is the simplest form of a NodeCore. A group\n"
150 "carries no predefined data and most actions will only traverse the\n"
151 "children list. So usually the group does nothing.\n"
154 /*------------------------------ get -----------------------------------*/
156 FieldContainerType &GroupBase::getType(void)
158 return _type;
161 const FieldContainerType &GroupBase::getType(void) const
163 return _type;
166 UInt32 GroupBase::getContainerSize(void) const
168 return sizeof(Group);
171 /*------------------------- decorator get ------------------------------*/
178 /*------------------------------ access -----------------------------------*/
180 SizeT GroupBase::getBinSize(ConstFieldMaskArg whichField)
182 SizeT returnValue = Inherited::getBinSize(whichField);
185 return returnValue;
188 void GroupBase::copyToBin(BinaryDataHandler &pMem,
189 ConstFieldMaskArg whichField)
191 Inherited::copyToBin(pMem, whichField);
195 void GroupBase::copyFromBin(BinaryDataHandler &pMem,
196 ConstFieldMaskArg whichField)
198 Inherited::copyFromBin(pMem, whichField);
202 //! create a new instance of the class
203 GroupTransitPtr GroupBase::createLocal(BitVector bFlags)
205 GroupTransitPtr fc;
207 if(getClassType().getPrototype() != NULL)
209 FieldContainerTransitPtr tmpPtr =
210 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
212 fc = dynamic_pointer_cast<Group>(tmpPtr);
215 return fc;
218 //! create a new instance of the class, copy the container flags
219 GroupTransitPtr GroupBase::createDependent(BitVector bFlags)
221 GroupTransitPtr fc;
223 if(getClassType().getPrototype() != NULL)
225 FieldContainerTransitPtr tmpPtr =
226 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
228 fc = dynamic_pointer_cast<Group>(tmpPtr);
231 return fc;
234 //! create a new instance of the class
235 GroupTransitPtr GroupBase::create(void)
237 GroupTransitPtr fc;
239 if(getClassType().getPrototype() != NULL)
241 FieldContainerTransitPtr tmpPtr =
242 getClassType().getPrototype()-> shallowCopy();
244 fc = dynamic_pointer_cast<Group>(tmpPtr);
247 return fc;
250 Group *GroupBase::createEmptyLocal(BitVector bFlags)
252 Group *returnValue;
254 newPtr<Group>(returnValue, bFlags);
256 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
258 return returnValue;
261 //! create an empty new instance of the class, do not copy the prototype
262 Group *GroupBase::createEmpty(void)
264 Group *returnValue;
266 newPtr<Group>(returnValue, Thread::getCurrentLocalFlags());
268 returnValue->_pFieldFlags->_bNamespaceMask &=
269 ~Thread::getCurrentLocalFlags();
271 return returnValue;
275 FieldContainerTransitPtr GroupBase::shallowCopyLocal(
276 BitVector bFlags) const
278 Group *tmpPtr;
280 newPtr(tmpPtr, dynamic_cast<const Group *>(this), bFlags);
282 FieldContainerTransitPtr returnValue(tmpPtr);
284 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
286 return returnValue;
289 FieldContainerTransitPtr GroupBase::shallowCopyDependent(
290 BitVector bFlags) const
292 Group *tmpPtr;
294 newPtr(tmpPtr, dynamic_cast<const Group *>(this), ~bFlags);
296 FieldContainerTransitPtr returnValue(tmpPtr);
298 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
300 return returnValue;
303 FieldContainerTransitPtr GroupBase::shallowCopy(void) const
305 Group *tmpPtr;
307 newPtr(tmpPtr,
308 dynamic_cast<const Group *>(this),
309 Thread::getCurrentLocalFlags());
311 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
313 FieldContainerTransitPtr returnValue(tmpPtr);
315 return returnValue;
321 /*------------------------- constructors ----------------------------------*/
323 GroupBase::GroupBase(void) :
324 Inherited()
328 GroupBase::GroupBase(const GroupBase &source) :
329 Inherited(source)
334 /*-------------------------- destructors ----------------------------------*/
336 GroupBase::~GroupBase(void)
342 #ifdef OSG_MT_CPTR_ASPECT
343 void GroupBase::execSyncV( FieldContainer &oFrom,
344 ConstFieldMaskArg whichField,
345 AspectOffsetStore &oOffsets,
346 ConstFieldMaskArg syncMode,
347 const UInt32 uiSyncInfo)
349 Group *pThis = static_cast<Group *>(this);
351 pThis->execSync(static_cast<Group *>(&oFrom),
352 whichField,
353 oOffsets,
354 syncMode,
355 uiSyncInfo);
357 #endif
360 #ifdef OSG_MT_CPTR_ASPECT
361 FieldContainer *GroupBase::createAspectCopy(
362 const FieldContainer *pRefAspect) const
364 Group *returnValue;
366 newAspectCopy(returnValue,
367 dynamic_cast<const Group *>(pRefAspect),
368 dynamic_cast<const Group *>(this));
370 return returnValue;
372 #endif
374 void GroupBase::resolveLinks(void)
376 Inherited::resolveLinks();
382 OSG_END_NAMESPACE