1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
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 \*****************************************************************************/
56 #include "OSGConfig.h"
61 #include "OSGFCDTestFCBase.h"
62 #include "OSGFCDTestFC.h"
64 #include <boost/bind.hpp>
66 #ifdef WIN32 // turn off 'this' : used in base member initializer list warning
67 #pragma warning(disable:4355)
72 /***************************************************************************\
74 \***************************************************************************/
76 /*! \class OSG::FCDTestFC
80 /***************************************************************************\
81 * Field Documentation *
82 \***************************************************************************/
84 /*! \var UInt32 FCDTestFCBase::_sfFieldSFPub
88 /*! \var UInt32 FCDTestFCBase::_sfFieldSFPro
92 /*! \var UInt32 FCDTestFCBase::_sfFieldSFNo
96 /*! \var UInt32 FCDTestFCBase::_mfFieldMFPub
100 /*! \var UInt32 FCDTestFCBase::_mfFieldMFPro
104 /*! \var UInt32 FCDTestFCBase::_mfFieldMFNo
109 /***************************************************************************\
110 * FieldType/FieldTrait Instantiation *
111 \***************************************************************************/
113 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
114 PointerType FieldTraits
<FCDTestFC
*, nsOSG
>::_type(
117 FCDTestFC::getClassType(),
121 OSG_FIELDTRAITS_GETTYPE_NS(FCDTestFC
*, nsOSG
)
123 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
127 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
131 DataType
&FieldTraits
< FCDTestFC
*, nsOSG
+ 1 >::getType(void)
133 return FieldTraits
<FCDTestFC
*, nsOSG
>::getType();
137 OSG_EXPORT_PTR_SFIELD(ChildPointerSField
,
139 UnrecordedRefCountPolicy
,
143 OSG_EXPORT_PTR_MFIELD(ChildPointerMField
,
145 UnrecordedRefCountPolicy
,
149 /***************************************************************************\
150 * Field Description *
151 \***************************************************************************/
153 void FCDTestFCBase::classDescInserter(TypeObject
&oType
)
155 FieldDescriptionBase
*pDesc
= NULL
;
158 pDesc
= new SFUInt32::Description(
159 SFUInt32::getClassType(),
162 FieldSFPubFieldId
, FieldSFPubFieldMask
,
164 (Field::SFDefaultFlags
| Field::FStdAccess
),
165 static_cast<FieldEditMethodSig
>(&FCDTestFC::editHandleFieldSFPub
),
166 static_cast<FieldGetMethodSig
>(&FCDTestFC::getHandleFieldSFPub
));
168 oType
.addInitialDesc(pDesc
);
170 pDesc
= new SFUInt32::Description(
171 SFUInt32::getClassType(),
174 FieldSFProFieldId
, FieldSFProFieldMask
,
176 (Field::SFDefaultFlags
| Field::FStdAccess
),
177 static_cast<FieldEditMethodSig
>(&FCDTestFC::editHandleFieldSFPro
),
178 static_cast<FieldGetMethodSig
>(&FCDTestFC::getHandleFieldSFPro
));
180 oType
.addInitialDesc(pDesc
);
182 pDesc
= new SFUInt32::Description(
183 SFUInt32::getClassType(),
186 FieldSFNoFieldId
, FieldSFNoFieldMask
,
188 (Field::SFDefaultFlags
| Field::FStdAccess
),
189 static_cast <FieldEditMethodSig
>(&FCDTestFC::invalidEditField
),
190 static_cast <FieldGetMethodSig
>(&FCDTestFC::invalidGetField
));
192 oType
.addInitialDesc(pDesc
);
194 pDesc
= new MFUInt32::Description(
195 MFUInt32::getClassType(),
198 FieldMFPubFieldId
, FieldMFPubFieldMask
,
200 (Field::MFDefaultFlags
| Field::FStdAccess
),
201 static_cast<FieldEditMethodSig
>(&FCDTestFC::editHandleFieldMFPub
),
202 static_cast<FieldGetMethodSig
>(&FCDTestFC::getHandleFieldMFPub
));
204 oType
.addInitialDesc(pDesc
);
206 pDesc
= new MFUInt32::Description(
207 MFUInt32::getClassType(),
210 FieldMFProFieldId
, FieldMFProFieldMask
,
212 (Field::MFDefaultFlags
| Field::FStdAccess
),
213 static_cast<FieldEditMethodSig
>(&FCDTestFC::editHandleFieldMFPro
),
214 static_cast<FieldGetMethodSig
>(&FCDTestFC::getHandleFieldMFPro
));
216 oType
.addInitialDesc(pDesc
);
218 pDesc
= new MFUInt32::Description(
219 MFUInt32::getClassType(),
222 FieldMFNoFieldId
, FieldMFNoFieldMask
,
224 (Field::MFDefaultFlags
| Field::FStdAccess
),
225 static_cast <FieldEditMethodSig
>(&FCDTestFC::invalidEditField
),
226 static_cast <FieldGetMethodSig
>(&FCDTestFC::invalidGetField
));
228 oType
.addInitialDesc(pDesc
);
232 FCDTestFCBase::TypeObject
FCDTestFCBase::_type(
233 FCDTestFCBase::getClassname(),
234 Inherited::getClassname(),
237 reinterpret_cast<PrototypeCreateF
>(&FCDTestFCBase::createEmptyLocal
),
238 FCDTestFC::initMethod
,
239 FCDTestFC::exitMethod
,
240 reinterpret_cast<InitalInsertDescFunc
>(&FCDTestFC::classDescInserter
),
243 "<?xml version=\"1.0\" ?>\n"
246 "\tname=\"FCDTestFC\"\n"
247 "\tparent=\"NodeCore\"\n"
248 "\tlibrary=\"System\"\n"
249 "\tstructure=\"concrete\"\n"
250 "\tpointerfieldtypes=\"both\"\n"
251 "\tsystemcomponent=\"true\"\n"
252 "\tparentsystemcomponent=\"true\"\n"
253 " isNodeCore=\"true\"\n"
254 " childFields=\"both\"\n"
257 " name = \"fieldSFPub\"\n"
258 " type = \"UInt32\"\n"
259 " cardinality = \"single\"\n"
260 " visibility = \"external\"\n"
261 " defaultValue = \"0\"\n"
262 " access = \"public\"\n"
267 " name = \"fieldSFPro\"\n"
268 " type = \"UInt32\"\n"
269 " cardinality = \"single\"\n"
270 " visibility = \"external\"\n"
271 " defaultValue = \"0\"\n"
272 " access = \"protected\"\n"
277 " name = \"fieldSFNo\"\n"
278 " type = \"UInt32\"\n"
279 " cardinality = \"single\"\n"
280 " visibility = \"external\"\n"
281 " defaultValue = \"0\"\n"
282 " access = \"none\"\n"
289 " name = \"fieldMFPub\"\n"
290 " type = \"UInt32\"\n"
291 " cardinality = \"multi\"\n"
292 " visibility = \"external\"\n"
293 " defaultValue = \"0\"\n"
294 " access = \"public\"\n"
299 " name = \"fieldMFPro\"\n"
300 " type = \"UInt32\"\n"
301 " cardinality = \"multi\"\n"
302 " visibility = \"external\"\n"
303 " defaultValue = \"0\"\n"
304 " access = \"protected\"\n"
309 " name = \"fieldMFNo\"\n"
310 " type = \"UInt32\"\n"
311 " cardinality = \"multi\"\n"
312 " visibility = \"external\"\n"
313 " defaultValue = \"0\"\n"
314 " access = \"none\"\n"
318 "</FieldContainer>\n",
322 /*------------------------------ get -----------------------------------*/
324 FieldContainerType
&FCDTestFCBase::getType(void)
329 const FieldContainerType
&FCDTestFCBase::getType(void) const
334 UInt32
FCDTestFCBase::getContainerSize(void) const
336 return sizeof(FCDTestFC
);
339 /*------------------------- decorator get ------------------------------*/
342 SFUInt32
*FCDTestFCBase::editSFFieldSFPub(void)
344 editSField(FieldSFPubFieldMask
);
346 return &_sfFieldSFPub
;
349 const SFUInt32
*FCDTestFCBase::getSFFieldSFPub(void) const
351 return &_sfFieldSFPub
;
355 SFUInt32
*FCDTestFCBase::editSFFieldSFPro(void)
357 editSField(FieldSFProFieldMask
);
359 return &_sfFieldSFPro
;
362 const SFUInt32
*FCDTestFCBase::getSFFieldSFPro(void) const
364 return &_sfFieldSFPro
;
369 MFUInt32
*FCDTestFCBase::editMFFieldMFPub(void)
371 editMField(FieldMFPubFieldMask
, _mfFieldMFPub
);
373 return &_mfFieldMFPub
;
376 const MFUInt32
*FCDTestFCBase::getMFFieldMFPub(void) const
378 return &_mfFieldMFPub
;
382 MFUInt32
*FCDTestFCBase::editMFFieldMFPro(void)
384 editMField(FieldMFProFieldMask
, _mfFieldMFPro
);
386 return &_mfFieldMFPro
;
389 const MFUInt32
*FCDTestFCBase::getMFFieldMFPro(void) const
391 return &_mfFieldMFPro
;
400 /*------------------------------ access -----------------------------------*/
402 SizeT
FCDTestFCBase::getBinSize(ConstFieldMaskArg whichField
)
404 SizeT returnValue
= Inherited::getBinSize(whichField
);
406 if(FieldBits::NoField
!= (FieldSFPubFieldMask
& whichField
))
408 returnValue
+= _sfFieldSFPub
.getBinSize();
410 if(FieldBits::NoField
!= (FieldSFProFieldMask
& whichField
))
412 returnValue
+= _sfFieldSFPro
.getBinSize();
414 if(FieldBits::NoField
!= (FieldSFNoFieldMask
& whichField
))
416 returnValue
+= _sfFieldSFNo
.getBinSize();
418 if(FieldBits::NoField
!= (FieldMFPubFieldMask
& whichField
))
420 returnValue
+= _mfFieldMFPub
.getBinSize();
422 if(FieldBits::NoField
!= (FieldMFProFieldMask
& whichField
))
424 returnValue
+= _mfFieldMFPro
.getBinSize();
426 if(FieldBits::NoField
!= (FieldMFNoFieldMask
& whichField
))
428 returnValue
+= _mfFieldMFNo
.getBinSize();
434 void FCDTestFCBase::copyToBin(BinaryDataHandler
&pMem
,
435 ConstFieldMaskArg whichField
)
437 Inherited::copyToBin(pMem
, whichField
);
439 if(FieldBits::NoField
!= (FieldSFPubFieldMask
& whichField
))
441 _sfFieldSFPub
.copyToBin(pMem
);
443 if(FieldBits::NoField
!= (FieldSFProFieldMask
& whichField
))
445 _sfFieldSFPro
.copyToBin(pMem
);
447 if(FieldBits::NoField
!= (FieldSFNoFieldMask
& whichField
))
449 _sfFieldSFNo
.copyToBin(pMem
);
451 if(FieldBits::NoField
!= (FieldMFPubFieldMask
& whichField
))
453 _mfFieldMFPub
.copyToBin(pMem
);
455 if(FieldBits::NoField
!= (FieldMFProFieldMask
& whichField
))
457 _mfFieldMFPro
.copyToBin(pMem
);
459 if(FieldBits::NoField
!= (FieldMFNoFieldMask
& whichField
))
461 _mfFieldMFNo
.copyToBin(pMem
);
465 void FCDTestFCBase::copyFromBin(BinaryDataHandler
&pMem
,
466 ConstFieldMaskArg whichField
)
468 Inherited::copyFromBin(pMem
, whichField
);
470 if(FieldBits::NoField
!= (FieldSFPubFieldMask
& whichField
))
472 editSField(FieldSFPubFieldMask
);
473 _sfFieldSFPub
.copyFromBin(pMem
);
475 if(FieldBits::NoField
!= (FieldSFProFieldMask
& whichField
))
477 editSField(FieldSFProFieldMask
);
478 _sfFieldSFPro
.copyFromBin(pMem
);
480 if(FieldBits::NoField
!= (FieldSFNoFieldMask
& whichField
))
482 editSField(FieldSFNoFieldMask
);
483 _sfFieldSFNo
.copyFromBin(pMem
);
485 if(FieldBits::NoField
!= (FieldMFPubFieldMask
& whichField
))
487 editMField(FieldMFPubFieldMask
, _mfFieldMFPub
);
488 _mfFieldMFPub
.copyFromBin(pMem
);
490 if(FieldBits::NoField
!= (FieldMFProFieldMask
& whichField
))
492 editMField(FieldMFProFieldMask
, _mfFieldMFPro
);
493 _mfFieldMFPro
.copyFromBin(pMem
);
495 if(FieldBits::NoField
!= (FieldMFNoFieldMask
& whichField
))
497 editMField(FieldMFNoFieldMask
, _mfFieldMFNo
);
498 _mfFieldMFNo
.copyFromBin(pMem
);
502 //! create a new instance of the class
503 FCDTestFCTransitPtr
FCDTestFCBase::createLocal(BitVector bFlags
)
505 FCDTestFCTransitPtr fc
;
507 if(getClassType().getPrototype() != NULL
)
509 FieldContainerTransitPtr tmpPtr
=
510 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
512 fc
= dynamic_pointer_cast
<FCDTestFC
>(tmpPtr
);
518 //! create a new instance of the class, copy the container flags
519 FCDTestFCTransitPtr
FCDTestFCBase::createDependent(BitVector bFlags
)
521 FCDTestFCTransitPtr fc
;
523 if(getClassType().getPrototype() != NULL
)
525 FieldContainerTransitPtr tmpPtr
=
526 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
528 fc
= dynamic_pointer_cast
<FCDTestFC
>(tmpPtr
);
534 //! create a new instance of the class
535 FCDTestFCTransitPtr
FCDTestFCBase::create(void)
537 FCDTestFCTransitPtr fc
;
539 if(getClassType().getPrototype() != NULL
)
541 FieldContainerTransitPtr tmpPtr
=
542 getClassType().getPrototype()-> shallowCopy();
544 fc
= dynamic_pointer_cast
<FCDTestFC
>(tmpPtr
);
550 FCDTestFC
*FCDTestFCBase::createEmptyLocal(BitVector bFlags
)
552 FCDTestFC
*returnValue
;
554 newPtr
<FCDTestFC
>(returnValue
, bFlags
);
556 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
561 //! create an empty new instance of the class, do not copy the prototype
562 FCDTestFC
*FCDTestFCBase::createEmpty(void)
564 FCDTestFC
*returnValue
;
566 newPtr
<FCDTestFC
>(returnValue
, Thread::getCurrentLocalFlags());
568 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
569 ~Thread::getCurrentLocalFlags();
575 FieldContainerTransitPtr
FCDTestFCBase::shallowCopyLocal(
576 BitVector bFlags
) const
580 newPtr(tmpPtr
, dynamic_cast<const FCDTestFC
*>(this), bFlags
);
582 FieldContainerTransitPtr
returnValue(tmpPtr
);
584 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
589 FieldContainerTransitPtr
FCDTestFCBase::shallowCopyDependent(
590 BitVector bFlags
) const
594 newPtr(tmpPtr
, dynamic_cast<const FCDTestFC
*>(this), ~bFlags
);
596 FieldContainerTransitPtr
returnValue(tmpPtr
);
598 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
603 FieldContainerTransitPtr
FCDTestFCBase::shallowCopy(void) const
608 dynamic_cast<const FCDTestFC
*>(this),
609 Thread::getCurrentLocalFlags());
611 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
613 FieldContainerTransitPtr
returnValue(tmpPtr
);
621 /*------------------------- constructors ----------------------------------*/
623 FCDTestFCBase::FCDTestFCBase(void) :
625 _sfFieldSFPub (UInt32(0)),
626 _sfFieldSFPro (UInt32(0)),
627 _sfFieldSFNo (UInt32(0)),
628 _mfFieldMFPub (UInt32(0)),
629 _mfFieldMFPro (UInt32(0)),
630 _mfFieldMFNo (UInt32(0))
634 FCDTestFCBase::FCDTestFCBase(const FCDTestFCBase
&source
) :
636 _sfFieldSFPub (source
._sfFieldSFPub
),
637 _sfFieldSFPro (source
._sfFieldSFPro
),
638 _sfFieldSFNo (source
._sfFieldSFNo
),
639 _mfFieldMFPub (source
._mfFieldMFPub
),
640 _mfFieldMFPro (source
._mfFieldMFPro
),
641 _mfFieldMFNo (source
._mfFieldMFNo
)
646 /*-------------------------- destructors ----------------------------------*/
648 FCDTestFCBase::~FCDTestFCBase(void)
653 GetFieldHandlePtr
FCDTestFCBase::getHandleFieldSFPub (void) const
655 SFUInt32::GetHandlePtr
returnValue(
656 new SFUInt32::GetHandle(
658 this->getType().getFieldDesc(FieldSFPubFieldId
),
659 const_cast<FCDTestFCBase
*>(this)));
664 EditFieldHandlePtr
FCDTestFCBase::editHandleFieldSFPub (void)
666 SFUInt32::EditHandlePtr
returnValue(
667 new SFUInt32::EditHandle(
669 this->getType().getFieldDesc(FieldSFPubFieldId
),
673 editSField(FieldSFPubFieldMask
);
678 GetFieldHandlePtr
FCDTestFCBase::getHandleFieldSFPro (void) const
680 SFUInt32::GetHandlePtr
returnValue(
681 new SFUInt32::GetHandle(
683 this->getType().getFieldDesc(FieldSFProFieldId
),
684 const_cast<FCDTestFCBase
*>(this)));
689 EditFieldHandlePtr
FCDTestFCBase::editHandleFieldSFPro (void)
691 SFUInt32::EditHandlePtr
returnValue(
692 new SFUInt32::EditHandle(
694 this->getType().getFieldDesc(FieldSFProFieldId
),
698 editSField(FieldSFProFieldMask
);
703 GetFieldHandlePtr
FCDTestFCBase::getHandleFieldSFNo (void) const
705 SFUInt32::GetHandlePtr returnValue
;
710 EditFieldHandlePtr
FCDTestFCBase::editHandleFieldSFNo (void)
712 EditFieldHandlePtr returnValue
;
717 GetFieldHandlePtr
FCDTestFCBase::getHandleFieldMFPub (void) const
719 MFUInt32::GetHandlePtr
returnValue(
720 new MFUInt32::GetHandle(
722 this->getType().getFieldDesc(FieldMFPubFieldId
),
723 const_cast<FCDTestFCBase
*>(this)));
728 EditFieldHandlePtr
FCDTestFCBase::editHandleFieldMFPub (void)
730 MFUInt32::EditHandlePtr
returnValue(
731 new MFUInt32::EditHandle(
733 this->getType().getFieldDesc(FieldMFPubFieldId
),
737 editMField(FieldMFPubFieldMask
, _mfFieldMFPub
);
742 GetFieldHandlePtr
FCDTestFCBase::getHandleFieldMFPro (void) const
744 MFUInt32::GetHandlePtr
returnValue(
745 new MFUInt32::GetHandle(
747 this->getType().getFieldDesc(FieldMFProFieldId
),
748 const_cast<FCDTestFCBase
*>(this)));
753 EditFieldHandlePtr
FCDTestFCBase::editHandleFieldMFPro (void)
755 MFUInt32::EditHandlePtr
returnValue(
756 new MFUInt32::EditHandle(
758 this->getType().getFieldDesc(FieldMFProFieldId
),
762 editMField(FieldMFProFieldMask
, _mfFieldMFPro
);
767 GetFieldHandlePtr
FCDTestFCBase::getHandleFieldMFNo (void) const
769 MFUInt32::GetHandlePtr returnValue
;
774 EditFieldHandlePtr
FCDTestFCBase::editHandleFieldMFNo (void)
776 EditFieldHandlePtr returnValue
;
782 #ifdef OSG_MT_CPTR_ASPECT
783 void FCDTestFCBase::execSyncV( FieldContainer
&oFrom
,
784 ConstFieldMaskArg whichField
,
785 AspectOffsetStore
&oOffsets
,
786 ConstFieldMaskArg syncMode
,
787 const UInt32 uiSyncInfo
)
789 FCDTestFC
*pThis
= static_cast<FCDTestFC
*>(this);
791 pThis
->execSync(static_cast<FCDTestFC
*>(&oFrom
),
800 #ifdef OSG_MT_CPTR_ASPECT
801 FieldContainer
*FCDTestFCBase::createAspectCopy(
802 const FieldContainer
*pRefAspect
) const
804 FCDTestFC
*returnValue
;
806 newAspectCopy(returnValue
,
807 dynamic_cast<const FCDTestFC
*>(pRefAspect
),
808 dynamic_cast<const FCDTestFC
*>(this));
814 void FCDTestFCBase::resolveLinks(void)
816 Inherited::resolveLinks();
818 #ifdef OSG_MT_CPTR_ASPECT
819 AspectOffsetStore oOffsets
;
821 _pAspectStore
->fillOffsetArray(oOffsets
, this);
824 #ifdef OSG_MT_CPTR_ASPECT
825 _mfFieldMFPub
.terminateShare(Thread::getCurrentAspect(),
828 #ifdef OSG_MT_CPTR_ASPECT
829 _mfFieldMFPro
.terminateShare(Thread::getCurrentAspect(),
832 #ifdef OSG_MT_CPTR_ASPECT
833 _mfFieldMFNo
.terminateShare(Thread::getCurrentAspect(),