changed: gcc8 base update
[opensg.git] / Source / System / State / Base / OSGStateChunkBase.cpp
blobc078394b35c8855accd24e58359e08b34cfe9954
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 StateChunk!
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 "OSGStateChunkBase.h"
67 #include "OSGStateChunk.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::StateChunk
78 See \ref PageSystemState for the conceptual background.
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var bool StateChunkBase::_sfIgnore
86 Enables / disables a chunk
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits<StateChunk *, nsOSG>::_type(
96 "StateChunkPtr",
97 "AttachmentPtr",
98 StateChunk::getClassType(),
99 nsOSG);
100 #endif
102 OSG_FIELDTRAITS_GETTYPE_NS(StateChunk *, nsOSG)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
105 StateChunk *,
106 nsOSG)
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
109 StateChunk *,
110 nsOSG)
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void StateChunkBase::classDescInserter(TypeObject &oType)
118 FieldDescriptionBase *pDesc = NULL;
121 pDesc = new SFBool::Description(
122 SFBool::getClassType(),
123 "ignore",
124 "Enables / disables a chunk\n",
125 IgnoreFieldId, IgnoreFieldMask,
126 false,
127 (Field::SFDefaultFlags | Field::FStdAccess),
128 static_cast<FieldEditMethodSig>(&StateChunk::editHandleIgnore),
129 static_cast<FieldGetMethodSig >(&StateChunk::getHandleIgnore));
131 oType.addInitialDesc(pDesc);
135 StateChunkBase::TypeObject StateChunkBase::_type(
136 StateChunkBase::getClassname(),
137 Inherited::getClassname(),
138 "StateChunk",
139 nsOSG, //Namespace
140 NULL,
141 reinterpret_cast<InitContainerF>(&StateChunk::initMethod),
142 reinterpret_cast<ExitContainerF>(&StateChunk::exitMethod),
143 reinterpret_cast<InitalInsertDescFunc>(
144 reinterpret_cast<void *>(&StateChunk::classDescInserter)),
145 false,
147 "<?xml version=\"1.0\"?>\n"
148 "\n"
149 "<FieldContainer\n"
150 " name=\"StateChunk\"\n"
151 " parent=\"Attachment\"\n"
152 " library=\"System\"\n"
153 " structure=\"abstract\"\n"
154 " pointerfieldtypes=\"both\"\n"
155 " systemcomponent=\"true\"\n"
156 " parentsystemcomponent=\"true\"\n"
157 " decoratable=\"false\"\n"
158 " useLocalIncludes=\"false\"\n"
159 " docGroupBase=\"GrpSystemState\"\n"
160 " >\n"
161 " See \\ref PageSystemState for the conceptual background.\n"
162 " <Field\n"
163 "\t name=\"ignore\"\n"
164 "\t type=\"bool\"\n"
165 "\t cardinality=\"single\"\n"
166 "\t visibility=\"external\"\n"
167 "\t defaultValue=\"false\"\n"
168 "\t access=\"public\"\n"
169 "\t >\n"
170 "\tEnables / disables a chunk\n"
171 " </Field>\n"
172 "</FieldContainer>\n",
173 "See \\ref PageSystemState for the conceptual background.\n"
176 /*------------------------------ get -----------------------------------*/
178 FieldContainerType &StateChunkBase::getType(void)
180 return _type;
183 const FieldContainerType &StateChunkBase::getType(void) const
185 return _type;
188 UInt32 StateChunkBase::getContainerSize(void) const
190 return sizeof(StateChunk);
193 /*------------------------- decorator get ------------------------------*/
196 SFBool *StateChunkBase::editSFIgnore(void)
198 editSField(IgnoreFieldMask);
200 return &_sfIgnore;
203 const SFBool *StateChunkBase::getSFIgnore(void) const
205 return &_sfIgnore;
213 /*------------------------------ access -----------------------------------*/
215 SizeT StateChunkBase::getBinSize(ConstFieldMaskArg whichField)
217 SizeT returnValue = Inherited::getBinSize(whichField);
219 if(FieldBits::NoField != (IgnoreFieldMask & whichField))
221 returnValue += _sfIgnore.getBinSize();
224 return returnValue;
227 void StateChunkBase::copyToBin(BinaryDataHandler &pMem,
228 ConstFieldMaskArg whichField)
230 Inherited::copyToBin(pMem, whichField);
232 if(FieldBits::NoField != (IgnoreFieldMask & whichField))
234 _sfIgnore.copyToBin(pMem);
238 void StateChunkBase::copyFromBin(BinaryDataHandler &pMem,
239 ConstFieldMaskArg whichField)
241 Inherited::copyFromBin(pMem, whichField);
243 if(FieldBits::NoField != (IgnoreFieldMask & whichField))
245 editSField(IgnoreFieldMask);
246 _sfIgnore.copyFromBin(pMem);
253 /*------------------------- constructors ----------------------------------*/
255 StateChunkBase::StateChunkBase(void) :
256 Inherited(),
257 _sfIgnore (bool(false))
261 StateChunkBase::StateChunkBase(const StateChunkBase &source) :
262 Inherited(source),
263 _sfIgnore (source._sfIgnore )
268 /*-------------------------- destructors ----------------------------------*/
270 StateChunkBase::~StateChunkBase(void)
275 GetFieldHandlePtr StateChunkBase::getHandleIgnore (void) const
277 SFBool::GetHandlePtr returnValue(
278 new SFBool::GetHandle(
279 &_sfIgnore,
280 this->getType().getFieldDesc(IgnoreFieldId),
281 const_cast<StateChunkBase *>(this)));
283 return returnValue;
286 EditFieldHandlePtr StateChunkBase::editHandleIgnore (void)
288 SFBool::EditHandlePtr returnValue(
289 new SFBool::EditHandle(
290 &_sfIgnore,
291 this->getType().getFieldDesc(IgnoreFieldId),
292 this));
295 editSField(IgnoreFieldMask);
297 return returnValue;
301 #ifdef OSG_MT_CPTR_ASPECT
302 void StateChunkBase::execSyncV( FieldContainer &oFrom,
303 ConstFieldMaskArg whichField,
304 AspectOffsetStore &oOffsets,
305 ConstFieldMaskArg syncMode,
306 const UInt32 uiSyncInfo)
308 StateChunk *pThis = static_cast<StateChunk *>(this);
310 pThis->execSync(static_cast<StateChunk *>(&oFrom),
311 whichField,
312 oOffsets,
313 syncMode,
314 uiSyncInfo);
316 #endif
320 void StateChunkBase::resolveLinks(void)
322 Inherited::resolveLinks();
328 OSG_END_NAMESPACE