1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
10 @!AuthorsCommentText!@
12 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
15 \*---------------------------------------------------------------------------*/
16 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
32 \*---------------------------------------------------------------------------*/
33 /*---------------------------------------------------------------------------*\
41 \*---------------------------------------------------------------------------*/
43 /*****************************************************************************\
44 *****************************************************************************
46 ** This file is automatically generated. **
48 ** Any changes made to this file WILL be lost when it is **
49 ** regenerated, which can become necessary at any time. **
51 ** Do not change this file, changes should be done in the derived **
52 ** class @!Classname!@
54 *****************************************************************************
55 \*****************************************************************************/
58 #ifndef _OSG@!CLASSNAME!@BASE_H_
59 #define _OSG@!CLASSNAME!@BASE_H_
65 #include "@!HeaderPrefix!@@!Package!@Config.h"
67 #include "OSG@!Libname!@Def.h"
68 @@endif // isInLibrary
70 //#include "@!HeaderPrefix!@OSGBaseTypes.h"
72 #include "@!ParentHeaderPrefix!@OSG@!nsParentFilePrefix!@@!Parent!@.h" // Parent
76 @@if field.needFieldInclude
77 #include @!field.FieldInclude:30!@ // @!field.Name!@ type
78 @@endif //field.needFieldInclude
80 @@else // !isDecorator
81 #include "OSG@!Parent!@Fields.h" // Decoratee type
82 @@endif // !isDecorator
84 #include "OSG@!nsFilePrefix!@@!Classname!@Fields.h"
87 #include "@!MixinHeader!@"
90 @!LIBNAMESPACE!@_BEGIN_NAMESPACE
95 //! \brief @!Classname!@ Base Class.
99 class OSG_@!LIBNAME!@_DLLMAPPING @!Classname!@Base : public @!MixinParent!@
100 @@else // isInLibrary
101 class @!Classname!@Base : public @!MixinParent!@
102 @@endif // isInLibrary
103 @@else // hasMixinParent
105 class OSG_@!LIBNAME!@_DLLMAPPING @!Classname!@Base : public @!Parent!@
106 @@else // isInLibrary
107 class @!Classname!@Base : public @!Parent!@
108 @@endif // isInLibrary
109 @@endif // hasMixinParent
114 typedef @!MixinParent!@ Inherited;
116 typedef @!Parent!@ Inherited;
118 typedef @!Parent!@ ParentContainer;
120 typedef Inherited::TypeObject TypeObject;
121 typedef TypeObject::InitPhase InitPhase;
123 OSG_GEN_INTERNALPTR(@!Classname!@);
125 /*========================== PUBLIC =================================*/
132 DecorateeFieldId = Inherited::NextFieldId,
133 NextFieldId = DecorateeFieldId + 1
136 static const OSG::BitVector DecorateeFieldMask =
137 (TypeTraits<BitVector>::One << DecorateeFieldId);
138 @@else // isDecorator
143 @@if field.isFirstField
144 @!field.Name!@FieldId = Inherited::NextFieldId,
145 @@if field.isLastField
146 NextFieldId = @!field.Name!@FieldId + 1
147 @@endif // field.isLastField
148 @@else // field.isFirstField
149 @!field.Name!@FieldId = @!field.prevField.Name!@FieldId + 1,
150 @@if field.isLastField
151 NextFieldId = @!field.Name!@FieldId + 1
152 @@endif // field.isLastField
153 @@endif // field.isFirstField
158 static const OSG::BitVector @!field.Name!@FieldMask =
159 (TypeTraits<BitVector>::One << @!field.Name!@FieldId);
161 static const OSG::BitVector NextFieldMask =
162 (TypeTraits<BitVector>::One << NextFieldId);
165 typedef @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:15!@ @!field.CARD!@@!field.Name!@Type;
168 @@endif // isDecorator
170 /*---------------------------------------------------------------------*/
171 /*! \name Class Get */
174 static FieldContainerType &getClassType (void);
175 static UInt32 getClassTypeId (void);
176 static UInt16 getClassGroupId(void);
179 /*---------------------------------------------------------------------*/
180 /*! \name FieldContainer Get */
183 virtual FieldContainerType &getType (void);
184 virtual const FieldContainerType &getType (void) const;
186 virtual UInt32 getContainerSize(void) const;
190 /*---------------------------------------------------------------------*/
191 /*! \name Field Get */
195 @!MethodType:7!@ const SFUnrec@!Parent!@Ptr *getSFDecoratee(void) const;
196 @@endif // isDecorator
198 @@if field.isPublicRead
199 @@if field.isPtrField
200 @@if !field.isParentField
201 @!field.MethodType:7!@ const @!field.CARD!@@!field.FieldTypeCaps:17!@ *get@!field.CARD!@@!field.Name:15!@(void) const;
202 @@if field.ptrFieldStandardAccess
203 @@if field.isPublicWrite
204 @!field.MethodType:7!@ @!field.CARD!@@!field.FieldTypeCaps:17!@ *edit@!field.CARD!@@!field.Name:15!@(void);
205 @@endif // field.isPublicWrite
206 @@endif // field.ptrFieldStandardAccess
208 @@if field.ptrFieldNullCheckAccess
209 @@if field.isPublicWrite
210 @!field.MethodType:7!@ @!field.CARD!@@!field.FieldTypeCaps:17!@ *edit@!field.CARD!@@!field.Name:15!@(void);
211 @@endif // field.isPublicWrite
212 @@endif // field.ptrFieldNullCheckAccess
213 @@endif // field.isSField
214 @@endif // !field.isParentField
215 @@else // field.isPtrField
217 @@if field.isPublicWrite
218 @!field.MethodType:7!@ @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:17!@ *edit@!field.CARD!@@!field.Name:15!@(void);
219 @@endif // field.isPublicWrite
220 @!field.MethodType:7!@ const @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:17!@ *get@!field.CARD!@@!field.Name:15!@ (void) const;
221 @@endif // field.isPtrField
222 @@endif // field.isPublicRead
226 @!MethodType:7!@ @!Parent!@ *getDecoratee(void) const;
227 @@endif // isDecorator
229 @@if field.isPublicRead
232 @@if field.isPtrField
233 @!field.MethodType:7!@ @!field.Type!@ get@!field.Name:15!@(void) const;
234 @@else // field.isPtrField
235 @@if field.isPublicWrite
236 @!field.MethodType:7!@ @!field.FullType:19!@ &edit@!field.Name:15!@(void);
237 @@endif // field.isPublicWrite
238 @!field.MethodType:7!@ @!field.RetConst!@ @!field.FullType:19!@ @!field.RetRef!@get@!field.Name:15!@ (void) const;
239 @@endif // field.isPtrField
240 @@else // field.isSField
242 @@if field.isPtrField
243 @!field.MethodType:7!@ @!field.Type!@ get@!field.Name:15!@(const UInt32 index) const;
244 @@else // field.isPtrField
245 @@if field.isPublicWrite
246 @!field.MethodType:7!@ @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:17!@::reference edit@!field.Name:15!@(const UInt32 index);
247 @@endif // field.isPublicWrite
248 @!field.MethodType:7!@ @!field.RetConst!@ @!field.FullType:19!@ @!field.RetRef!@get@!field.Name:15!@ (const UInt32 index) const;
249 @@endif // field.isPtrField
250 @@endif // field.isSField
251 @@endif // field.isPublicRead
255 /*---------------------------------------------------------------------*/
256 /*! \name Field Set */
260 @!MethodType:7!@ void setDecoratee (@!Parent!@ * const value);
261 @@endif // isDecorator
264 @@if field.isPtrField
265 @@if !field.isParentField
266 @@if !field.ptrFieldCustomAccess
267 @@if field.PassFieldMask
268 @!field.MethodType:7!@ void set@!field.Name:15!@(@!field.Type!@ const value,
269 const UInt16 uiStoredInFieldId = InvalidParentEPos);
270 @@else // field.PassFieldMask
271 @!field.MethodType:7!@ void set@!field.Name:15!@(@!field.Type!@ const value);
272 @@endif // field.PassFieldMask
273 @@endif // !field.ptrFieldCustomAccess
274 @@endif // !field.isParentField
275 @@else // field.isPtrField
276 @!field.MethodType:7!@ void set@!field.Name:15!@(const @!field.FullType!@ @!field.ArgRef!@value);
277 @@endif // field.isPtrField
278 @@endif // field.isPublic
283 /*---------------------------------------------------------------------*/
284 /*! \name Ptr Field Set */
288 @@endif // hasPtrFields
289 /*---------------------------------------------------------------------*/
290 /*! \name Ptr MField Set */
295 @@if field.isPtrField
296 @@if !field.isParentField
297 @@if field.ptrFieldStandardAccess
298 void @!field.PushToField:15!@ (@!field.Type!@ const value );
299 void @!field.AssignMField:15!@ (const @!field.TypeNamespace!@@!field.CARD!@@!field.FieldTypeCaps:15!@ &value);
300 void @!field.RemoveFromMFieldIndex:15!@ (UInt32 uiIndex );
301 void @!field.RemoveFromMFieldObject:15!@(@!field.Type!@ const value );
302 void @!field.ClearField:15!@ (void );
304 @@endif // field.ptrFieldStandardAccess
305 @@if field.ptrFieldNullCheckAccess
306 void @!field.PushToField:15!@ (@!field.Type!@ const value );
307 void @!field.AssignMField:15!@ (const @!field.TypeNamespace!@@!field.CARD!@@!field.FieldTypeCaps:15!@ &value);
308 void @!field.ClearField:15!@ (void );
309 void @!field.InsertIntoMField:15!@ (UInt32 uiIndex,
310 @!field.Type!@ const value );
311 void @!field.ReplaceInMFieldIndex:15!@ ( UInt32 uiIndex,
312 @!field.Type!@ const value );
313 void @!field.ReplaceInMFieldObject:15!@ (@!field.Type!@ const pOldElem,
314 @!field.Type!@ const pNewElem);
315 void @!field.RemoveFromMFieldIndex:15!@ (UInt32 uiIndex );
316 void @!field.RemoveFromMFieldObject:15!@(@!field.Type!@ const value );
318 @@endif // field.ptrFieldNullCheckAccess
319 @@endif // !field.isParentField
320 @@endif // field.isPtrField
321 @@endif // field.isPublic
324 @@endif // hasPublicFields
325 /*---------------------------------------------------------------------*/
326 /*! \name Binary Access */
329 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
330 virtual void copyToBin (BinaryDataHandler &pMem,
331 ConstFieldMaskArg whichField);
332 virtual void copyFromBin(BinaryDataHandler &pMem,
333 ConstFieldMaskArg whichField);
338 /*---------------------------------------------------------------------*/
339 /*! \name Construction */
342 static @!Classname!@TransitPtr create (void);
343 static @!Classname!@ *createEmpty (void);
345 static @!Classname!@TransitPtr createLocal (
346 BitVector bFlags = FCLocal::All);
348 static @!Classname!@ *createEmptyLocal(
349 BitVector bFlags = FCLocal::All);
351 static @!Classname!@TransitPtr createDependent (BitVector bFlags);
354 /*---------------------------------------------------------------------*/
358 virtual FieldContainerTransitPtr shallowCopy (void) const;
359 virtual FieldContainerTransitPtr shallowCopyLocal(
360 BitVector bFlags = FCLocal::All) const;
361 virtual FieldContainerTransitPtr shallowCopyDependent(
362 BitVector bFlags) const;
365 @@endif // !isAbstract
366 /*========================= PROTECTED ===============================*/
370 static TypeObject _type;
372 static void classDescInserter(TypeObject &oType);
373 static const Char8 *getClassname (void );
376 /*---------------------------------------------------------------------*/
381 SFUnrec@!Parent!@Ptr _sfDecoratee;
382 @@else // isDecorator
384 @@if !field.isStoreless
385 @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:15!@ _@!field.VarName!@;
386 @@endif // !field.isStoreless
388 @@endif // isDecorator
392 /*---------------------------------------------------------------------*/
393 /*! \name Constructors */
396 @!Classname!@Base(void);
397 @!Classname!@Base(const @!Classname!@Base &source);
400 /*---------------------------------------------------------------------*/
401 /*! \name Destructors */
404 virtual ~@!Classname!@Base(void);
408 /*---------------------------------------------------------------------*/
412 virtual TypeObject &getFinalType(void);
413 virtual const TypeObject &getFinalType(void) const;
417 /*---------------------------------------------------------------------*/
418 /*! \name onCreate */
422 void onCreate(const @!Classname!@ *source = NULL);
423 @@endif // hasPtrFields
427 /*---------------------------------------------------------------------*/
428 /*! \name Parent linking */
431 virtual bool linkParent (FieldContainer * const pParent,
432 UInt16 const childFieldId,
433 UInt16 const parentFieldId);
434 virtual bool unlinkParent(FieldContainer * const pParent,
435 UInt16 const parentFieldId);
438 @@endif // @!hasParentPtrFields!@
440 /*---------------------------------------------------------------------*/
441 /*! \name Child linking */
444 virtual bool unlinkChild(FieldContainer * const pChild,
445 UInt16 const childFieldId);
448 @@endif // @!hasChildPtrFields!@
449 /*---------------------------------------------------------------------*/
450 /*! \name Generic Field Access */
454 GetFieldHandlePtr getHandleDecoratee (void) const;
455 EditFieldHandlePtr editHandleDecoratee(void);
457 @@endif // isDecorator
459 @!field.MethodType!@ GetFieldHandlePtr getHandle@!field.Name:15!@ (void) const;
460 @!field.MethodType!@ EditFieldHandlePtr editHandle@!field.Name:15!@(void);
464 @@if hasProtectedFields
465 /*---------------------------------------------------------------------*/
466 /*! \name Field Get */
470 @@if field.isProtected
471 @@if field.isPtrField
472 @@if !field.isParentField
473 @@if !field.isPublicRead
474 @!field.MethodType:7!@ const @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:17!@ *get@!field.CARD!@@!field.Name:15!@ (void) const;
475 @@endif // !field.isPublicRead
476 @@if field.ptrFieldStandardAccess
477 @!field.MethodType:7!@ @!field.CARD!@@!field.FieldTypeCaps:17!@ *edit@!field.CARD!@@!field.Name:15!@(void);
478 @@endif // field.ptrFieldStandardAccess
480 @@if field.ptrFieldNullCheckAccess
481 @!field.MethodType:7!@ @!field.CARD!@@!field.FieldTypeCaps:17!@ *edit@!field.CARD!@@!field.Name:15!@(void);
482 @@endif // field.ptrFieldNullCheckAccess
483 @@endif // field.isSField
484 @@endif // !field.isParentField
485 @@else // field.isPtrField
487 @!field.MethodType:7!@ @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:17!@ *edit@!field.CARD!@@!field.Name:15!@(void);
488 @@if !field.isPublicRead
489 @!field.MethodType:7!@ const @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:17!@ *get@!field.CARD!@@!field.Name:15!@ (void) const;
490 @@endif // !field.isPublicRead
491 @@endif // field.isPtrField
492 @@endif // field.isProtected
496 @@if field.isProtected
499 @@if field.isPtrField
500 @@if !field.isPublicRead
501 @!field.MethodType:7!@ @!field.FullType!@ get@!field.Name:15!@(void) const;
502 @@endif // !field.isPublicRead
503 @@else // field.isPtrField
504 @!field.MethodType:7!@ @!field.FullType:19!@ &edit@!field.Name:15!@(void);
505 @@if !field.isPublicRead
506 @!field.MethodType:7!@ @!field.RetConst!@ @!field.FullType:19!@ @!field.RetRef!@get@!field.Name:15!@ (void) const;
507 @@endif // !field.isPublicRead
508 @@endif // field.isPtrField
509 @@else // field.isSField
511 @@if field.isPtrField
512 @@if !field.isPublicRead
513 @!field.MethodType:7!@ @!field.Type!@ get@!field.Name:15!@(const UInt32 index) const;
514 @@endif // !field.isPublicRead
515 @@else // field.isPtrField
516 @!field.MethodType:7!@ @!field.FieldTypeNS!@@!field.CARD!@@!field.FieldTypeCaps:17!@::reference edit@!field.Name:15!@(const UInt32 index);
517 @@if !field.isPublicRead
518 @!field.MethodType:7!@ @!field.RetConst!@ @!field.FullType:19!@ @!field.RetRef!@get@!field.Name:15!@ (const UInt32 index) const;
519 @@endif // !field.isPublicRead
520 @@endif // field.isPtrField
521 @@endif // field.isSField
522 @@endif // field.isProtected
526 /*---------------------------------------------------------------------*/
527 /*! \name Field Set */
531 @@if field.isProtected
532 @@if field.isPtrField
533 @@if !field.isParentField
534 @@if !field.ptrFieldCustomAccess
535 @!field.MethodType:7!@ void set@!field.Name:15!@(@!field.Type!@ const value);
536 @@endif // !field.ptrFieldCustomAccess
537 @@endif // !field.isParentField
538 @@else // field.isPtrField
539 @!field.MethodType:7!@ void set@!field.Name:15!@(const @!field.FullType!@ @!field.ArgRef!@value);
540 @@endif // field.isPtrField
541 @@endif // field.isProtected
545 /*---------------------------------------------------------------------*/
546 /*! \name Ptr MField Set */
550 @@if field.isProtected
551 @@if field.isPtrField
552 @@if !field.isParentField
553 @@if field.ptrFieldStandardAccess
554 void @!field.PushToField:15!@ (@!field.Type!@ const value );
555 void @!field.AssignMField:15!@ (const @!field.TypeNamespace!@@!field.CARD!@@!field.FieldTypeCaps:15!@ &value);
556 void @!field.RemoveFromMFieldIndex:15!@ (UInt32 uiIndex );
557 void @!field.RemoveFromMFieldObject:15!@(@!field.Type!@ const value );
558 void @!field.ClearField:15!@ (void );
560 @@endif // field.ptrFieldStandardAccess
561 @@if field.ptrFieldNullCheckAccess
562 void @!field.PushToField:15!@ (@!field.Type!@ const value );
563 void @!field.AssignMField:15!@ (const @!field.TypeNamespace!@@!field.CARD!@@!field.FieldTypeCaps:15!@ &value);
564 void @!field.ClearField:15!@ (void );
565 void @!field.InsertIntoMField:15!@ (UInt32 uiIndex,
566 @!field.Type!@ const value );
567 void @!field.ReplaceInMFieldIndex:15!@ (UInt32 uiIndex,
568 @!field.Type!@ const value );
569 void @!field.ReplaceInMFieldObject:15!@ (@!field.Type!@ const pOldElem,
570 @!field.Type!@ const pNewElem);
571 void @!field.RemoveFromMFieldIndex:15!@ (UInt32 uiIndex );
572 void @!field.RemoveFromMFieldObject:15!@(@!field.Type!@ const value );
574 @@endif // field.ptrFieldNullCheckAccess
575 @@endif // !field.isParentField
576 @@endif // field.isPtrField
577 @@endif // field.isProtected
580 @@endif // hasProtectedFields
581 /*---------------------------------------------------------------------*/
585 #ifdef OSG_MT_CPTR_ASPECT
586 virtual void execSyncV( FieldContainer &oFrom,
587 ConstFieldMaskArg whichField,
588 AspectOffsetStore &oOffsets,
589 ConstFieldMaskArg syncMode ,
590 const UInt32 uiSyncInfo);
592 void execSync ( @!Classname!@Base *pFrom,
593 ConstFieldMaskArg whichField,
594 AspectOffsetStore &oOffsets,
595 ConstFieldMaskArg syncMode ,
596 const UInt32 uiSyncInfo);
600 /*---------------------------------------------------------------------*/
605 /*---------------------------------------------------------------------*/
606 /*! \name Aspect Create */
610 #ifdef OSG_MT_CPTR_ASPECT
611 virtual FieldContainer *createAspectCopy(
612 const FieldContainer *pRefAspect) const;
614 @@endif // !isAbstract
617 /*---------------------------------------------------------------------*/
621 /*---------------------------------------------------------------------*/
625 virtual void resolveLinks(void);
628 /*========================== PRIVATE ================================*/
631 /*---------------------------------------------------------------------*/
633 // prohibit default functions (move to 'public' if you need one)
634 void operator =(const @!Classname!@Base &source);
637 typedef @!Classname!@Base *@!Classname!@BaseP;
640 typedef CoredNodeRefPtr <@!Classname!@> @!Classname!@NodeRefPtr;
641 typedef CoredNodeMTRefPtr<@!Classname!@> @!Classname!@NodeMTRefPtr;
644 @!LIBNAMESPACE!@_END_NAMESPACE
646 #endif /* _OSG@!CLASSNAME!@BASE_H_ */