1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
50 *****************************************************************************
51 \*****************************************************************************/
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
61 #include "OSGConfig.h"
66 #include "OSGGroupBase.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
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(
96 Group::getClassType(),
100 OSG_FIELDTRAITS_GETTYPE_NS(Group
*, nsOSG
)
102 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
106 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
110 /***************************************************************************\
111 * Field Description *
112 \***************************************************************************/
114 void GroupBase::classDescInserter(TypeObject
&oType
)
119 GroupBase::TypeObject
GroupBase::_type(
120 GroupBase::getClassname(),
121 Inherited::getClassname(),
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
)),
131 "<?xml version=\"1.0\" ?>\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"
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)
161 const FieldContainerType
&GroupBase::getType(void) const
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
);
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
)
207 if(getClassType().getPrototype() != NULL
)
209 FieldContainerTransitPtr tmpPtr
=
210 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
212 fc
= dynamic_pointer_cast
<Group
>(tmpPtr
);
218 //! create a new instance of the class, copy the container flags
219 GroupTransitPtr
GroupBase::createDependent(BitVector bFlags
)
223 if(getClassType().getPrototype() != NULL
)
225 FieldContainerTransitPtr tmpPtr
=
226 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
228 fc
= dynamic_pointer_cast
<Group
>(tmpPtr
);
234 //! create a new instance of the class
235 GroupTransitPtr
GroupBase::create(void)
239 if(getClassType().getPrototype() != NULL
)
241 FieldContainerTransitPtr tmpPtr
=
242 getClassType().getPrototype()-> shallowCopy();
244 fc
= dynamic_pointer_cast
<Group
>(tmpPtr
);
250 Group
*GroupBase::createEmptyLocal(BitVector bFlags
)
254 newPtr
<Group
>(returnValue
, bFlags
);
256 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
261 //! create an empty new instance of the class, do not copy the prototype
262 Group
*GroupBase::createEmpty(void)
266 newPtr
<Group
>(returnValue
, Thread::getCurrentLocalFlags());
268 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
269 ~Thread::getCurrentLocalFlags();
275 FieldContainerTransitPtr
GroupBase::shallowCopyLocal(
276 BitVector bFlags
) const
280 newPtr(tmpPtr
, dynamic_cast<const Group
*>(this), bFlags
);
282 FieldContainerTransitPtr
returnValue(tmpPtr
);
284 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
289 FieldContainerTransitPtr
GroupBase::shallowCopyDependent(
290 BitVector bFlags
) const
294 newPtr(tmpPtr
, dynamic_cast<const Group
*>(this), ~bFlags
);
296 FieldContainerTransitPtr
returnValue(tmpPtr
);
298 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
303 FieldContainerTransitPtr
GroupBase::shallowCopy(void) const
308 dynamic_cast<const Group
*>(this),
309 Thread::getCurrentLocalFlags());
311 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
313 FieldContainerTransitPtr
returnValue(tmpPtr
);
321 /*------------------------- constructors ----------------------------------*/
323 GroupBase::GroupBase(void) :
328 GroupBase::GroupBase(const GroupBase
&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
),
360 #ifdef OSG_MT_CPTR_ASPECT
361 FieldContainer
*GroupBase::createAspectCopy(
362 const FieldContainer
*pRefAspect
) const
366 newAspectCopy(returnValue
,
367 dynamic_cast<const Group
*>(pRefAspect
),
368 dynamic_cast<const Group
*>(this));
374 void GroupBase::resolveLinks(void)
376 Inherited::resolveLinks();