fixed: gcc8 compile issues
[opensg.git] / Tools / fcd2code / TemplateFieldContainerBase_cpp.txt
blob0748f1e294b464092b226144373f5de6c68de0e1
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *               Copyright (C) 2000-2013 by the OpenSG Forum                 *
6  *                                                                           *
7  *                            www.opensg.org                                 *
8  *                                                                           *
9 @@if hasAuthors
10 @!AuthorsCommentText!@
11 @@else // hasAuthors
12  * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net  *
13 @@endif // hasAuthors
14  *                                                                           *
15 \*---------------------------------------------------------------------------*/
16 /*---------------------------------------------------------------------------*\
17  *                                License                                    *
18  *                                                                           *
19  * This library is free software; you can redistribute it and/or modify it   *
20  * under the terms of the GNU Library General Public License as published    *
21  * by the Free Software Foundation, version 2.                               *
22  *                                                                           *
23  * This library is distributed in the hope that it will be useful, but       *
24  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
26  * Library General Public License for more details.                          *
27  *                                                                           *
28  * You should have received a copy of the GNU Library General Public         *
29  * License along with this library; if not, write to the Free Software       *
30  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
31  *                                                                           *
32 \*---------------------------------------------------------------------------*/
33 /*---------------------------------------------------------------------------*\
34  *                                Changes                                    *
35  *                                                                           *
36  *                                                                           *
37  *                                                                           *
38  *                                                                           *
39  *                                                                           *
40  *                                                                           *
41 \*---------------------------------------------------------------------------*/
43 /*****************************************************************************\
44  *****************************************************************************
45  **                                                                         **
46  **                  This file is automatically generated.                  **
47  **                                                                         **
48  **          Any changes made to this file WILL be lost when it is          **
49  **           regenerated, which can become necessary at any time.          **
50  **                                                                         **
51  **     Do not change this file, changes should be done in the derived      **
52  **     class @!Classname!@!
53  **                                                                         **
54  *****************************************************************************
55 \*****************************************************************************/
57 @@AdditionalPriorityIncludes@@
58 #include <cstdlib>
59 #include <cstdio>
61 #ifdef WIN32 
62 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
63 #pragma warning(disable: 4290) // disable exception specification warning
64 #endif
66 #include "@!HeaderPrefix!@@!Package!@Config.h"
68 @@AdditionalIncludes@@
70 @@BeginFieldLoop@@
71  @@if field.needDefaultInclude
72 #include @!field.DefaultInclude:30!@   // @!field.Name!@ default header
73  @@endif // field.needDefaultInclude
74 @@EndFieldLoop@@
76 @@BeginFieldLoop@@
77  @@if field.isPtrField
78   @@if field.needTypeInclude
79 #include @!field.TypeInclude:30!@ // @!field.Name!@ Class
80   @@endif // field.isPtrField
81  @@endif // field.needTypeInclude
82 @@EndFieldLoop@@
84 #include "OSG@!nsFilePrefix!@@!Classname!@Base.h"
85 #include "OSG@!nsFilePrefix!@@!Classname!@.h"
87 #include <boost/bind.hpp>
89 OSG_BEGIN_NAMESPACE
91 @@if inExternalNamespace
92 @!LIBNAMESPACE!@_IMPORT_NAMESPACE;
94 @@endif
95 /***************************************************************************\
96  *                            Description                                  *
97 \***************************************************************************/
99 /*! \class OSG::@!Classname!@
100     @!Description!@
101  */
103 /***************************************************************************\
104  *                        Field Documentation                              *
105 \***************************************************************************/
107 @@if isDecorator
108 /*! \var @!Parent!@Ptr @!Classname!@Base::_sfDecoratee
109     The object being decorated
111 @@else // isDecorator
112  @@BeginFieldLoop@@
113   @@if !field.isStoreless
114 /*! \var @!field.FullType:15!@ @!Classname!@Base::_@!field.VarName!@
115     @!field.Description!@
118   @@endif // !field.isStoreless
119  @@EndFieldLoop@@
120 @@endif // isDecorator
122 /***************************************************************************\
123  *                      FieldType/FieldTrait Instantiation                 *
124 \***************************************************************************/
126 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
127 PointerType FieldTraits<@!Classname!@ *, @!nsConst!@>::_type(
128     "@!Classname!@Ptr", 
129     "@!RealParent!@Ptr", 
130     @!Classname!@::getClassType(),
131     @!nsConst!@);
132 #endif
134 @@if PointerField
135 OSG_FIELDTRAITS_GETTYPE_NS(@!Classname!@ *, @!nsConst!@)
137  @@if SFPointerField
138 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
139                            @!Classname!@ *,
140                            @!nsConst!@)
141  @@endif // SFPointerField
143  @@if MFPointerField
144 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
145                            @!Classname!@ *,
146                            @!nsConst!@)
147  @@endif // MFPointerField
148 @@else // PointerField
149 OSG_FIELDTRAITS_GETTYPE_NS(@!Classname!@ *, @!nsConst!@)
150 @@endif // PointerField
151 @@if ChildField
153 DataType &FieldTraits< @!Classname!@ *, @!nsConst!@ + @!ChildNS!@ >::getType(void)
155     return FieldTraits<@!Classname!@ *, @!nsConst!@>::getType();
158 @@endif // ChildField
159 @@if ChildSFields
161 OSG_EXPORT_PTR_SFIELD(ChildPointerSField,
162                       @!Classname!@ *,
163                       UnrecordedRefCountPolicy,
164                       @!nsConst!@ + @!ChildNS!@)
166 @@endif // ChildSFields
167 @@if ChildMFields
169 OSG_EXPORT_PTR_MFIELD(ChildPointerMField,
170                       @!Classname!@ *,
171                       UnrecordedRefCountPolicy,
172                       @!nsConst!@ + @!ChildNS!@)
174 @@endif // ChildMFields
175 @@if ParentField
177 DataType &FieldTraits<@!Classname!@ *, @!nsConst!@ + @!ParentNS!@ >::getType(void)
179     return FieldTraits<@!Classname!@ *, @!nsConst!@>::getType();
182 @@endif // ParentField
183 @@if ParentSFields
185 OSG_SFIELDTYPE_INST(ParentPointerSField,
186                     @!Classname!@ *,
187                     NoRefCountPolicy,
188                     @!nsConst!@ + @!ParentNS!@);
190 OSG_FIELD_DLLEXPORT_DEF3(ParentPointerSField,
191                          @!Classname!@ *,
192                          NoRefCountPolicy,
193                          @!nsConst!@ + @!ParentNS!@)
195 @@endif // ParentSFields
196 @@if ParentMFields
198 OSG_MFIELDTYPE_INST(ParentPointerMField,
199                     @!Classname!@ *,
200                     NoRefCountPolicy,
201                     @!ParentNS!@);
203 OSG_FIELD_DLLEXPORT_DEF3(ParentPointerMField,
204                          @!Classname!@ *,
205                          NoRefCountPolicy,
206                          @!ParentNS!@)
208 @@endif // ParentMFields
209 @@if inExternalNamespace
211 OSG_END_NAMESPACE
212 @@endif
214 /***************************************************************************\
215  *                         Field Description                               *
216 \***************************************************************************/
217 @@if inExternalNamespace
219 @!LIBNAMESPACE!@_BEGIN_NAMESPACE
221 OSG_IMPORT_NAMESPACE;
222 @@endif // inExternalNamespace
224 void @!Classname!@Base::classDescInserter(TypeObject &oType)
226 @@if hasMixinParent
227     Inherited::classDescInserter(oType);
229 @@endif
230 @@if hasFields
231     FieldDescriptionBase *pDesc = NULL;
233 @@endif // hasFields
234 @@if isDecorator
235     pDesc = new SFUnrec@!Parent!@Ptr::Description(
236         SFUnrec@!Parent!@Ptr::getClassType(),
237         "decoratee",
238         "undocumented decoratee",
239         DecorateeFieldId, DecorateeFieldMask,
240         false,
241         @!DecorateeFieldFlags!@,
242         static_cast<FieldEditMethodSig>(&@!Classname!@::editHandleDecoratee),
243         static_cast<FieldGetMethodSig >(&@!Classname!@::getHandleDecoratee ));
245     oType.addInitialDesc(pDesc);
246 @@else // isDecorator
247  @@BeginFieldLoop@@
249     pDesc = new @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps!@::Description(
250         @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps!@::getClassType(),
251         "@!field.DescName!@",
252         @!field.SafeDescription!@,
253         @!field.Name!@FieldId, @!field.Name!@FieldMask,
254         @!field.Visibility!@,
255         @!field.Flags!@,
256   @@if !field.noAccess
257         static_cast<FieldEditMethodSig>(&@!Classname!@::editHandle@!field.Name!@),
258    @@if !field.isStoreless
259         static_cast<FieldGetMethodSig >(&@!Classname!@::getHandle@!field.Name!@));
260    @@else // !field.isStoreless
261         static_cast     <FieldGetMethodSig >(&@!Classname!@::invalidGetField));
262    @@endif // !field.isStoreless
263   @@else  //!field.noAccess
264         static_cast     <FieldEditMethodSig>(&@!Classname!@::invalidEditField),
265         static_cast     <FieldGetMethodSig >(&@!Classname!@::invalidGetField));
266   @@endif //!field.noAccess
268     oType.addInitialDesc(pDesc);
269  @@EndFieldLoop@@
270 @@endif // isDecorator
274 @!Classname!@Base::TypeObject @!Classname!@Base::_type(
275     @!Classname!@Base::getClassname(),
276     Inherited::getClassname(),
277     "@!Group!@",
278     @!nsConst!@, //Namespace
279 @@if isAbstract
280     NULL,
281 @@else // isAbstract
282     reinterpret_cast<PrototypeCreateF>(&@!Classname!@Base::createEmptyLocal),
283 @@endif // isAbstract
284     reinterpret_cast<InitContainerF>(&@!Classname!@::initMethod),
285     reinterpret_cast<ExitContainerF>(&@!Classname!@::exitMethod),
286     reinterpret_cast<InitalInsertDescFunc>(
287         reinterpret_cast<void *>(&@!Classname!@::classDescInserter)),
288     @!TypeDescAddable!@,
289     @!FieldsUnmarkedOnCreate!@,
290     @!Fcdxml!@,
291     @!SafeDescription!@
292     );
294 /*------------------------------ get -----------------------------------*/
296 FieldContainerType &@!Classname!@Base::getType(void)
298 @@if isDynFCDerived
299     return _localType;
300 @@else
301     return _type;
302 @@endif
305 const FieldContainerType &@!Classname!@Base::getType(void) const
307 @@if isDynFCDerived
308     return _localType;
309 @@else
310     return _type;
311 @@endif
314 UInt32 @!Classname!@Base::getContainerSize(void) const
316     return sizeof(@!Classname!@);
319 @@if isDynFCDerived
320 @!Classname!@Base::TypeObject &@!Classname!@Base::getFinalType(void)
322     return _type;
325 const @!Classname!@Base::TypeObject &@!Classname!@Base::getFinalType(void) const
327     return _type;
330 @@endif
331 /*------------------------- decorator get ------------------------------*/
333 @@if isDecorator
334 const SFUnrec@!Parent!@Ptr *@!Classname!@Base::getSFDecoratee(void) const
336     return &_sfDecoratee;
339  @@BeginFieldLoop@@
340   @@if !field.noAccess
341    @@if field.isPtrField
342 //! Get the @!Classname!@::_@!field.VarName!@ field.
343 const @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps!@ *@!Classname!@Base::get@!field.CARD!@@!field.Name!@(void) const
345     if(_sfDecoratee.getValue() != NULL)
346     {
347         return getDecoratee()->get@!field.CARD!@@!field.Name!@();
348     }
349     else
350     {
351         return NULL;
352     }
354 //! Get the @!Classname!@::_@!field.VarName!@ field.
355 @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps!@ *@!Classname!@Base::edit@!field.CARD!@@!field.Name!@(void)
357     if(_sfDecoratee.getValue() != NULL)
358     {
359         return getDecoratee()->edit@!field.CARD!@@!field.Name!@();
360     }
361     else
362     {
363         return NULL;
364     }
366    @@else // field.isPtrField
367 @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps!@ *@!Classname!@Base::edit@!field.CARD!@@!field.Name!@(void)
369     if(_sfDecoratee.getValue() != NULL)
370     {
371         return getDecoratee()->edit@!field.CARD!@@!field.Name!@();
372     }
373     else
374     {
375         return NULL;
376     }
379 const @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps!@ *@!Classname!@Base::get@!field.CARD!@@!field.Name!@(void) const
381     if(_sfDecoratee.getValue() != NULL)
382     {
383         return getDecoratee()->get@!field.CARD!@@!field.Name!@();
384     }
385     else
386     {
387         return NULL;
388     }
390    @@endif // field.isPtrField
391   @@endif //!field.noAccess
393  @@EndFieldLoop@@
394 @@endif // isDecorator
396 @@if !isDecorator
397  @@BeginFieldLoop@@
398   @@if !field.noAccess
399    @@if !field.isStoreless
400     @@if field.isPtrField
401      @@if !field.isParentField
402 //! Get the @!Classname!@::_@!field.VarName!@ field.
403 const @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps!@ *@!Classname!@Base::get@!field.CARD!@@!field.Name!@(void) const
405     return &_@!field.VarName!@;
407       @@if field.ptrFieldStandardAccess
409 @!field.CARD!@@!field.FieldTypeCaps:17!@ *@!Classname!@Base::edit@!field.CARD!@@!field.Name:15!@(void)
411        @@if field.isSField
412     editSField(@!field.Name!@FieldMask);
413        @@else // field.isSField
414     editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
415        @@endif // field.isSField
417     return &_@!field.VarName!@;
419       @@endif // field.ptrFieldStandardAccess
420      @@endif // !field.isParentField
421      @@if field.isSField
422       @@if field.ptrFieldNullCheckAccess
424 @!field.CARD!@@!field.FieldTypeCaps:17!@ *@!Classname!@Base::edit@!field.CARD!@@!field.Name:15!@(void)
426        @@if field.isSField
427     editSField(@!field.Name!@FieldMask);
428        @@else // field.isSField
429     editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
430        @@endif // field.isSField
432     return &_@!field.VarName!@;
434       @@endif // field.ptrFieldNullCheckAccess
436       @@if !isDecorator
437        @@if !isDecoratable
438 //! Get the value of the @!Classname!@::_@!field.VarName!@ field.
439 @!field.FullType!@ @!Classname!@Base::get@!field.Name!@(void) const
441     return _@!field.VarName!@.getValue();
444         @@if !field.isParentField
445          @@if !field.ptrFieldCustomAccess
446 //! Set the value of the @!Classname!@::_@!field.VarName!@ field.
447           @@if field.PassFieldMask
448 void @!Classname!@Base::set@!field.Name!@(@!field.Type!@ const value,
449                              const UInt16                      uiStoredInFieldId)
450           @@else // field.PassFieldMask
451 void @!Classname!@Base::set@!field.Name!@(@!field.Type!@ const value)
452           @@endif // field.PassFieldMask
454     editSField(@!field.Name!@FieldMask);
456     _@!field.VarName!@.setValue(value);
458          @@endif //!field.ptrFieldCustomAccess
459         @@endif // !field.isParentField
460        @@endif // !isDecoratable
461       @@endif // !isDecorator
463      @@else // field.isSField
464       @@if !isDecorator
465        @@if !isDecoratable
466 @!field.Type!@ @!Classname!@Base::get@!field.Name!@(const UInt32 index) const
468     return _@!field.VarName!@[index];
470        @@endif // !isDecoratable
471       @@endif // !isDecorator
472      @@endif // field.isSField
473     @@else // field.isPtrField
474 @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps!@ *@!Classname!@Base::edit@!field.CARD!@@!field.Name!@(void)
476      @@if field.isMField
477     editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
478      @@else // field.isMField
479     editSField(@!field.Name!@FieldMask);
480      @@endif // field.isMField
482     return &_@!field.VarName!@;
485 const @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps!@ *@!Classname!@Base::get@!field.CARD!@@!field.Name!@(void) const
487     return &_@!field.VarName!@;
490     @@endif // field.isPtrField
491    @@endif // !field.isStoreless
492   @@endif //!field.noAccess
494  @@EndFieldLoop@@
495 @@endif // !isDecorator
498 @@BeginMFFieldLoop@@
499  @@if field.isPtrField
500   @@if !field.noAccess
501    @@if !field.isParentField
502     @@if field.writePushToField
503 void @!Classname!@Base::@!field.PushToField!@(@!field.Type!@ const value)
505      @@if field.ptrFieldNullCheckAccess
506     if(value == NULL)
507         return;
509      @@endif // field.ptrFieldNullCheckAccess
510     editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
512     _mf@!field.Name!@.push_back(value);
515     @@endif // field.writePushToField
516     @@if field.writeAssignMField
517 void @!Classname!@Base::@!field.AssignMField:15!@(const @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:15!@ &value)
519     @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:15!@::const_iterator elemIt  =
520         value.begin();
521     @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:15!@::const_iterator elemEnd =
522         value.end  ();
524     static_cast<@!Classname!@ *>(this)->@!field.ClearField!@();
526     while(elemIt != elemEnd)
527     {
528         this->@!field.PushToField!@(*elemIt);
530         ++elemIt;
531     }
534     @@endif // field.writeAssignMField
535     @@if field.writeInsertIntoMField
536 void @!Classname!@Base::@!field.InsertIntoMField!@(UInt32               uiIndex,
537                                                    @!field.Type!@ const value   )
539      @@if field.ptrFieldNullCheckAccess
540     if(value == NULL)
541         return;
543      @@endif // field.ptrFieldNullCheckAccess
544     editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
546     MF@!field.FieldTypeCaps!@::iterator fieldIt = _mf@!field.Name!@.begin_nc();
548     fieldIt += uiIndex;
550     _mf@!field.Name!@.insert(fieldIt, value);
553     @@endif // field.writeInsertIntoMField
554     @@if field.writeReplaceInMFieldIndex
555 void @!Classname!@Base::@!field.ReplaceInMFieldIndex!@(UInt32               uiIndex,
556                                                        @!field.Type!@ const value   )
558      @@if field.ptrFieldNullCheckAccess
559     if(value == NULL)
560         return;
562      @@endif // field.ptrFieldNullCheckAccess
563     if(uiIndex >= _mf@!field.Name!@.size())
564         return;
566     editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
568     _mf@!field.Name!@.replace(uiIndex, value);
571     @@endif // field.writeReplaceInMFieldIndex
572     @@if field.writeReplaceInMFieldObject
573 void @!Classname!@Base::@!field.ReplaceInMFieldObject!@(@!field.Type!@ const pOldElem,
574                                                         @!field.Type!@ const pNewElem)
576      @@if field.ptrFieldNullCheckAccess
577     if(pNewElem == NULL)
578         return;
580      @@endif // field.ptrFieldNullCheckAccess
581     Int32  elemIdx = _mf@!field.Name!@.findIndex(pOldElem);
583     if(elemIdx != -1)
584     {
585         editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
587         _mf@!field.Name!@.replace(elemIdx, pNewElem);
588     }
591     @@endif // field.writeReplaceInMFieldObject
592     @@if field.writeRemoveFromMFieldIndex
593 void @!Classname!@Base::@!field.RemoveFromMFieldIndex!@(UInt32 uiIndex)
595     if(uiIndex < _mf@!field.Name!@.size())
596     {
597         editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
599      @@if field.isRemoveToSet
600         _mf@!field.Name!@.replace(uiIndex, @!field.RemoveTo!@);
601      @@else // field.isRemoveToSet
602         _mf@!field.Name!@.erase(uiIndex);
603      @@endif // field.isRemoveToSet
604     }
607     @@endif // field.writeRemoveFromMFieldIndex
608     @@if field.writeRemoveFromMFieldObject
609 void @!Classname!@Base::@!field.RemoveFromMFieldObject!@(@!field.Type!@ const value)
611     Int32 iElemIdx = _mf@!field.Name!@.findIndex(value);
613     if(iElemIdx != -1)
614     {
615         editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
617      @@if field.isRemoveToSet
618         _mf@!field.Name!@.replace(iElemIdx, @!field.RemoveTo!@);
619      @@else // field.isRemoveToSet
620         _mf@!field.Name!@.erase(iElemIdx);
621      @@endif // field.isRemoveToSet
622     }
624     @@endif // field.writeRemoveFromMFieldObject
625     @@if field.writeClearField
626 void @!Classname!@Base::@!field.ClearField!@(void)
628     editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
630      @@if field.isRemoveToSet
631     MF@!field.FieldTypeCaps!@::iterator       fieldIt  = _mf@!field.Name!@.begin_nc();
632     MF@!field.FieldTypeCaps!@::const_iterator fieldEnd = _mf@!field.Name!@.end  ();
634     while(fieldIt != fieldEnd)
635     {
636         _mf@!field.Name!@.replace(fieldIt, @!field.RemoveTo!@);
638         ++fieldIt;
639     }
640      @@else // field.isRemoveToSet
641       @@if field.doClearMField
643     _mf@!field.Name!@.clear();
644       @@endif // field.doClearMField
645      @@endif // field.isRemoveToSet
647     @@endif // field.writeClearField
648    @@endif // !field.isParentField
650   @@endif //!field.noAccess
651  @@endif // field.isPtrField
652 @@EndMFFieldLoop@@
655 /*------------------------------ access -----------------------------------*/
657 SizeT @!Classname!@Base::getBinSize(ConstFieldMaskArg whichField)
659     SizeT returnValue = Inherited::getBinSize(whichField);
661 @@if isDecorator
662     if(FieldBits::NoField != (DecorateeFieldMask & whichField))
663     {
664         returnValue += _sfDecoratee.getBinSize();
665     }
666 @@else // isDecorator
667   @@BeginFieldLoop@@
668     @@if !field.customBinCopy
669     @@if !field.isStoreless
670     if(FieldBits::NoField != (@!field.Name!@FieldMask & whichField))
671     {
672         returnValue += _@!field.VarName!@.getBinSize();
673     }
674     @@endif // !field.isStoreless
675     @@endif // !field.customBinCopy
676   @@EndFieldLoop@@
677 @@endif // isDecorator
679     return returnValue;
682 void @!Classname!@Base::copyToBin(BinaryDataHandler &pMem,
683                                   ConstFieldMaskArg  whichField)
685     Inherited::copyToBin(pMem, whichField);
687 @@if isDecorator
688     if(FieldBits::NoField != (DecorateeFieldMask & whichField))
689     {
690         _sfDecoratee.copyToBin(pMem);
691     }
692 @@else // isDecorator
693   @@BeginFieldLoop@@
694     @@if !field.customBinCopy
695     @@if !field.isStoreless
696     if(FieldBits::NoField != (@!field.Name!@FieldMask & whichField))
697     {
698         _@!field.VarName!@.copyToBin(pMem);
699     }
700     @@endif // !field.isStoreless
701     @@endif // !field.customBinCopy
702   @@EndFieldLoop@@
703 @@endif // isDecorator
706 void @!Classname!@Base::copyFromBin(BinaryDataHandler &pMem,
707                                     ConstFieldMaskArg  whichField)
709     Inherited::copyFromBin(pMem, whichField);
711 @@if isDecorator
712     if(FieldBits::NoField != (DecorateeFieldMask & whichField))
713     {
714         editSField(DecorateeFieldMask);
715         _sfDecoratee.copyFromBin(pMem);
716     }
717 @@else // isDecorator
718   @@BeginFieldLoop@@
719     @@if !field.customBinCopy
720     @@if !field.isStoreless
721     if(FieldBits::NoField != (@!field.Name!@FieldMask & whichField))
722     {
723       @@if field.isSField
724         editSField(@!field.Name!@FieldMask);
725       @@else
726         editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
727       @@endif
728         _@!field.VarName!@.copyFromBin(pMem);
729     }
730     @@endif // !field.isStoreless
731     @@endif // !field.customBinCopy
732   @@EndFieldLoop@@
733 @@endif // isDecorator
736 @@if !isAbstract
737 //! create a new instance of the class
738 @!Classname!@TransitPtr @!Classname!@Base::createLocal(BitVector bFlags)
740     @!Classname!@TransitPtr fc;
742     if(getClassType().getPrototype() != NULL)
743     {
744         FieldContainerTransitPtr tmpPtr =
745             getClassType().getPrototype()-> shallowCopyLocal(bFlags);
747         fc = dynamic_pointer_cast<@!Classname!@>(tmpPtr);
748     }
750     return fc;
753 //! create a new instance of the class, copy the container flags
754 @!Classname!@TransitPtr @!Classname!@Base::createDependent(BitVector bFlags)
756     @!Classname!@TransitPtr fc;
758     if(getClassType().getPrototype() != NULL)
759     {
760         FieldContainerTransitPtr tmpPtr =
761             getClassType().getPrototype()-> shallowCopyDependent(bFlags);
763         fc = dynamic_pointer_cast<@!Classname!@>(tmpPtr);
764     }
766     return fc;
769 //! create a new instance of the class
770 @!Classname!@TransitPtr @!Classname!@Base::create(void)
772 @@if !isBundle
773     @!Classname!@TransitPtr fc;
775     if(getClassType().getPrototype() != NULL)
776     {
777         FieldContainerTransitPtr tmpPtr =
778             getClassType().getPrototype()-> shallowCopy();
780         fc = dynamic_pointer_cast<@!Classname!@>(tmpPtr);
781     }
783     return fc;
784 @@else
785     return createLocal();
786 @@endif
788 @@endif // !isAbstract
790 @@if !isAbstract
791 @!Classname!@ *@!Classname!@Base::createEmptyLocal(BitVector bFlags)
793     @!Classname!@ *returnValue;
795     newPtr<@!Classname!@>(returnValue, bFlags);
797     returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
799     return returnValue;
802 //! create an empty new instance of the class, do not copy the prototype
803 @!Classname!@ *@!Classname!@Base::createEmpty(void)
805 @@if !isBundle
806     @!Classname!@ *returnValue;
808     newPtr<@!Classname!@>(returnValue, Thread::getCurrentLocalFlags());
810     returnValue->_pFieldFlags->_bNamespaceMask &=
811         ~Thread::getCurrentLocalFlags();
813     return returnValue;
814 @@else
815     return createEmptyLocal();
816 @@endif
820 FieldContainerTransitPtr @!Classname!@Base::shallowCopyLocal(
821     BitVector bFlags) const
823     @!Classname!@ *tmpPtr;
825     newPtr(tmpPtr, dynamic_cast<const @!Classname!@ *>(this), bFlags);
827     FieldContainerTransitPtr returnValue(tmpPtr);
829     tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
831     return returnValue;
834 FieldContainerTransitPtr @!Classname!@Base::shallowCopyDependent(
835     BitVector bFlags) const
837     @!Classname!@ *tmpPtr;
839     newPtr(tmpPtr, dynamic_cast<const @!Classname!@ *>(this), ~bFlags);
841     FieldContainerTransitPtr returnValue(tmpPtr);
843     tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
845     return returnValue;
848 FieldContainerTransitPtr @!Classname!@Base::shallowCopy(void) const
850 @@if !isBundle
851     @!Classname!@ *tmpPtr;
853     newPtr(tmpPtr,
854            dynamic_cast<const @!Classname!@ *>(this),
855            Thread::getCurrentLocalFlags());
857     tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
859     FieldContainerTransitPtr returnValue(tmpPtr);
861     return returnValue;
862 @@else
863     return shallowCopyLocal();
864 @@endif
868 @@endif // !isAbstract
871 /*------------------------- constructors ----------------------------------*/
873 @!Classname!@Base::@!Classname!@Base(void) :
874 @@if !hasFields
875     Inherited()
876 @@else // !hasFields
877     Inherited(),
878   @@if isDecorator
879     _sfDecoratee()
880   @@else // isDecorator
881     @@BeginFieldLoop@@
882       @@if !field.isStoreless
883         @@if field.isChildField
884     _@!field.VarName:25!@(this,
885                           @!field.Name!@FieldId,
886                           @!field.TypeRaw!@::@!field.linkParentField!@FieldId)@!field.Separator!@
887         @@else // field.isChildField
888     _@!field.VarName:25!@(@!field.TypedDefault!@)@!field.Separator!@
889         @@endif // field.isChildField
890       @@endif // !field.isStoreless
891     @@EndFieldLoop@@
892   @@endif // isDecorator
893 @@endif // !hasFields
897 @!Classname!@Base::@!Classname!@Base(const @!Classname!@Base &source) :
898 @@if !hasFields
899     Inherited(source)
900 @@else // !hasFields
901     Inherited(source),
902   @@if isDecorator
903     _sfDecoratee(source._sfDecoratee)
904   @@else // isDecorator
905     @@BeginFieldLoop@@
906       @@if !field.isStoreless
907         @@if field.isPtrField
908           @@if field.isChildField
909     _@!field.VarName:25!@(this,
910                           @!field.Name!@FieldId,
911                           @!field.TypeRaw!@::@!field.linkParentField!@FieldId)@!field.Separator!@
912           @@else
913             @@if field.isSField
914     _@!field.VarName:25!@(NULL)@!field.Separator!@
915             @@else
916     _@!field.VarName:25!@()@!field.Separator!@
917             @@endif // isSField
918           @@endif // ChildField
919         @@else // field.isPtrField
920     _@!field.VarName:25!@(source._@!field.VarName:25!@)@!field.Separator!@
921         @@endif // field.isPtrField
922       @@endif // !field.isStoreless
923     @@EndFieldLoop@@
924   @@endif // isDecorator
925 @@endif // !hasFields
930 /*-------------------------- destructors ----------------------------------*/
932 @!Classname!@Base::~@!Classname!@Base(void)
935 @@if hasParentFields
936 /*-------------------------------------------------------------------------*/
937 /* Parent linking                                                          */
939 bool @!Classname!@Base::linkParent(
940     FieldContainer * const pParent,
941     UInt16           const childFieldId,
942     UInt16           const parentFieldId )
944     @@BeginFieldLoop@@
945         @@if field.isParentField
946     if(parentFieldId == @!field.Name!@FieldId)
947     {
948         @!field.Type!@ pTypedParent =
949             dynamic_cast< @!field.Type!@ >(pParent);
951         if(pTypedParent != NULL)
952         {
953             @@if field.isSField
954             FieldContainer *pOldParent =
955                 _@!field.VarName!@.getValue         ();
957             UInt16 oldChildFieldId =
958                 _@!field.VarName!@.getParentFieldPos();
960             if(pOldParent != NULL)
961             {
962                 pOldParent->unlinkChild(this, oldChildFieldId);
963             }
965             editSField(@!field.Name!@FieldMask);
967             _@!field.VarName!@.setValue(static_cast<@!field.TypeNS!@@!field.Type!@>(pParent), childFieldId);
968             @@endif // @!field.cardinality!@ == "single"
969             @@if field.isMField
970             editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
972             _@!field.VarName!@.push_back(pTypedParent, childFieldId);
973             @@endif // @!field.cardinality!@ == "multi"
975             return true;
976         }
978         return false;
979     }
981         @@endif // @!field.category!@ == "pointer" and @!field.pointertype!@ == "parent"
982     @@EndFieldLoop@@
983     return Inherited::linkParent(pParent, childFieldId, parentFieldId);
986 bool @!Classname!@Base::unlinkParent(
987     FieldContainer * const pParent,
988     UInt16           const parentFieldId)
990     @@BeginFieldLoop@@
991         @@if field.isParentField
992     if(parentFieldId == @!field.Name!@FieldId)
993     {
994         @!field.TypeNS!@@!field.Type!@ pTypedParent =
995             dynamic_cast< @!field.FieldTypeNS!@@!field.Type!@ >(pParent);
997         if(pTypedParent != NULL)
998         {
999             @@if field.isSField
1000             if(_@!field.VarName!@.getValue() == pTypedParent)
1001             {
1002                 editSField(@!field.Name!@FieldMask);
1004                 _@!field.VarName!@.setValue(NULL, 0xFFFF);
1006                 return true;
1007             }
1008             @@endif // @!field.cardinality!@ == "single"
1009             @@if field.isMField
1010             Int32 iParentIdx = _@!field.VarName!@.findIndex(pTypedParent);
1012             if(iParentIdx != -1)
1013             {
1014                 editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
1016                 _@!field.VarName!@.erase(iParentIdx);
1018                 return true;
1019             }
1020             @@endif // @!field.cardinality!@ == "multi"
1022             SWARNING << "Child (["          << this
1023                      << "] id ["            << this->getId()
1024                      << "] type ["          << this->getType().getCName()
1025                      << "] parentFieldId [" << parentFieldId
1026                      << "]) - Parent (["    << pParent
1027                      << "] id ["            << pParent->getId()
1028                      << "] type ["          << pParent->getType().getCName()
1029                      << "]): link inconsistent!"
1030                      << std::endl;
1032             return false;
1033         }
1035         return false;
1036     }
1038         @@endif // @!field.category!@ == "pointer" and @!field.pointertype!@ == "parent"
1039     @@EndFieldLoop@@
1040     return Inherited::unlinkParent(pParent, parentFieldId);
1043 @@endif // @!hasParentFields!@
1045 @@if hasChildFields
1046 /*-------------------------------------------------------------------------*/
1047 /* Child linking                                                           */
1049 bool @!Classname!@Base::unlinkChild(
1050     FieldContainer * const pChild,
1051     UInt16           const childFieldId)
1053     @@BeginFieldLoop@@
1054         @@if field.isChildField
1055     if(childFieldId == @!field.Name!@FieldId)
1056     {
1057         @!field.TypeNS!@@!field.Type!@ pTypedChild =
1058             dynamic_cast<@!field.TypeNS!@@!field.Type!@>(pChild);
1060         if(pTypedChild != NULL)
1061         {
1062             @@if field.isSField
1063             if(_@!field.VarName!@.getValue() == pTypedChild)
1064             {
1065                 editSField(@!field.Name!@FieldMask);
1067                 _@!field.VarName!@.setValue(NULL);
1069                 return true;
1070             }
1071             @@endif // @!field.cardinality!@ == "single"
1072             @@if field.isMField
1073             Int32 iChildIdx = _@!field.VarName!@.findIndex(pTypedChild);
1075             if(iChildIdx != -1)
1076             {
1077                 editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
1079                 _@!field.VarName!@.erase(iChildIdx);
1081                 return true;
1082             }
1083             @@endif // @!field.cardinality!@ == "multi"
1085             SWARNING << "Parent (["        << this
1086                      << "] id ["           << this->getId()
1087                      << "] type ["         << this->getType().getCName()
1088                      << "] childFieldId [" << childFieldId
1089                      << "]) - Child (["    << pChild
1090                      << "] id ["           << pChild->getId()
1091                      << "] type ["         << pChild->getType().getCName()
1092                      << "]): link inconsistent!"
1093                      << std::endl;
1095             return false;
1096         }
1098         return false;
1099     }
1101         @@endif // @!field.category!@ == "pointer" and @!field.pointertype!@ == "child"
1102     @@EndFieldLoop@@
1104     return Inherited::unlinkChild(pChild, childFieldId);
1107 @@endif // @!hasChildFields!@
1108 @@if hasPtrFields
1109 void @!Classname!@Base::onCreate(const @!Classname!@ *source)
1111     Inherited::onCreate(source);
1113     if(source != NULL)
1114     {
1115         @!Classname!@ *pThis = static_cast<@!Classname!@ *>(this);
1116  @@BeginFieldLoop@@
1117   @@if field.isPtrField
1118    @@if !field.noAccess
1119     @@if !field.isStoreless
1120      @@if field.isMField
1122         MF@!field.FieldTypeCaps!@::const_iterator @!field.Name!@It  =
1123             source->_mf@!field.Name!@.begin();
1124         MF@!field.FieldTypeCaps!@::const_iterator @!field.Name!@End =
1125             source->_mf@!field.Name!@.end  ();
1127         while(@!field.Name!@It != @!field.Name!@End)
1128         {
1129             pThis->@!field.PushToField!@(*@!field.Name!@It);
1131             ++@!field.Name!@It;
1132         }
1133      @@else // field.isMField
1135         pThis->set@!field.Name!@(source->get@!field.Name!@());
1136      @@endif // field.isMField
1137     @@endif // !field.isStoreless
1138    @@endif // !field.noAccess
1139   @@endif // field.isPtrField
1140  @@EndFieldLoop@@
1141     }
1143 @@endif // hasPtrFields
1145 @@if isDecorator
1146 GetFieldHandlePtr  @!Classname!@Base::getHandleDecoratee (void) const
1148     SFUnrec@!Parent!@Ptr::GetHandlePtr returnValue(
1149         new SFUnrec@!Parent!@Ptr::GetHandle(
1150             &_sfDecoratee,
1151             this->getType().getFieldDesc(DecorateeFieldId),
1152             const_cast<@!Classname!@Base *>(this)));
1154     return returnValue;
1157 EditFieldHandlePtr @!Classname!@Base::editHandleDecoratee(void)
1159     SFUnrec@!Parent!@Ptr::EditHandlePtr returnValue(
1160         new SFUnrec@!Parent!@Ptr::EditHandle(
1161             &_sfDecoratee,
1162             this->getType().getFieldDesc(DecorateeFieldId),
1163             this));
1165     returnValue->setSetMethod(boost::bind(&@!Classname!@::setDecoratee,
1166                               static_cast<@!Classname!@ *>(this), _1));
1168     editSField(DecorateeFieldMask);
1170     return returnValue;
1173 @@endif // isDecorator
1174 @@BeginFieldLoop@@
1175  @@if !field.isStoreless
1176 GetFieldHandlePtr @!Classname!@Base::getHandle@!field.Name:15!@ (void) const
1178   @@if !field.noAccess
1179    @@if !field.isParentField
1180     @!field.CARD!@@!field.FieldTypeCaps!@::GetHandlePtr returnValue(
1181         new  @!field.CARD!@@!field.FieldTypeCaps!@::GetHandle(
1182              &_@!field.VarName!@,
1183              this->getType().getFieldDesc(@!field.Name!@FieldId),
1184              const_cast<@!Classname!@Base *>(this)));
1185    @@else // !field.isParentField
1186     @!field.CARD!@@!field.FieldTypeCaps!@::GetHandlePtr returnValue;
1187    @@endif // !field.isParentField
1188   @@else // !field.noAccess
1189     @!field.CARD!@@!field.FieldTypeCaps!@::GetHandlePtr returnValue;
1190   @@endif // !field.noAccess
1192     return returnValue;
1194  @@endif // !field.isStoreless
1196 EditFieldHandlePtr @!Classname!@Base::editHandle@!field.Name:15!@(void)
1198  @@if !field.noAccess
1199   @@if !field.isParentField
1200     @!field.CARD!@@!field.FieldTypeCaps!@::EditHandlePtr returnValue(
1201         new  @!field.CARD!@@!field.FieldTypeCaps!@::EditHandle(
1202    @@if !field.isStoreless
1203              &_@!field.VarName!@,
1204    @@else // !field.isStoreless
1205              NULL,
1206    @@endif // !field.isStoreless
1207              this->getType().getFieldDesc(@!field.Name!@FieldId),
1208              this));
1210    @@if field.isStoreless
1211     returnValue->setStoreless();
1213    @@endif // field.isStoreless
1214    @@if field.isMField
1215     @@if field.isPtrField
1216      @@if field.hasPushToField
1217     returnValue->setAddMethod(
1218         boost::bind(&@!Classname!@::@!field.PushToField!@,
1219                     static_cast<@!Classname!@ *>(this), _1));
1220      @@endif // field.hasPushToField
1221      @@if field.hasInsertIntoMField
1222     returnValue->setInsertMethod(
1223         boost::bind(&@!Classname!@::@!field.InsertIntoMField!@,
1224                     static_cast<@!Classname!@ *>(this), _1, _2));
1225      @@endif // field.hasInsertIntoMField
1226      @@if field.hasReplaceInMFieldIndex
1227     returnValue->setReplaceMethod(
1228         boost::bind(&@!Classname!@::@!field.ReplaceInMFieldIndex!@,
1229                     static_cast<@!Classname!@ *>(this), _1, _2));
1230      @@endif // field.hasReplaceInMFieldIndex
1231      @@if field.hasReplaceInMFieldObject
1232     returnValue->setReplaceObjMethod(
1233         boost::bind(&@!Classname!@::@!field.ReplaceInMFieldObject!@,
1234                     static_cast<@!Classname!@ *>(this), _1, _2));
1235      @@endif // field.hasReplaceInMFieldObject
1236      @@if field.hasRemoveFromMFieldIndex
1237     returnValue->setRemoveMethod(
1238         boost::bind(&@!Classname!@::@!field.RemoveFromMFieldIndex!@,
1239                     static_cast<@!Classname!@ *>(this), _1));
1240      @@endif // field.hasRemoveFromMFieldIndex
1241      @@if field.hasRemoveFromMFieldObject
1242     returnValue->setRemoveObjMethod(
1243         boost::bind(&@!Classname!@::@!field.RemoveFromMFieldObject!@,
1244                     static_cast<@!Classname!@ *>(this), _1));
1245      @@endif // field.hasRemoveFromMFieldObject
1246      @@if field.hasClearField
1247     returnValue->setClearMethod(
1248         boost::bind(&@!Classname!@::@!field.ClearField!@,
1249                     static_cast<@!Classname!@ *>(this)));
1250      @@endif // field.hasClearField
1251     @@endif // field.isPtrField
1253     @@if !field.isStoreless
1254     editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
1255     @@endif // !field.isStoreless
1256    @@else // field.isMField
1257     @@if field.isPtrField
1258     returnValue->setSetMethod(
1259         boost::bind(&@!Classname!@::set@!field.Name!@,
1260                     static_cast<@!Classname!@ *>(this), _1));
1261     @@endif // field.isPtrField
1263     @@if !field.isStoreless
1264     editSField(@!field.Name!@FieldMask);
1265     @@endif // !field.isStoreless
1266    @@endif // field.isMField
1267   @@else // !field.isParentField
1268     EditFieldHandlePtr returnValue;
1269   @@endif // !field.isParentField
1270  @@else // !field.noAccess
1271     EditFieldHandlePtr returnValue;
1272  @@endif // !field.noAccess
1274     return returnValue;
1277 @@EndFieldLoop@@
1279 #ifdef OSG_MT_CPTR_ASPECT
1280 void @!Classname!@Base::execSyncV(      FieldContainer    &oFrom,
1281                                         ConstFieldMaskArg  whichField,
1282                                         AspectOffsetStore &oOffsets,
1283                                         ConstFieldMaskArg  syncMode,
1284                                   const UInt32             uiSyncInfo)
1286     @!Classname!@ *pThis = static_cast<@!Classname!@ *>(this);
1288     pThis->execSync(static_cast<@!Classname!@ *>(&oFrom),
1289                     whichField,
1290                     oOffsets,
1291                     syncMode,
1292                     uiSyncInfo);
1294 #endif
1297 @@if !isAbstract
1298 #ifdef OSG_MT_CPTR_ASPECT
1299 FieldContainer *@!Classname!@Base::createAspectCopy(
1300     const FieldContainer *pRefAspect) const
1302     @!Classname!@ *returnValue;
1304     newAspectCopy(returnValue,
1305                   dynamic_cast<const @!Classname!@ *>(pRefAspect),
1306                   dynamic_cast<const @!Classname!@ *>(this));
1308     return returnValue;
1310 #endif
1311 @@endif // !isAbstract
1313 void @!Classname!@Base::resolveLinks(void)
1315 @@if isDecorator
1316     static_cast<@!Classname!@ *>(this)->setDecoratee(NULL);    
1318 @@endif
1319     Inherited::resolveLinks();
1320 @@BeginFieldLoop@@
1321  @@if field.isPtrField
1322   @@if !field.noAccess
1323    @@if !field.isParentField
1324     @@if field.isSField
1326     static_cast<@!Classname!@ *>(this)->set@!field.Name!@(NULL);
1327     @@else // field.isSField
1329     static_cast<@!Classname!@ *>(this)->@!field.ClearField!@();
1330     @@endif // field.isSField
1331    @@endif // !field.isParentField
1332   @@endif //!field.noAccess
1333  @@endif // field.isPtrField
1334 @@EndFieldLoop@@
1336 @@if hasValueMField
1337 #ifdef OSG_MT_CPTR_ASPECT
1338     AspectOffsetStore oOffsets;
1340     _pAspectStore->fillOffsetArray(oOffsets, this);
1341 #endif
1342 @@endif // hasValueMField
1344 @@BeginMFFieldLoop@@
1345  @@if !field.isPtrField
1346 #ifdef OSG_MT_CPTR_ASPECT
1347     _@!field.VarName!@.terminateShare(Thread::getCurrentAspect(),
1348                                       oOffsets);
1349 #endif
1350  @@endif // field.isPtrField
1351 @@EndMFFieldLoop@@
1354 @@if isDecoratable
1355 /*------------------------------ get -----------------------------------*/
1357     @@if !isDecorator
1358         @@BeginSFFieldLoop@@
1359             @@if field.isPtrField
1361 //! Get the value of the @!Classname!@::_@!field.VarName!@ field.
1362 @!field.Type!@ @!Classname!@Base::get@!field.Name!@(void) const
1364     return _@!field.VarName!@.getValue();
1367 //! Set the value of the @!Classname!@::_@!field.VarName!@ field.
1368 void @!Classname!@Base::set@!field.Name!@(@!field.Type!@ const value)
1370     editSField(@!field.Name!@FieldMask);
1372     _@!field.VarName!@.setValue(value);
1374             @@else // field.isPtrField
1375 //! Get the value of the @!Classname!@::_@!field.VarName!@ field.
1377 @!field.FullType!@ &@!Classname!@Base::edit@!field.Name!@(void)
1379     editSField(@!field.Name!@FieldMask);
1381     return _@!field.VarName!@.getValue();
1384 //! Get the value of the @!Classname!@::_@!field.VarName!@ field.
1385 @!field.RetConst!@ @!field.FullType!@ @!field.RetRef!@@!Classname!@Base::get@!field.Name!@(void) const
1387     return _@!field.VarName!@.getValue();
1391 //! Set the value of the @!Classname!@::_@!field.VarName!@ field.
1392 void @!Classname!@Base::set@!field.Name!@(const @!field.FullType!@ @!field.ArgRef!@value)
1394     editSField(@!field.Name!@FieldMask);
1396     _@!field.VarName!@.setValue(value);
1398             @@endif // field.isPtrField
1399         @@EndSFFieldLoop@@
1401         @@BeginMFFieldLoop@@
1402 //! Get the value of the \a index element the @!Classname!@::_@!field.VarName!@ field.
1403             @@if field.isPtrField
1404 @!field.Type!@ @!Classname!@Base::get@!field.Name!@(const UInt32 index) const
1405             @@else // field.isPtrField
1406 @!field.RetConst!@ @!field.Type!@ @!field.RetRef!@@!Classname!@Base::get@!field.Name!@(const UInt32 index) const
1407             @@endif // field.isPtrField
1409     return _@!field.VarName!@[index];
1411             @@if !field.isPtrField
1413 @!field.Type!@ &@!Classname!@Base::edit@!field.Name!@(const UInt32 index)
1415     editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
1417     return _@!field.VarName!@[index];
1420 //! Get the @!Classname!@::_@!field.VarName!@ field.
1421 @!field.FieldTypeNS!@@!field.CARD!@@!field.TypeCaps!@ &@!Classname!@Base::edit@!field.Name!@(void)
1423     editMField(@!field.Name!@FieldMask, _@!field.VarName!@);
1425     return _@!field.VarName!@;
1428             @@endif // !field.isPtrField
1430 //! Get the @!Classname!@::_@!field.VarName!@ field.
1431 const @!field.FieldTypeNS!@@!field.CARD!@@!field.TypeCaps!@ &@!Classname!@Base::get@!field.Name!@(void) const
1433     return _@!field.VarName!@;
1436         @@EndMFFieldLoop@@
1437     @@else // !isDecorator
1438         @@BeginSFFieldLoop@@
1439             @@if field.isPtrField
1441 //! Get the value of the @!Classname!@::_@!field.VarName!@ field.
1442 @!field.Type!@ @!Classname!@Base::get@!field.Name!@(void) const
1444     if(_sfDecoratee.getValue() != NULL)
1445     {
1446         return getDecoratee()->get@!field.Name!@();
1447     }
1448     else
1449     {
1450         return Inherited::get@!field.Name!@();
1451     }
1454 //! Set the value of the @!Classname!@::_@!field.VarName!@ field.
1455 void @!Classname!@Base::set@!field.Name!@(@!field.Type!@ const value)
1457     if(_sfDecoratee.getValue() != NULL)
1458     {
1459         getDecoratee()->set@!field.Name!@(value);
1460     }
1461     else
1462     {
1463         Inherited::set@!field.Name!@(value);
1464     }
1466             @@else // field.isPtrField
1468 //! Get the value of the @!Classname!@::_@!field.VarName!@ field.
1469 @!field.Type!@ &@!Classname!@Base::edit@!field.Name!@(void)
1471     if(_sfDecoratee.getValue() != NULL)
1472     {
1473         return getDecoratee()->edit@!field.Name!@();
1474     }
1475     else
1476     {
1477         return Inherited::edit@!field.Name!@();
1478     }
1481 //! Get the value of the @!Classname!@::_@!field.VarName!@ field.
1482 @!field.RetConst!@ @!field.Type!@ @!field.RetRef!@@!Classname!@Base::get@!field.Name!@(void) const
1484     if(_sfDecoratee.getValue() != NULL)
1485     {
1486         return getDecoratee()->get@!field.Name!@();
1487     }
1488     else
1489     {
1490         return Inherited::get@!field.Name!@();
1491     }
1495 //! Set the value of the @!Classname!@::_@!field.VarName!@ field.
1496 void @!Classname!@Base::set@!field.Name!@(const @!field.Type!@ @!field.ArgRef!@value)
1498     if(_sfDecoratee.getValue() != NULL)
1499     {
1500         getDecoratee()->set@!field.Name!@(value);
1501     }
1502     else
1503     {
1504         Inherited::set@!field.Name!@(value);
1505     }
1507             @@endif // field.isPtrField
1508         @@EndSFFieldLoop@@
1510         @@BeginMFFieldLoop@@
1511 //! Get the value of the \a index element the @!Classname!@::_@!field.VarName!@ field.
1512             @@if field.isPtrField
1513 @!field.Type!@ @!Classname!@Base::get@!field.Name!@(const UInt32 index) const
1514             @@else // field.isPtrField
1515 @!field.RetConst!@ @!field.Type!@ @!field.RetRef!@@!Classname!@Base::get@!field.Name!@(const UInt32 index) const
1516             @@endif // field.isPtrField
1518     if(_sfDecoratee.getValue() != NULL)
1519     {
1520         return getDecoratee()->get@!field.Name!@(index);
1521     }
1522     else
1523     {
1524         return Inherited::get@!field.Name!@(index);
1525     }
1527             @@if !field.isPtrField
1529 @!field.Type!@ &@!Classname!@Base::edit@!field.Name!@(const UInt32 index)
1531     if(_sfDecoratee.getValue() != NULL)
1532     {
1533         return getDecoratee()->edit@!field.Name!@(index);
1534     }
1535     else
1536     {
1537         return Inherited::edit@!field.Name!@(index);
1538     }
1541 //! Get the @!Classname!@::_@!field.VarName!@ field.
1542 @!field.FieldTypeNS!@@!field.CARD!@@!field.TypeCaps!@ &@!Classname!@Base::edit@!field.Name!@(void)
1544     if(_sfDecoratee.getValue() != NULL)
1545     {
1546         return getDecoratee()->edit@!field.Name!@();
1547     }
1548     else
1549     {
1550         return Inherited::edit@!field.Name!@();
1551     }
1553             @@endif // !field.isPtrField
1555 //! Get the @!Classname!@::_@!field.VarName!@ field.
1556 const @!field.FieldTypeNS!@@!field.CARD!@@!field.TypeCaps!@ &@!Classname!@Base::get@!field.Name!@(void) const
1558     if(_sfDecoratee.getValue() != NULL)
1559     {
1560         return getDecoratee()->get@!field.Name!@();
1561     }
1562     else
1563     {
1564         return Inherited::get@!field.Name!@();
1565     }
1568         @@EndMFFieldLoop@@
1569     @@endif // !isDecorator
1570 @@endif // isDecoratable
1572 @!LIBNAMESPACE!@_END_NAMESPACE