changed: gcc8 base update
[opensg.git] / Source / System / FieldContainer / Attachments / OSGBoostPathAttachmentBase.cpp
blob529664a1a1e838d49d89e4571d5b71eea65cebf9
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: David Kabala (djkabala@gmail.com) *
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 BoostPathAttachment!
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 "OSGBoostPathAttachmentBase.h"
67 #include "OSGBoostPathAttachment.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::BoostPathAttachment
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var BoostPath BoostPathAttachmentBase::_sfPath
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits<BoostPathAttachment *, nsOSG>::_type(
96 "BoostPathAttachmentPtr",
97 "AttachmentPtr",
98 BoostPathAttachment::getClassType(),
99 nsOSG);
100 #endif
102 OSG_FIELDTRAITS_GETTYPE_NS(BoostPathAttachment *, nsOSG)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
105 BoostPathAttachment *,
106 nsOSG)
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
109 BoostPathAttachment *,
110 nsOSG)
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void BoostPathAttachmentBase::classDescInserter(TypeObject &oType)
118 FieldDescriptionBase *pDesc = NULL;
121 pDesc = new SFBoostPath::Description(
122 SFBoostPath::getClassType(),
123 "path",
125 PathFieldId, PathFieldMask,
126 true,
127 (Field::SFDefaultFlags | Field::FStdAccess),
128 static_cast<FieldEditMethodSig>(&BoostPathAttachment::editHandlePath),
129 static_cast<FieldGetMethodSig >(&BoostPathAttachment::getHandlePath));
131 oType.addInitialDesc(pDesc);
135 BoostPathAttachmentBase::TypeObject BoostPathAttachmentBase::_type(
136 BoostPathAttachmentBase::getClassname(),
137 Inherited::getClassname(),
138 "BoostPathAttachment",
139 nsOSG, //Namespace
140 reinterpret_cast<PrototypeCreateF>(&BoostPathAttachmentBase::createEmptyLocal),
141 reinterpret_cast<InitContainerF>(&BoostPathAttachment::initMethod),
142 reinterpret_cast<ExitContainerF>(&BoostPathAttachment::exitMethod),
143 reinterpret_cast<InitalInsertDescFunc>(
144 reinterpret_cast<void *>(&BoostPathAttachment::classDescInserter)),
145 false,
147 "<?xml version=\"1.0\"?>\n"
148 "\n"
149 "<FieldContainer\n"
150 " name=\"BoostPathAttachment\"\n"
151 " parent=\"Attachment\"\n"
152 " library=\"System\"\n"
153 " pointerfieldtypes=\"both\"\n"
154 " structure=\"concrete\"\n"
155 " systemcomponent=\"true\"\n"
156 " parentsystemcomponent=\"true\"\n"
157 " decoratable=\"false\"\n"
158 " isNodeCore=\"false\"\n"
159 " authors=\"David Kabala (djkabala@gmail.com) \"\n"
160 " >\n"
161 " <Field\n"
162 " name=\"path\"\n"
163 " type=\"BoostPath\"\n"
164 " category=\"data\"\n"
165 " cardinality=\"single\"\n"
166 " visibility=\"internal\"\n"
167 " defaultValue=\"\"\n"
168 " access=\"public\"\n"
169 " >\n"
170 " </Field>\n"
171 "</FieldContainer>\n",
175 /*------------------------------ get -----------------------------------*/
177 FieldContainerType &BoostPathAttachmentBase::getType(void)
179 return _type;
182 const FieldContainerType &BoostPathAttachmentBase::getType(void) const
184 return _type;
187 UInt32 BoostPathAttachmentBase::getContainerSize(void) const
189 return sizeof(BoostPathAttachment);
192 /*------------------------- decorator get ------------------------------*/
195 SFBoostPath *BoostPathAttachmentBase::editSFPath(void)
197 editSField(PathFieldMask);
199 return &_sfPath;
202 const SFBoostPath *BoostPathAttachmentBase::getSFPath(void) const
204 return &_sfPath;
212 /*------------------------------ access -----------------------------------*/
214 SizeT BoostPathAttachmentBase::getBinSize(ConstFieldMaskArg whichField)
216 SizeT returnValue = Inherited::getBinSize(whichField);
218 if(FieldBits::NoField != (PathFieldMask & whichField))
220 returnValue += _sfPath.getBinSize();
223 return returnValue;
226 void BoostPathAttachmentBase::copyToBin(BinaryDataHandler &pMem,
227 ConstFieldMaskArg whichField)
229 Inherited::copyToBin(pMem, whichField);
231 if(FieldBits::NoField != (PathFieldMask & whichField))
233 _sfPath.copyToBin(pMem);
237 void BoostPathAttachmentBase::copyFromBin(BinaryDataHandler &pMem,
238 ConstFieldMaskArg whichField)
240 Inherited::copyFromBin(pMem, whichField);
242 if(FieldBits::NoField != (PathFieldMask & whichField))
244 editSField(PathFieldMask);
245 _sfPath.copyFromBin(pMem);
249 //! create a new instance of the class
250 BoostPathAttachmentTransitPtr BoostPathAttachmentBase::createLocal(BitVector bFlags)
252 BoostPathAttachmentTransitPtr fc;
254 if(getClassType().getPrototype() != NULL)
256 FieldContainerTransitPtr tmpPtr =
257 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
259 fc = dynamic_pointer_cast<BoostPathAttachment>(tmpPtr);
262 return fc;
265 //! create a new instance of the class, copy the container flags
266 BoostPathAttachmentTransitPtr BoostPathAttachmentBase::createDependent(BitVector bFlags)
268 BoostPathAttachmentTransitPtr fc;
270 if(getClassType().getPrototype() != NULL)
272 FieldContainerTransitPtr tmpPtr =
273 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
275 fc = dynamic_pointer_cast<BoostPathAttachment>(tmpPtr);
278 return fc;
281 //! create a new instance of the class
282 BoostPathAttachmentTransitPtr BoostPathAttachmentBase::create(void)
284 BoostPathAttachmentTransitPtr fc;
286 if(getClassType().getPrototype() != NULL)
288 FieldContainerTransitPtr tmpPtr =
289 getClassType().getPrototype()-> shallowCopy();
291 fc = dynamic_pointer_cast<BoostPathAttachment>(tmpPtr);
294 return fc;
297 BoostPathAttachment *BoostPathAttachmentBase::createEmptyLocal(BitVector bFlags)
299 BoostPathAttachment *returnValue;
301 newPtr<BoostPathAttachment>(returnValue, bFlags);
303 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
305 return returnValue;
308 //! create an empty new instance of the class, do not copy the prototype
309 BoostPathAttachment *BoostPathAttachmentBase::createEmpty(void)
311 BoostPathAttachment *returnValue;
313 newPtr<BoostPathAttachment>(returnValue, Thread::getCurrentLocalFlags());
315 returnValue->_pFieldFlags->_bNamespaceMask &=
316 ~Thread::getCurrentLocalFlags();
318 return returnValue;
322 FieldContainerTransitPtr BoostPathAttachmentBase::shallowCopyLocal(
323 BitVector bFlags) const
325 BoostPathAttachment *tmpPtr;
327 newPtr(tmpPtr, dynamic_cast<const BoostPathAttachment *>(this), bFlags);
329 FieldContainerTransitPtr returnValue(tmpPtr);
331 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
333 return returnValue;
336 FieldContainerTransitPtr BoostPathAttachmentBase::shallowCopyDependent(
337 BitVector bFlags) const
339 BoostPathAttachment *tmpPtr;
341 newPtr(tmpPtr, dynamic_cast<const BoostPathAttachment *>(this), ~bFlags);
343 FieldContainerTransitPtr returnValue(tmpPtr);
345 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
347 return returnValue;
350 FieldContainerTransitPtr BoostPathAttachmentBase::shallowCopy(void) const
352 BoostPathAttachment *tmpPtr;
354 newPtr(tmpPtr,
355 dynamic_cast<const BoostPathAttachment *>(this),
356 Thread::getCurrentLocalFlags());
358 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
360 FieldContainerTransitPtr returnValue(tmpPtr);
362 return returnValue;
368 /*------------------------- constructors ----------------------------------*/
370 BoostPathAttachmentBase::BoostPathAttachmentBase(void) :
371 Inherited(),
372 _sfPath ()
376 BoostPathAttachmentBase::BoostPathAttachmentBase(const BoostPathAttachmentBase &source) :
377 Inherited(source),
378 _sfPath (source._sfPath )
383 /*-------------------------- destructors ----------------------------------*/
385 BoostPathAttachmentBase::~BoostPathAttachmentBase(void)
390 GetFieldHandlePtr BoostPathAttachmentBase::getHandlePath (void) const
392 SFBoostPath::GetHandlePtr returnValue(
393 new SFBoostPath::GetHandle(
394 &_sfPath,
395 this->getType().getFieldDesc(PathFieldId),
396 const_cast<BoostPathAttachmentBase *>(this)));
398 return returnValue;
401 EditFieldHandlePtr BoostPathAttachmentBase::editHandlePath (void)
403 SFBoostPath::EditHandlePtr returnValue(
404 new SFBoostPath::EditHandle(
405 &_sfPath,
406 this->getType().getFieldDesc(PathFieldId),
407 this));
410 editSField(PathFieldMask);
412 return returnValue;
416 #ifdef OSG_MT_CPTR_ASPECT
417 void BoostPathAttachmentBase::execSyncV( FieldContainer &oFrom,
418 ConstFieldMaskArg whichField,
419 AspectOffsetStore &oOffsets,
420 ConstFieldMaskArg syncMode,
421 const UInt32 uiSyncInfo)
423 BoostPathAttachment *pThis = static_cast<BoostPathAttachment *>(this);
425 pThis->execSync(static_cast<BoostPathAttachment *>(&oFrom),
426 whichField,
427 oOffsets,
428 syncMode,
429 uiSyncInfo);
431 #endif
434 #ifdef OSG_MT_CPTR_ASPECT
435 FieldContainer *BoostPathAttachmentBase::createAspectCopy(
436 const FieldContainer *pRefAspect) const
438 BoostPathAttachment *returnValue;
440 newAspectCopy(returnValue,
441 dynamic_cast<const BoostPathAttachment *>(pRefAspect),
442 dynamic_cast<const BoostPathAttachment *>(this));
444 return returnValue;
446 #endif
448 void BoostPathAttachmentBase::resolveLinks(void)
450 Inherited::resolveLinks();
456 OSG_END_NAMESPACE