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 **
48 ** class LinuxEventOptions!
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 "OSGLinuxEventOptionsBase.h"
67 #include "OSGLinuxEventOptions.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::LinuxEventOptions
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var std::string LinuxEventOptionsBase::_sfDevice
89 /*! \var Vec3f LinuxEventOptionsBase::_sfTRange
93 /*! \var Vec3f LinuxEventOptionsBase::_sfRRange
98 /***************************************************************************\
99 * FieldType/FieldTrait Instantiation *
100 \***************************************************************************/
102 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
103 PointerType FieldTraits
<LinuxEventOptions
*, nsOSG
>::_type(
104 "LinuxEventOptionsPtr",
105 "InterfaceOptionsPtr",
106 LinuxEventOptions::getClassType(),
110 OSG_FIELDTRAITS_GETTYPE_NS(LinuxEventOptions
*, nsOSG
)
112 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
117 DataType
&FieldTraits
< LinuxEventOptions
*, nsOSG
+ 1 >::getType(void)
119 return FieldTraits
<LinuxEventOptions
*, nsOSG
>::getType();
123 OSG_EXPORT_PTR_SFIELD(ChildPointerSField
,
125 UnrecordedRefCountPolicy
,
129 /***************************************************************************\
130 * Field Description *
131 \***************************************************************************/
133 void LinuxEventOptionsBase::classDescInserter(TypeObject
&oType
)
135 FieldDescriptionBase
*pDesc
= NULL
;
138 pDesc
= new SFString::Description(
139 SFString::getClassType(),
142 DeviceFieldId
, DeviceFieldMask
,
144 (Field::FStdAccess
| Field::FThreadLocal
),
145 static_cast<FieldEditMethodSig
>(&LinuxEventOptions::editHandleDevice
),
146 static_cast<FieldGetMethodSig
>(&LinuxEventOptions::getHandleDevice
));
148 oType
.addInitialDesc(pDesc
);
150 pDesc
= new SFVec3f::Description(
151 SFVec3f::getClassType(),
154 TRangeFieldId
, TRangeFieldMask
,
156 (Field::FStdAccess
| Field::FThreadLocal
),
157 static_cast<FieldEditMethodSig
>(&LinuxEventOptions::editHandleTRange
),
158 static_cast<FieldGetMethodSig
>(&LinuxEventOptions::getHandleTRange
));
160 oType
.addInitialDesc(pDesc
);
162 pDesc
= new SFVec3f::Description(
163 SFVec3f::getClassType(),
166 RRangeFieldId
, RRangeFieldMask
,
168 (Field::FStdAccess
| Field::FThreadLocal
),
169 static_cast<FieldEditMethodSig
>(&LinuxEventOptions::editHandleRRange
),
170 static_cast<FieldGetMethodSig
>(&LinuxEventOptions::getHandleRRange
));
172 oType
.addInitialDesc(pDesc
);
176 LinuxEventOptionsBase::TypeObject
LinuxEventOptionsBase::_type(
177 LinuxEventOptionsBase::getClassname(),
178 Inherited::getClassname(),
181 reinterpret_cast<PrototypeCreateF
>(&LinuxEventOptionsBase::createEmptyLocal
),
182 reinterpret_cast<InitContainerF
>(&LinuxEventOptions::initMethod
),
183 reinterpret_cast<ExitContainerF
>(&LinuxEventOptions::exitMethod
),
184 reinterpret_cast<InitalInsertDescFunc
>(
185 reinterpret_cast<void *>(&LinuxEventOptions::classDescInserter
)),
188 "<?xml version=\"1.0\"?>\n"
191 " name=\"LinuxEventOptions\"\n"
192 " parent=\"InterfaceOptions\"\n"
193 " library=\"ContribCSM\"\n"
194 " pointerfieldtypes=\"single\"\n"
195 " structure=\"concrete\"\n"
196 " systemcomponent=\"true\"\n"
197 " parentsystemcomponent=\"true\"\n"
198 " decoratable=\"false\"\n"
199 " useLocalIncludes=\"false\"\n"
200 " isNodeCore=\"false\"\n"
201 " isBundle=\"true\"\n"
202 " parentFields=\"none\"\n"
203 " childFields=\"single\"\n"
207 " type=\"std::string\"\n"
208 " cardinality=\"single\"\n"
209 " visibility=\"internal\"\n"
210 " access=\"public\"\n"
211 " defaultValue=\"\"\n"
212 " fieldFlags=\"FStdAccess, FThreadLocal\"\n"
218 " cardinality=\"single\"\n"
219 " visibility=\"internal\"\n"
220 " access=\"public\"\n"
221 " defaultValue=\"\"\n"
222 " fieldFlags=\"FStdAccess, FThreadLocal\"\n"
228 " cardinality=\"single\"\n"
229 " visibility=\"internal\"\n"
230 " access=\"public\"\n"
231 " defaultValue=\"\"\n"
232 " fieldFlags=\"FStdAccess, FThreadLocal\"\n"
235 "</FieldContainer>\n",
239 /*------------------------------ get -----------------------------------*/
241 FieldContainerType
&LinuxEventOptionsBase::getType(void)
246 const FieldContainerType
&LinuxEventOptionsBase::getType(void) const
251 UInt32
LinuxEventOptionsBase::getContainerSize(void) const
253 return sizeof(LinuxEventOptions
);
256 /*------------------------- decorator get ------------------------------*/
259 SFString
*LinuxEventOptionsBase::editSFDevice(void)
261 editSField(DeviceFieldMask
);
266 const SFString
*LinuxEventOptionsBase::getSFDevice(void) const
272 SFVec3f
*LinuxEventOptionsBase::editSFTRange(void)
274 editSField(TRangeFieldMask
);
279 const SFVec3f
*LinuxEventOptionsBase::getSFTRange(void) const
285 SFVec3f
*LinuxEventOptionsBase::editSFRRange(void)
287 editSField(RRangeFieldMask
);
292 const SFVec3f
*LinuxEventOptionsBase::getSFRRange(void) const
302 /*------------------------------ access -----------------------------------*/
304 SizeT
LinuxEventOptionsBase::getBinSize(ConstFieldMaskArg whichField
)
306 SizeT returnValue
= Inherited::getBinSize(whichField
);
308 if(FieldBits::NoField
!= (DeviceFieldMask
& whichField
))
310 returnValue
+= _sfDevice
.getBinSize();
312 if(FieldBits::NoField
!= (TRangeFieldMask
& whichField
))
314 returnValue
+= _sfTRange
.getBinSize();
316 if(FieldBits::NoField
!= (RRangeFieldMask
& whichField
))
318 returnValue
+= _sfRRange
.getBinSize();
324 void LinuxEventOptionsBase::copyToBin(BinaryDataHandler
&pMem
,
325 ConstFieldMaskArg whichField
)
327 Inherited::copyToBin(pMem
, whichField
);
329 if(FieldBits::NoField
!= (DeviceFieldMask
& whichField
))
331 _sfDevice
.copyToBin(pMem
);
333 if(FieldBits::NoField
!= (TRangeFieldMask
& whichField
))
335 _sfTRange
.copyToBin(pMem
);
337 if(FieldBits::NoField
!= (RRangeFieldMask
& whichField
))
339 _sfRRange
.copyToBin(pMem
);
343 void LinuxEventOptionsBase::copyFromBin(BinaryDataHandler
&pMem
,
344 ConstFieldMaskArg whichField
)
346 Inherited::copyFromBin(pMem
, whichField
);
348 if(FieldBits::NoField
!= (DeviceFieldMask
& whichField
))
350 editSField(DeviceFieldMask
);
351 _sfDevice
.copyFromBin(pMem
);
353 if(FieldBits::NoField
!= (TRangeFieldMask
& whichField
))
355 editSField(TRangeFieldMask
);
356 _sfTRange
.copyFromBin(pMem
);
358 if(FieldBits::NoField
!= (RRangeFieldMask
& whichField
))
360 editSField(RRangeFieldMask
);
361 _sfRRange
.copyFromBin(pMem
);
365 //! create a new instance of the class
366 LinuxEventOptionsTransitPtr
LinuxEventOptionsBase::createLocal(BitVector bFlags
)
368 LinuxEventOptionsTransitPtr fc
;
370 if(getClassType().getPrototype() != NULL
)
372 FieldContainerTransitPtr tmpPtr
=
373 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
375 fc
= dynamic_pointer_cast
<LinuxEventOptions
>(tmpPtr
);
381 //! create a new instance of the class, copy the container flags
382 LinuxEventOptionsTransitPtr
LinuxEventOptionsBase::createDependent(BitVector bFlags
)
384 LinuxEventOptionsTransitPtr fc
;
386 if(getClassType().getPrototype() != NULL
)
388 FieldContainerTransitPtr tmpPtr
=
389 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
391 fc
= dynamic_pointer_cast
<LinuxEventOptions
>(tmpPtr
);
397 //! create a new instance of the class
398 LinuxEventOptionsTransitPtr
LinuxEventOptionsBase::create(void)
400 return createLocal();
403 LinuxEventOptions
*LinuxEventOptionsBase::createEmptyLocal(BitVector bFlags
)
405 LinuxEventOptions
*returnValue
;
407 newPtr
<LinuxEventOptions
>(returnValue
, bFlags
);
409 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
414 //! create an empty new instance of the class, do not copy the prototype
415 LinuxEventOptions
*LinuxEventOptionsBase::createEmpty(void)
417 return createEmptyLocal();
421 FieldContainerTransitPtr
LinuxEventOptionsBase::shallowCopyLocal(
422 BitVector bFlags
) const
424 LinuxEventOptions
*tmpPtr
;
426 newPtr(tmpPtr
, dynamic_cast<const LinuxEventOptions
*>(this), bFlags
);
428 FieldContainerTransitPtr
returnValue(tmpPtr
);
430 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
435 FieldContainerTransitPtr
LinuxEventOptionsBase::shallowCopyDependent(
436 BitVector bFlags
) const
438 LinuxEventOptions
*tmpPtr
;
440 newPtr(tmpPtr
, dynamic_cast<const LinuxEventOptions
*>(this), ~bFlags
);
442 FieldContainerTransitPtr
returnValue(tmpPtr
);
444 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
449 FieldContainerTransitPtr
LinuxEventOptionsBase::shallowCopy(void) const
451 return shallowCopyLocal();
457 /*------------------------- constructors ----------------------------------*/
459 LinuxEventOptionsBase::LinuxEventOptionsBase(void) :
467 LinuxEventOptionsBase::LinuxEventOptionsBase(const LinuxEventOptionsBase
&source
) :
469 _sfDevice (source
._sfDevice
),
470 _sfTRange (source
._sfTRange
),
471 _sfRRange (source
._sfRRange
)
476 /*-------------------------- destructors ----------------------------------*/
478 LinuxEventOptionsBase::~LinuxEventOptionsBase(void)
483 GetFieldHandlePtr
LinuxEventOptionsBase::getHandleDevice (void) const
485 SFString::GetHandlePtr
returnValue(
486 new SFString::GetHandle(
488 this->getType().getFieldDesc(DeviceFieldId
),
489 const_cast<LinuxEventOptionsBase
*>(this)));
494 EditFieldHandlePtr
LinuxEventOptionsBase::editHandleDevice (void)
496 SFString::EditHandlePtr
returnValue(
497 new SFString::EditHandle(
499 this->getType().getFieldDesc(DeviceFieldId
),
503 editSField(DeviceFieldMask
);
508 GetFieldHandlePtr
LinuxEventOptionsBase::getHandleTRange (void) const
510 SFVec3f::GetHandlePtr
returnValue(
511 new SFVec3f::GetHandle(
513 this->getType().getFieldDesc(TRangeFieldId
),
514 const_cast<LinuxEventOptionsBase
*>(this)));
519 EditFieldHandlePtr
LinuxEventOptionsBase::editHandleTRange (void)
521 SFVec3f::EditHandlePtr
returnValue(
522 new SFVec3f::EditHandle(
524 this->getType().getFieldDesc(TRangeFieldId
),
528 editSField(TRangeFieldMask
);
533 GetFieldHandlePtr
LinuxEventOptionsBase::getHandleRRange (void) const
535 SFVec3f::GetHandlePtr
returnValue(
536 new SFVec3f::GetHandle(
538 this->getType().getFieldDesc(RRangeFieldId
),
539 const_cast<LinuxEventOptionsBase
*>(this)));
544 EditFieldHandlePtr
LinuxEventOptionsBase::editHandleRRange (void)
546 SFVec3f::EditHandlePtr
returnValue(
547 new SFVec3f::EditHandle(
549 this->getType().getFieldDesc(RRangeFieldId
),
553 editSField(RRangeFieldMask
);
559 #ifdef OSG_MT_CPTR_ASPECT
560 void LinuxEventOptionsBase::execSyncV( FieldContainer
&oFrom
,
561 ConstFieldMaskArg whichField
,
562 AspectOffsetStore
&oOffsets
,
563 ConstFieldMaskArg syncMode
,
564 const UInt32 uiSyncInfo
)
566 LinuxEventOptions
*pThis
= static_cast<LinuxEventOptions
*>(this);
568 pThis
->execSync(static_cast<LinuxEventOptions
*>(&oFrom
),
577 #ifdef OSG_MT_CPTR_ASPECT
578 FieldContainer
*LinuxEventOptionsBase::createAspectCopy(
579 const FieldContainer
*pRefAspect
) const
581 LinuxEventOptions
*returnValue
;
583 newAspectCopy(returnValue
,
584 dynamic_cast<const LinuxEventOptions
*>(pRefAspect
),
585 dynamic_cast<const LinuxEventOptions
*>(this));
591 void LinuxEventOptionsBase::resolveLinks(void)
593 Inherited::resolveLinks();