changed: gcc8 base update
[opensg.git] / Source / Contrib / ComplexSceneManager / Sensor / InterfaceSensors / Devices / OSGLinuxEventOptionsBase.cpp
blobf2c464747aebf65623ab7600bcf31960414aaae8
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class LinuxEventOptions!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
66 #include "OSGLinuxEventOptionsBase.h"
67 #include "OSGLinuxEventOptions.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
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(),
107 nsOSG);
108 #endif
110 OSG_FIELDTRAITS_GETTYPE_NS(LinuxEventOptions *, nsOSG)
112 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
113 LinuxEventOptions *,
114 nsOSG)
117 DataType &FieldTraits< LinuxEventOptions *, nsOSG + 1 >::getType(void)
119 return FieldTraits<LinuxEventOptions *, nsOSG>::getType();
123 OSG_EXPORT_PTR_SFIELD(ChildPointerSField,
124 LinuxEventOptions *,
125 UnrecordedRefCountPolicy,
126 nsOSG + 1)
129 /***************************************************************************\
130 * Field Description *
131 \***************************************************************************/
133 void LinuxEventOptionsBase::classDescInserter(TypeObject &oType)
135 FieldDescriptionBase *pDesc = NULL;
138 pDesc = new SFString::Description(
139 SFString::getClassType(),
140 "device",
142 DeviceFieldId, DeviceFieldMask,
143 true,
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(),
152 "tRange",
154 TRangeFieldId, TRangeFieldMask,
155 true,
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(),
164 "rRange",
166 RRangeFieldId, RRangeFieldMask,
167 true,
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(),
179 "NULL",
180 nsOSG, //Namespace
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)),
186 false,
188 "<?xml version=\"1.0\"?>\n"
189 "\n"
190 "<FieldContainer\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"
204 " >\n"
205 " <Field\n"
206 " name=\"device\"\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"
213 " >\n"
214 " </Field>\n"
215 " <Field\n"
216 " name=\"tRange\"\n"
217 " type=\"Vec3f\"\n"
218 " cardinality=\"single\"\n"
219 " visibility=\"internal\"\n"
220 " access=\"public\"\n"
221 " defaultValue=\"\"\n"
222 " fieldFlags=\"FStdAccess, FThreadLocal\"\n"
223 " >\n"
224 " </Field>\n"
225 " <Field\n"
226 " name=\"rRange\"\n"
227 " type=\"Vec3f\"\n"
228 " cardinality=\"single\"\n"
229 " visibility=\"internal\"\n"
230 " access=\"public\"\n"
231 " defaultValue=\"\"\n"
232 " fieldFlags=\"FStdAccess, FThreadLocal\"\n"
233 " >\n"
234 " </Field>\n"
235 "</FieldContainer>\n",
239 /*------------------------------ get -----------------------------------*/
241 FieldContainerType &LinuxEventOptionsBase::getType(void)
243 return _type;
246 const FieldContainerType &LinuxEventOptionsBase::getType(void) const
248 return _type;
251 UInt32 LinuxEventOptionsBase::getContainerSize(void) const
253 return sizeof(LinuxEventOptions);
256 /*------------------------- decorator get ------------------------------*/
259 SFString *LinuxEventOptionsBase::editSFDevice(void)
261 editSField(DeviceFieldMask);
263 return &_sfDevice;
266 const SFString *LinuxEventOptionsBase::getSFDevice(void) const
268 return &_sfDevice;
272 SFVec3f *LinuxEventOptionsBase::editSFTRange(void)
274 editSField(TRangeFieldMask);
276 return &_sfTRange;
279 const SFVec3f *LinuxEventOptionsBase::getSFTRange(void) const
281 return &_sfTRange;
285 SFVec3f *LinuxEventOptionsBase::editSFRRange(void)
287 editSField(RRangeFieldMask);
289 return &_sfRRange;
292 const SFVec3f *LinuxEventOptionsBase::getSFRRange(void) const
294 return &_sfRRange;
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();
321 return returnValue;
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);
378 return fc;
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);
394 return fc;
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;
411 return returnValue;
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;
432 return returnValue;
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;
446 return returnValue;
449 FieldContainerTransitPtr LinuxEventOptionsBase::shallowCopy(void) const
451 return shallowCopyLocal();
457 /*------------------------- constructors ----------------------------------*/
459 LinuxEventOptionsBase::LinuxEventOptionsBase(void) :
460 Inherited(),
461 _sfDevice (),
462 _sfTRange (),
463 _sfRRange ()
467 LinuxEventOptionsBase::LinuxEventOptionsBase(const LinuxEventOptionsBase &source) :
468 Inherited(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(
487 &_sfDevice,
488 this->getType().getFieldDesc(DeviceFieldId),
489 const_cast<LinuxEventOptionsBase *>(this)));
491 return returnValue;
494 EditFieldHandlePtr LinuxEventOptionsBase::editHandleDevice (void)
496 SFString::EditHandlePtr returnValue(
497 new SFString::EditHandle(
498 &_sfDevice,
499 this->getType().getFieldDesc(DeviceFieldId),
500 this));
503 editSField(DeviceFieldMask);
505 return returnValue;
508 GetFieldHandlePtr LinuxEventOptionsBase::getHandleTRange (void) const
510 SFVec3f::GetHandlePtr returnValue(
511 new SFVec3f::GetHandle(
512 &_sfTRange,
513 this->getType().getFieldDesc(TRangeFieldId),
514 const_cast<LinuxEventOptionsBase *>(this)));
516 return returnValue;
519 EditFieldHandlePtr LinuxEventOptionsBase::editHandleTRange (void)
521 SFVec3f::EditHandlePtr returnValue(
522 new SFVec3f::EditHandle(
523 &_sfTRange,
524 this->getType().getFieldDesc(TRangeFieldId),
525 this));
528 editSField(TRangeFieldMask);
530 return returnValue;
533 GetFieldHandlePtr LinuxEventOptionsBase::getHandleRRange (void) const
535 SFVec3f::GetHandlePtr returnValue(
536 new SFVec3f::GetHandle(
537 &_sfRRange,
538 this->getType().getFieldDesc(RRangeFieldId),
539 const_cast<LinuxEventOptionsBase *>(this)));
541 return returnValue;
544 EditFieldHandlePtr LinuxEventOptionsBase::editHandleRRange (void)
546 SFVec3f::EditHandlePtr returnValue(
547 new SFVec3f::EditHandle(
548 &_sfRRange,
549 this->getType().getFieldDesc(RRangeFieldId),
550 this));
553 editSField(RRangeFieldMask);
555 return returnValue;
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),
569 whichField,
570 oOffsets,
571 syncMode,
572 uiSyncInfo);
574 #endif
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));
587 return returnValue;
589 #endif
591 void LinuxEventOptionsBase::resolveLinks(void)
593 Inherited::resolveLinks();
599 OSG_END_NAMESPACE