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 **
48 ** class InsertTestTask!
50 *****************************************************************************
51 \*****************************************************************************/
56 #include "OSGConfig.h"
60 #include "OSGCSMWindow.h" // Window Class
62 #include "OSGInsertTestTaskBase.h"
63 #include "OSGInsertTestTask.h"
65 #include <boost/bind.hpp>
67 #ifdef WIN32 // turn off 'this' : used in base member initializer list warning
68 #pragma warning(disable:4355)
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::InsertTestTask
78 just dumps a message on traversal and render for testing
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var std::string InsertTestTaskBase::_sfMessage
89 /*! \var CSMWindow * InsertTestTaskBase::_sfWindow
93 /*! \var OSGAny InsertTestTaskBase::_sfTrigger
98 /***************************************************************************\
99 * FieldType/FieldTrait Instantiation *
100 \***************************************************************************/
102 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
103 PointerType FieldTraits
<InsertTestTask
*, nsOSG
>::_type(
105 "AttachmentContainerPtr",
106 InsertTestTask::getClassType(),
110 OSG_FIELDTRAITS_GETTYPE_NS(InsertTestTask
*, nsOSG
)
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void InsertTestTaskBase::classDescInserter(TypeObject
&oType
)
118 FieldDescriptionBase
*pDesc
= NULL
;
121 pDesc
= new SFString::Description(
122 SFString::getClassType(),
125 MessageFieldId
, MessageFieldMask
,
127 (Field::SFDefaultFlags
| Field::FStdAccess
),
128 static_cast<FieldEditMethodSig
>(&InsertTestTask::editHandleMessage
),
129 static_cast<FieldGetMethodSig
>(&InsertTestTask::getHandleMessage
));
131 oType
.addInitialDesc(pDesc
);
133 pDesc
= new SFWeakCSMWindowPtr::Description(
134 SFWeakCSMWindowPtr::getClassType(),
137 WindowFieldId
, WindowFieldMask
,
139 (Field::SFDefaultFlags
| Field::FStdAccess
),
140 static_cast<FieldEditMethodSig
>(&InsertTestTask::editHandleWindow
),
141 static_cast<FieldGetMethodSig
>(&InsertTestTask::getHandleWindow
));
143 oType
.addInitialDesc(pDesc
);
145 pDesc
= new SFOSGAny::Description(
146 SFOSGAny::getClassType(),
149 TriggerFieldId
, TriggerFieldMask
,
151 (Field::FStdAccess
| Field::FThreadLocal
),
152 static_cast<FieldEditMethodSig
>(&InsertTestTask::editHandleTrigger
),
153 static_cast<FieldGetMethodSig
>(&InsertTestTask::getHandleTrigger
));
155 oType
.addInitialDesc(pDesc
);
159 InsertTestTaskBase::TypeObject
InsertTestTaskBase::_type(
160 InsertTestTaskBase::getClassname(),
161 Inherited::getClassname(),
164 reinterpret_cast<PrototypeCreateF
>(&InsertTestTaskBase::createEmptyLocal
),
165 InsertTestTask::initMethod
,
166 InsertTestTask::exitMethod
,
167 reinterpret_cast<InitalInsertDescFunc
>(&InsertTestTask::classDescInserter
),
170 "<?xml version=\"1.0\"?>\n"
173 " name=\"InsertTestTask\"\n"
174 " parent=\"AttachmentContainer\"\n"
175 " library=\"Group\"\n"
176 " pointerfieldtypes=\"none\"\n"
177 " structure=\"concrete\"\n"
178 " systemcomponent=\"true\"\n"
179 " parentsystemcomponent=\"true\"\n"
180 " decoratable=\"false\"\n"
181 " useLocalIncludes=\"false\"\n"
182 " isNodeCore=\"false\"\n"
184 " just dumps a message on traversal and render for testing\n"
186 " name=\"message\"\n"
187 " type=\"std::string\"\n"
188 " cardinality=\"single\"\n"
189 " visibility=\"external\"\n"
190 " access=\"public\"\n"
195 " type=\"CSMWindow\"\n"
196 " cardinality=\"single\"\n"
197 " category=\"weakpointer\"\n"
198 " visibility=\"external\"\n"
199 " access=\"public\"\n"
203 " name=\"trigger\"\n"
205 " cardinality=\"single\"\n"
206 " visibility=\"internal\"\n"
207 " access=\"protected\"\n"
208 " defaultValue=\"\"\n"
209 " fieldFlags=\"FStdAccess, FThreadLocal\"\n"
212 "</FieldContainer>\n",
213 "just dumps a message on traversal and render for testing\n"
216 /*------------------------------ get -----------------------------------*/
218 FieldContainerType
&InsertTestTaskBase::getType(void)
223 const FieldContainerType
&InsertTestTaskBase::getType(void) const
228 UInt32
InsertTestTaskBase::getContainerSize(void) const
230 return sizeof(InsertTestTask
);
233 /*------------------------- decorator get ------------------------------*/
236 SFString
*InsertTestTaskBase::editSFMessage(void)
238 editSField(MessageFieldMask
);
243 const SFString
*InsertTestTaskBase::getSFMessage(void) const
249 //! Get the InsertTestTask::_sfWindow field.
250 const SFWeakCSMWindowPtr
*InsertTestTaskBase::getSFWindow(void) const
255 SFWeakCSMWindowPtr
*InsertTestTaskBase::editSFWindow (void)
257 editSField(WindowFieldMask
);
262 SFOSGAny
*InsertTestTaskBase::editSFTrigger(void)
264 editSField(TriggerFieldMask
);
269 const SFOSGAny
*InsertTestTaskBase::getSFTrigger(void) const
279 /*------------------------------ access -----------------------------------*/
281 SizeT
InsertTestTaskBase::getBinSize(ConstFieldMaskArg whichField
)
283 SizeT returnValue
= Inherited::getBinSize(whichField
);
285 if(FieldBits::NoField
!= (MessageFieldMask
& whichField
))
287 returnValue
+= _sfMessage
.getBinSize();
289 if(FieldBits::NoField
!= (WindowFieldMask
& whichField
))
291 returnValue
+= _sfWindow
.getBinSize();
293 if(FieldBits::NoField
!= (TriggerFieldMask
& whichField
))
295 returnValue
+= _sfTrigger
.getBinSize();
301 void InsertTestTaskBase::copyToBin(BinaryDataHandler
&pMem
,
302 ConstFieldMaskArg whichField
)
304 Inherited::copyToBin(pMem
, whichField
);
306 if(FieldBits::NoField
!= (MessageFieldMask
& whichField
))
308 _sfMessage
.copyToBin(pMem
);
310 if(FieldBits::NoField
!= (WindowFieldMask
& whichField
))
312 _sfWindow
.copyToBin(pMem
);
314 if(FieldBits::NoField
!= (TriggerFieldMask
& whichField
))
316 _sfTrigger
.copyToBin(pMem
);
320 void InsertTestTaskBase::copyFromBin(BinaryDataHandler
&pMem
,
321 ConstFieldMaskArg whichField
)
323 Inherited::copyFromBin(pMem
, whichField
);
325 if(FieldBits::NoField
!= (MessageFieldMask
& whichField
))
327 editSField(MessageFieldMask
);
328 _sfMessage
.copyFromBin(pMem
);
330 if(FieldBits::NoField
!= (WindowFieldMask
& whichField
))
332 editSField(WindowFieldMask
);
333 _sfWindow
.copyFromBin(pMem
);
335 if(FieldBits::NoField
!= (TriggerFieldMask
& whichField
))
337 editSField(TriggerFieldMask
);
338 _sfTrigger
.copyFromBin(pMem
);
342 //! create a new instance of the class
343 InsertTestTaskTransitPtr
InsertTestTaskBase::createLocal(BitVector bFlags
)
345 InsertTestTaskTransitPtr fc
;
347 if(getClassType().getPrototype() != NULL
)
349 FieldContainerTransitPtr tmpPtr
=
350 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
352 fc
= dynamic_pointer_cast
<InsertTestTask
>(tmpPtr
);
358 //! create a new instance of the class, copy the container flags
359 InsertTestTaskTransitPtr
InsertTestTaskBase::createDependent(BitVector bFlags
)
361 InsertTestTaskTransitPtr fc
;
363 if(getClassType().getPrototype() != NULL
)
365 FieldContainerTransitPtr tmpPtr
=
366 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
368 fc
= dynamic_pointer_cast
<InsertTestTask
>(tmpPtr
);
374 //! create a new instance of the class
375 InsertTestTaskTransitPtr
InsertTestTaskBase::create(void)
377 InsertTestTaskTransitPtr fc
;
379 if(getClassType().getPrototype() != NULL
)
381 FieldContainerTransitPtr tmpPtr
=
382 getClassType().getPrototype()-> shallowCopy();
384 fc
= dynamic_pointer_cast
<InsertTestTask
>(tmpPtr
);
390 InsertTestTask
*InsertTestTaskBase::createEmptyLocal(BitVector bFlags
)
392 InsertTestTask
*returnValue
;
394 newPtr
<InsertTestTask
>(returnValue
, bFlags
);
396 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
401 //! create an empty new instance of the class, do not copy the prototype
402 InsertTestTask
*InsertTestTaskBase::createEmpty(void)
404 InsertTestTask
*returnValue
;
406 newPtr
<InsertTestTask
>(returnValue
, Thread::getCurrentLocalFlags());
408 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
409 ~Thread::getCurrentLocalFlags();
415 FieldContainerTransitPtr
InsertTestTaskBase::shallowCopyLocal(
416 BitVector bFlags
) const
418 InsertTestTask
*tmpPtr
;
420 newPtr(tmpPtr
, dynamic_cast<const InsertTestTask
*>(this), bFlags
);
422 FieldContainerTransitPtr
returnValue(tmpPtr
);
424 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
429 FieldContainerTransitPtr
InsertTestTaskBase::shallowCopyDependent(
430 BitVector bFlags
) const
432 InsertTestTask
*tmpPtr
;
434 newPtr(tmpPtr
, dynamic_cast<const InsertTestTask
*>(this), ~bFlags
);
436 FieldContainerTransitPtr
returnValue(tmpPtr
);
438 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
443 FieldContainerTransitPtr
InsertTestTaskBase::shallowCopy(void) const
445 InsertTestTask
*tmpPtr
;
448 dynamic_cast<const InsertTestTask
*>(this),
449 Thread::getCurrentLocalFlags());
451 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
453 FieldContainerTransitPtr
returnValue(tmpPtr
);
461 /*------------------------- constructors ----------------------------------*/
463 InsertTestTaskBase::InsertTestTaskBase(void) :
471 InsertTestTaskBase::InsertTestTaskBase(const InsertTestTaskBase
&source
) :
473 _sfMessage (source
._sfMessage
),
475 _sfTrigger (source
._sfTrigger
)
480 /*-------------------------- destructors ----------------------------------*/
482 InsertTestTaskBase::~InsertTestTaskBase(void)
486 void InsertTestTaskBase::onCreate(const InsertTestTask
*source
)
488 Inherited::onCreate(source
);
492 InsertTestTask
*pThis
= static_cast<InsertTestTask
*>(this);
494 pThis
->setWindow(source
->getWindow());
498 GetFieldHandlePtr
InsertTestTaskBase::getHandleMessage (void) const
500 SFString::GetHandlePtr
returnValue(
501 new SFString::GetHandle(
503 this->getType().getFieldDesc(MessageFieldId
),
504 const_cast<InsertTestTaskBase
*>(this)));
509 EditFieldHandlePtr
InsertTestTaskBase::editHandleMessage (void)
511 SFString::EditHandlePtr
returnValue(
512 new SFString::EditHandle(
514 this->getType().getFieldDesc(MessageFieldId
),
518 editSField(MessageFieldMask
);
523 GetFieldHandlePtr
InsertTestTaskBase::getHandleWindow (void) const
525 SFWeakCSMWindowPtr::GetHandlePtr
returnValue(
526 new SFWeakCSMWindowPtr::GetHandle(
528 this->getType().getFieldDesc(WindowFieldId
),
529 const_cast<InsertTestTaskBase
*>(this)));
534 EditFieldHandlePtr
InsertTestTaskBase::editHandleWindow (void)
536 SFWeakCSMWindowPtr::EditHandlePtr
returnValue(
537 new SFWeakCSMWindowPtr::EditHandle(
539 this->getType().getFieldDesc(WindowFieldId
),
542 returnValue
->setSetMethod(
543 boost::bind(&InsertTestTask::setWindow
,
544 static_cast<InsertTestTask
*>(this), _1
));
546 editSField(WindowFieldMask
);
551 GetFieldHandlePtr
InsertTestTaskBase::getHandleTrigger (void) const
553 SFOSGAny::GetHandlePtr
returnValue(
554 new SFOSGAny::GetHandle(
556 this->getType().getFieldDesc(TriggerFieldId
),
557 const_cast<InsertTestTaskBase
*>(this)));
562 EditFieldHandlePtr
InsertTestTaskBase::editHandleTrigger (void)
564 SFOSGAny::EditHandlePtr
returnValue(
565 new SFOSGAny::EditHandle(
567 this->getType().getFieldDesc(TriggerFieldId
),
571 editSField(TriggerFieldMask
);
577 #ifdef OSG_MT_CPTR_ASPECT
578 void InsertTestTaskBase::execSyncV( FieldContainer
&oFrom
,
579 ConstFieldMaskArg whichField
,
580 AspectOffsetStore
&oOffsets
,
581 ConstFieldMaskArg syncMode
,
582 const UInt32 uiSyncInfo
)
584 InsertTestTask
*pThis
= static_cast<InsertTestTask
*>(this);
586 pThis
->execSync(static_cast<InsertTestTask
*>(&oFrom
),
595 #ifdef OSG_MT_CPTR_ASPECT
596 FieldContainer
*InsertTestTaskBase::createAspectCopy(
597 const FieldContainer
*pRefAspect
) const
599 InsertTestTask
*returnValue
;
601 newAspectCopy(returnValue
,
602 dynamic_cast<const InsertTestTask
*>(pRefAspect
),
603 dynamic_cast<const InsertTestTask
*>(this));
609 void InsertTestTaskBase::resolveLinks(void)
611 Inherited::resolveLinks();
613 static_cast<InsertTestTask
*>(this)->setWindow(NULL
);