1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2003 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGREFLEXIVECONTAINERTYPE_H_
40 #define _OSGREFLEXIVECONTAINERTYPE_H_
45 #include "OSGDataType.h"
46 #include "OSGContainerForwards.h"
53 class ReflexiveContainerType
;
55 /*! \ingroup GrpBaseFieldContainerBase
58 typedef void (*InitalInsertDescFunc
)(OSG::ReflexiveContainerType
&);
60 /*! \class ReflexiveContainerType
61 \ingroup GrpBaseFieldContainerBase
62 \ingroup GrpLibOSGBase
65 class OSG_BASE_DLLMAPPING ReflexiveContainerType
: public DataType
67 /*========================== PUBLIC =================================*/
71 /*---------------------------------------------------------------------*/
72 /*! \name Constants */
76 /*---------------------------------------------------------------------*/
77 /*! \name General Fieldcontainer Declaration */
81 /*---------------------------------------------------------------------*/
82 /*! \name Constructors */
85 ReflexiveContainerType(const Char8
*szName
,
86 const Char8
*szParentName
= NULL
,
87 const Char8
*szGroupName
= NULL
,
88 const UInt32 uiNameSpace
= 0,
89 InitalInsertDescFunc descInsertFunc
= NULL
,
90 bool bDescsAddable
= false,
91 BitVector bvUnmarkedOnCreate
= 0);
94 /*---------------------------------------------------------------------*/
95 /*! \name Destructor */
98 virtual ~ReflexiveContainerType(void);
101 /*---------------------------------------------------------------------*/
105 UInt16
getGroupId(void) const;
108 /*---------------------------------------------------------------------*/
112 FieldDescriptionBase
*getFieldDesc ( UInt32 uiFieldId
);
113 FieldDescriptionBase
*getFieldDesc ( UInt32 uiFieldId
) const;
115 FieldDescriptionBase
*getFieldDesc (const Char8
*szFieldName
);
116 FieldDescriptionBase
*getFieldDesc (const Char8
*szFieldName
) const;
118 UInt32
getNumFieldDescs( void ) const;
121 /*---------------------------------------------------------------------*/
125 BitVector
getUnmarkedOnCreate ( void ) const;
126 void setFieldsUnmarkedOnCreate (const BitVector bvFieldMasks
);
127 void clearFieldsUnmarkedOnCreate(const BitVector bvFieldMasks
);
130 /*---------------------------------------------------------------------*/
131 /*! \name your_category */
134 void addInitialDesc(FieldDescriptionBase
*pDesc
);
137 /*---------------------------------------------------------------------*/
138 /*! \name Container Access */
141 UInt32
addDescription(const FieldDescriptionBase
&desc
);
142 bool subDescription( UInt32 uiFieldId
);
145 /*---------------------------------------------------------------------*/
146 /*! \name Binary Access */
150 /*---------------------------------------------------------------------*/
151 /*! \name your_operators */
155 /*---------------------------------------------------------------------*/
156 /*! \name Assignment */
160 /*---------------------------------------------------------------------*/
161 /*! \name Comparison */
165 /*---------------------------------------------------------------------*/
169 void dumpFieldInfo(void) const;
172 /*========================= PROTECTED ===============================*/
176 /*---------------------------------------------------------------------*/
177 /*! \name Type information */
180 typedef std::map
<std::string
, FieldDescriptionBase
*> DescMap
;
181 typedef std::vector
< FieldDescriptionBase
*> DescVec
;
183 typedef DescMap::iterator DescMapIt
;
184 typedef DescMap::const_iterator DescMapConstIt
;
186 typedef DescVec::iterator DescVecIt
;
187 typedef DescVec::const_iterator DescVecConstIt
;
190 /*---------------------------------------------------------------------*/
194 ReflexiveContainerType(const ReflexiveContainerType
&source
);
197 /*---------------------------------------------------------------------*/
204 std::string _szGroupName
;
206 DescVec _vInitialDescs
;
211 InitalInsertDescFunc _descInsertFunc
;
213 BitVector _bvUnmarkedOnCreate
;
216 /*---------------------------------------------------------------------*/
220 bool initFields (void);
221 bool initParentFields(void);
224 virtual bool initialize (void);
225 virtual void terminate (void);
228 /*---------------------------------------------------------------------*/
229 /*! \name MT Destruction */
233 /*---------------------------------------------------------------------*/
238 /*========================== PRIVATE ================================*/
242 typedef DataType Inherited
;
244 /*!\brief prohibit default function (move to 'public' if needed) */
245 void operator =(const ReflexiveContainerType
&source
);
250 #include "OSGReflexiveContainerType.inl"
252 #endif /* _OSGREFLEXIVECONTAINERTYPE_H_ */