fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FieldContainer / Attachments / OSGStringAttributeMapBase.h
blob483929f756d5a39bc56f08f290afbb03c2cc642f
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 StringAttributeMap
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSTRINGATTRIBUTEMAPBASE_H_
55 #define _OSGSTRINGATTRIBUTEMAPBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGAttachment.h" // Parent
68 #include "OSGBaseFields.h" // Keys type
70 #include "OSGStringAttributeMapFields.h"
72 OSG_BEGIN_NAMESPACE
75 class StringAttributeMap;
77 //! \brief StringAttributeMap Base Class.
79 class OSG_SYSTEM_DLLMAPPING StringAttributeMapBase : public Attachment
81 public:
83 typedef Attachment Inherited;
84 typedef Attachment ParentContainer;
86 typedef Inherited::TypeObject TypeObject;
87 typedef TypeObject::InitPhase InitPhase;
89 OSG_GEN_INTERNALPTR(StringAttributeMap);
91 /*========================== PUBLIC =================================*/
93 public:
95 enum
97 KeysFieldId = Inherited::NextFieldId,
98 ValuesFieldId = KeysFieldId + 1,
99 NextFieldId = ValuesFieldId + 1
102 static const OSG::BitVector KeysFieldMask =
103 (TypeTraits<BitVector>::One << KeysFieldId);
104 static const OSG::BitVector ValuesFieldMask =
105 (TypeTraits<BitVector>::One << ValuesFieldId);
106 static const OSG::BitVector NextFieldMask =
107 (TypeTraits<BitVector>::One << NextFieldId);
109 typedef MFString MFKeysType;
110 typedef MFString MFValuesType;
112 /*---------------------------------------------------------------------*/
113 /*! \name Class Get */
114 /*! \{ */
116 static FieldContainerType &getClassType (void);
117 static UInt32 getClassTypeId (void);
118 static UInt16 getClassGroupId(void);
120 /*! \} */
121 /*---------------------------------------------------------------------*/
122 /*! \name FieldContainer Get */
123 /*! \{ */
125 virtual FieldContainerType &getType (void);
126 virtual const FieldContainerType &getType (void) const;
128 virtual UInt32 getContainerSize(void) const;
130 /*! \} */
131 /*---------------------------------------------------------------------*/
132 /*! \name Binary Access */
133 /*! \{ */
135 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
136 virtual void copyToBin (BinaryDataHandler &pMem,
137 ConstFieldMaskArg whichField);
138 virtual void copyFromBin(BinaryDataHandler &pMem,
139 ConstFieldMaskArg whichField);
142 /*! \} */
143 /*---------------------------------------------------------------------*/
144 /*! \name Construction */
145 /*! \{ */
147 static StringAttributeMapTransitPtr create (void);
148 static StringAttributeMap *createEmpty (void);
150 static StringAttributeMapTransitPtr createLocal (
151 BitVector bFlags = FCLocal::All);
153 static StringAttributeMap *createEmptyLocal(
154 BitVector bFlags = FCLocal::All);
156 static StringAttributeMapTransitPtr createDependent (BitVector bFlags);
158 /*! \} */
159 /*---------------------------------------------------------------------*/
160 /*! \name Copy */
161 /*! \{ */
163 virtual FieldContainerTransitPtr shallowCopy (void) const;
164 virtual FieldContainerTransitPtr shallowCopyLocal(
165 BitVector bFlags = FCLocal::All) const;
166 virtual FieldContainerTransitPtr shallowCopyDependent(
167 BitVector bFlags) const;
169 /*! \} */
170 /*========================= PROTECTED ===============================*/
172 protected:
174 static TypeObject _type;
176 static void classDescInserter(TypeObject &oType);
177 static const Char8 *getClassname (void );
179 /*---------------------------------------------------------------------*/
180 /*! \name Fields */
181 /*! \{ */
183 MFString _mfKeys;
184 MFString _mfValues;
186 /*! \} */
187 /*---------------------------------------------------------------------*/
188 /*! \name Constructors */
189 /*! \{ */
191 StringAttributeMapBase(void);
192 StringAttributeMapBase(const StringAttributeMapBase &source);
194 /*! \} */
195 /*---------------------------------------------------------------------*/
196 /*! \name Destructors */
197 /*! \{ */
199 virtual ~StringAttributeMapBase(void);
201 /*! \} */
202 /*---------------------------------------------------------------------*/
203 /*! \name onCreate */
204 /*! \{ */
207 /*! \} */
208 /*---------------------------------------------------------------------*/
209 /*! \name Generic Field Access */
210 /*! \{ */
212 GetFieldHandlePtr getHandleKeys (void) const;
213 EditFieldHandlePtr editHandleKeys (void);
214 GetFieldHandlePtr getHandleValues (void) const;
215 EditFieldHandlePtr editHandleValues (void);
217 /*! \} */
218 /*---------------------------------------------------------------------*/
219 /*! \name Field Get */
220 /*! \{ */
223 MFString *editMFKeys (void);
224 const MFString *getMFKeys (void) const;
226 MFString *editMFValues (void);
227 const MFString *getMFValues (void) const;
230 MFString ::reference editKeys (const UInt32 index);
231 const std::string &getKeys (const UInt32 index) const;
233 MFString ::reference editValues (const UInt32 index);
234 const std::string &getValues (const UInt32 index) const;
236 /*! \} */
237 /*---------------------------------------------------------------------*/
238 /*! \name Field Set */
239 /*! \{ */
242 /*! \} */
243 /*---------------------------------------------------------------------*/
244 /*! \name Ptr MField Set */
245 /*! \{ */
247 /*! \} */
248 /*---------------------------------------------------------------------*/
249 /*! \name Sync */
250 /*! \{ */
252 #ifdef OSG_MT_CPTR_ASPECT
253 virtual void execSyncV( FieldContainer &oFrom,
254 ConstFieldMaskArg whichField,
255 AspectOffsetStore &oOffsets,
256 ConstFieldMaskArg syncMode ,
257 const UInt32 uiSyncInfo);
259 void execSync ( StringAttributeMapBase *pFrom,
260 ConstFieldMaskArg whichField,
261 AspectOffsetStore &oOffsets,
262 ConstFieldMaskArg syncMode ,
263 const UInt32 uiSyncInfo);
264 #endif
266 /*! \} */
267 /*---------------------------------------------------------------------*/
268 /*! \name Edit */
269 /*! \{ */
271 /*! \} */
272 /*---------------------------------------------------------------------*/
273 /*! \name Aspect Create */
274 /*! \{ */
276 #ifdef OSG_MT_CPTR_ASPECT
277 virtual FieldContainer *createAspectCopy(
278 const FieldContainer *pRefAspect) const;
279 #endif
281 /*! \} */
282 /*---------------------------------------------------------------------*/
283 /*! \name Edit */
284 /*! \{ */
285 /*! \} */
286 /*---------------------------------------------------------------------*/
287 /*! \name Sync */
288 /*! \{ */
290 virtual void resolveLinks(void);
292 /*! \} */
293 /*========================== PRIVATE ================================*/
295 private:
296 /*---------------------------------------------------------------------*/
298 // prohibit default functions (move to 'public' if you need one)
299 void operator =(const StringAttributeMapBase &source);
302 typedef StringAttributeMapBase *StringAttributeMapBaseP;
304 OSG_END_NAMESPACE
306 #endif /* _OSGSTRINGATTRIBUTEMAPBASE_H_ */