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
>(&Group::classDescInserter
),
130 "<?xml version=\"1.0\" ?>\n"
134 " parent=\"NodeCore\"\n"
135 " library=\"System\"\n"
136 " structure=\"concrete\"\n"
137 " pointerfieldtypes=\"both\"\n"
138 " systemcomponent=\"true\"\n"
139 " parentsystemcomponent=\"true\"\n"
140 " isNodeCore=\"true\"\n"
141 " docGroupBase=\"GrpSystemNodeCoreGroups\"\n"
144 " Group is the simplest form of a NodeCore. A group\n"
145 " carries no predefined data and most actions will only traverse the\n"
146 " children list. So usually the group does nothing.\n"
147 "</FieldContainer>\n",
148 "Group is the simplest form of a NodeCore. A group\n"
149 "carries no predefined data and most actions will only traverse the\n"
150 "children list. So usually the group does nothing.\n"
153 /*------------------------------ get -----------------------------------*/
155 FieldContainerType
&GroupBase::getType(void)
160 const FieldContainerType
&GroupBase::getType(void) const
165 UInt32
GroupBase::getContainerSize(void) const
167 return sizeof(Group
);
170 /*------------------------- decorator get ------------------------------*/
177 /*------------------------------ access -----------------------------------*/
179 SizeT
GroupBase::getBinSize(ConstFieldMaskArg whichField
)
181 SizeT returnValue
= Inherited::getBinSize(whichField
);
187 void GroupBase::copyToBin(BinaryDataHandler
&pMem
,
188 ConstFieldMaskArg whichField
)
190 Inherited::copyToBin(pMem
, whichField
);
194 void GroupBase::copyFromBin(BinaryDataHandler
&pMem
,
195 ConstFieldMaskArg whichField
)
197 Inherited::copyFromBin(pMem
, whichField
);
201 //! create a new instance of the class
202 GroupTransitPtr
GroupBase::createLocal(BitVector bFlags
)
206 if(getClassType().getPrototype() != NULL
)
208 FieldContainerTransitPtr tmpPtr
=
209 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
211 fc
= dynamic_pointer_cast
<Group
>(tmpPtr
);
217 //! create a new instance of the class, copy the container flags
218 GroupTransitPtr
GroupBase::createDependent(BitVector bFlags
)
222 if(getClassType().getPrototype() != NULL
)
224 FieldContainerTransitPtr tmpPtr
=
225 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
227 fc
= dynamic_pointer_cast
<Group
>(tmpPtr
);
233 //! create a new instance of the class
234 GroupTransitPtr
GroupBase::create(void)
238 if(getClassType().getPrototype() != NULL
)
240 FieldContainerTransitPtr tmpPtr
=
241 getClassType().getPrototype()-> shallowCopy();
243 fc
= dynamic_pointer_cast
<Group
>(tmpPtr
);
249 Group
*GroupBase::createEmptyLocal(BitVector bFlags
)
253 newPtr
<Group
>(returnValue
, bFlags
);
255 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
260 //! create an empty new instance of the class, do not copy the prototype
261 Group
*GroupBase::createEmpty(void)
265 newPtr
<Group
>(returnValue
, Thread::getCurrentLocalFlags());
267 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
268 ~Thread::getCurrentLocalFlags();
274 FieldContainerTransitPtr
GroupBase::shallowCopyLocal(
275 BitVector bFlags
) const
279 newPtr(tmpPtr
, dynamic_cast<const Group
*>(this), bFlags
);
281 FieldContainerTransitPtr
returnValue(tmpPtr
);
283 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
288 FieldContainerTransitPtr
GroupBase::shallowCopyDependent(
289 BitVector bFlags
) const
293 newPtr(tmpPtr
, dynamic_cast<const Group
*>(this), ~bFlags
);
295 FieldContainerTransitPtr
returnValue(tmpPtr
);
297 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
302 FieldContainerTransitPtr
GroupBase::shallowCopy(void) const
307 dynamic_cast<const Group
*>(this),
308 Thread::getCurrentLocalFlags());
310 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
312 FieldContainerTransitPtr
returnValue(tmpPtr
);
320 /*------------------------- constructors ----------------------------------*/
322 GroupBase::GroupBase(void) :
327 GroupBase::GroupBase(const GroupBase
&source
) :
333 /*-------------------------- destructors ----------------------------------*/
335 GroupBase::~GroupBase(void)
341 #ifdef OSG_MT_CPTR_ASPECT
342 void GroupBase::execSyncV( FieldContainer
&oFrom
,
343 ConstFieldMaskArg whichField
,
344 AspectOffsetStore
&oOffsets
,
345 ConstFieldMaskArg syncMode
,
346 const UInt32 uiSyncInfo
)
348 Group
*pThis
= static_cast<Group
*>(this);
350 pThis
->execSync(static_cast<Group
*>(&oFrom
),
359 #ifdef OSG_MT_CPTR_ASPECT
360 FieldContainer
*GroupBase::createAspectCopy(
361 const FieldContainer
*pRefAspect
) const
365 newAspectCopy(returnValue
,
366 dynamic_cast<const Group
*>(pRefAspect
),
367 dynamic_cast<const Group
*>(this));
373 void GroupBase::resolveLinks(void)
375 Inherited::resolveLinks();