fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / Shader / SHL / OSGSimpleSHLVariableChunkBase.h
blob67aa6e9a8da1aed0f34a24d6c3013774df060fed
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 SimpleSHLVariableChunk
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSIMPLESHLVARIABLECHUNKBASE_H_
55 #define _OSGSIMPLESHLVARIABLECHUNKBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGStateChunk.h" // Parent
68 #include "OSGShaderProgramVariablesFields.h" // Variables type
69 #include "OSGSysFields.h" // VariableLocations type
71 #include "OSGSimpleSHLVariableChunkFields.h"
73 OSG_BEGIN_NAMESPACE
76 class SimpleSHLVariableChunk;
78 //! \brief SimpleSHLVariableChunk Base Class.
80 class OSG_SYSTEM_DLLMAPPING SimpleSHLVariableChunkBase : public StateChunk
82 public:
84 typedef StateChunk Inherited;
85 typedef StateChunk ParentContainer;
87 typedef Inherited::TypeObject TypeObject;
88 typedef TypeObject::InitPhase InitPhase;
90 OSG_GEN_INTERNALPTR(SimpleSHLVariableChunk);
92 /*========================== PUBLIC =================================*/
94 public:
96 enum
98 VariablesFieldId = Inherited::NextFieldId,
99 VariableLocationsFieldId = VariablesFieldId + 1,
100 NextFieldId = VariableLocationsFieldId + 1
103 static const OSG::BitVector VariablesFieldMask =
104 (TypeTraits<BitVector>::One << VariablesFieldId);
105 static const OSG::BitVector VariableLocationsFieldMask =
106 (TypeTraits<BitVector>::One << VariableLocationsFieldId);
107 static const OSG::BitVector NextFieldMask =
108 (TypeTraits<BitVector>::One << NextFieldId);
110 typedef SFUnrecChildShaderProgramVariablesPtr SFVariablesType;
111 typedef MFInt32 MFVariableLocationsType;
113 /*---------------------------------------------------------------------*/
114 /*! \name Class Get */
115 /*! \{ */
117 static FieldContainerType &getClassType (void);
118 static UInt32 getClassTypeId (void);
119 static UInt16 getClassGroupId(void);
121 /*! \} */
122 /*---------------------------------------------------------------------*/
123 /*! \name FieldContainer Get */
124 /*! \{ */
126 virtual FieldContainerType &getType (void);
127 virtual const FieldContainerType &getType (void) const;
129 virtual UInt32 getContainerSize(void) const;
131 /*! \} */
132 /*---------------------------------------------------------------------*/
133 /*! \name Field Get */
134 /*! \{ */
136 const SFUnrecChildShaderProgramVariablesPtr *getSFVariables (void) const;
137 SFUnrecChildShaderProgramVariablesPtr *editSFVariables (void);
140 ShaderProgramVariables * getVariables (void) const;
142 /*! \} */
143 /*---------------------------------------------------------------------*/
144 /*! \name Field Set */
145 /*! \{ */
147 void setVariables (ShaderProgramVariables * const value);
149 /*! \} */
150 /*---------------------------------------------------------------------*/
151 /*! \name Ptr Field Set */
152 /*! \{ */
154 /*! \} */
155 /*---------------------------------------------------------------------*/
156 /*! \name Ptr MField Set */
157 /*! \{ */
159 /*! \} */
160 /*---------------------------------------------------------------------*/
161 /*! \name Binary Access */
162 /*! \{ */
164 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
165 virtual void copyToBin (BinaryDataHandler &pMem,
166 ConstFieldMaskArg whichField);
167 virtual void copyFromBin(BinaryDataHandler &pMem,
168 ConstFieldMaskArg whichField);
171 /*! \} */
172 /*---------------------------------------------------------------------*/
173 /*! \name Construction */
174 /*! \{ */
176 static SimpleSHLVariableChunkTransitPtr create (void);
177 static SimpleSHLVariableChunk *createEmpty (void);
179 static SimpleSHLVariableChunkTransitPtr createLocal (
180 BitVector bFlags = FCLocal::All);
182 static SimpleSHLVariableChunk *createEmptyLocal(
183 BitVector bFlags = FCLocal::All);
185 static SimpleSHLVariableChunkTransitPtr createDependent (BitVector bFlags);
187 /*! \} */
188 /*---------------------------------------------------------------------*/
189 /*! \name Copy */
190 /*! \{ */
192 virtual FieldContainerTransitPtr shallowCopy (void) const;
193 virtual FieldContainerTransitPtr shallowCopyLocal(
194 BitVector bFlags = FCLocal::All) const;
195 virtual FieldContainerTransitPtr shallowCopyDependent(
196 BitVector bFlags) const;
198 /*! \} */
199 /*========================= PROTECTED ===============================*/
201 protected:
203 static TypeObject _type;
205 static void classDescInserter(TypeObject &oType);
206 static const Char8 *getClassname (void );
208 /*---------------------------------------------------------------------*/
209 /*! \name Fields */
210 /*! \{ */
212 SFUnrecChildShaderProgramVariablesPtr _sfVariables;
213 MFInt32 _mfVariableLocations;
215 /*! \} */
216 /*---------------------------------------------------------------------*/
217 /*! \name Constructors */
218 /*! \{ */
220 SimpleSHLVariableChunkBase(void);
221 SimpleSHLVariableChunkBase(const SimpleSHLVariableChunkBase &source);
223 /*! \} */
224 /*---------------------------------------------------------------------*/
225 /*! \name Destructors */
226 /*! \{ */
228 virtual ~SimpleSHLVariableChunkBase(void);
230 /*! \} */
231 /*---------------------------------------------------------------------*/
232 /*! \name onCreate */
233 /*! \{ */
235 void onCreate(const SimpleSHLVariableChunk *source = NULL);
237 /*! \} */
238 /*---------------------------------------------------------------------*/
239 /*! \name Child linking */
240 /*! \{ */
242 virtual bool unlinkChild(FieldContainer * const pChild,
243 UInt16 const childFieldId);
245 /*! \} */
246 /*---------------------------------------------------------------------*/
247 /*! \name Generic Field Access */
248 /*! \{ */
250 GetFieldHandlePtr getHandleVariables (void) const;
251 EditFieldHandlePtr editHandleVariables (void);
252 GetFieldHandlePtr getHandleVariableLocations (void) const;
253 EditFieldHandlePtr editHandleVariableLocations(void);
255 /*! \} */
256 /*---------------------------------------------------------------------*/
257 /*! \name Field Get */
258 /*! \{ */
261 MFInt32 *editMFVariableLocations(void);
262 const MFInt32 *getMFVariableLocations (void) const;
265 MFInt32 ::reference editVariableLocations(const UInt32 index);
266 Int32 getVariableLocations (const UInt32 index) const;
268 /*! \} */
269 /*---------------------------------------------------------------------*/
270 /*! \name Field Set */
271 /*! \{ */
274 /*! \} */
275 /*---------------------------------------------------------------------*/
276 /*! \name Ptr MField Set */
277 /*! \{ */
279 /*! \} */
280 /*---------------------------------------------------------------------*/
281 /*! \name Sync */
282 /*! \{ */
284 #ifdef OSG_MT_CPTR_ASPECT
285 virtual void execSyncV( FieldContainer &oFrom,
286 ConstFieldMaskArg whichField,
287 AspectOffsetStore &oOffsets,
288 ConstFieldMaskArg syncMode ,
289 const UInt32 uiSyncInfo);
291 void execSync ( SimpleSHLVariableChunkBase *pFrom,
292 ConstFieldMaskArg whichField,
293 AspectOffsetStore &oOffsets,
294 ConstFieldMaskArg syncMode ,
295 const UInt32 uiSyncInfo);
296 #endif
298 /*! \} */
299 /*---------------------------------------------------------------------*/
300 /*! \name Edit */
301 /*! \{ */
303 /*! \} */
304 /*---------------------------------------------------------------------*/
305 /*! \name Aspect Create */
306 /*! \{ */
308 #ifdef OSG_MT_CPTR_ASPECT
309 virtual FieldContainer *createAspectCopy(
310 const FieldContainer *pRefAspect) const;
311 #endif
313 /*! \} */
314 /*---------------------------------------------------------------------*/
315 /*! \name Edit */
316 /*! \{ */
317 /*! \} */
318 /*---------------------------------------------------------------------*/
319 /*! \name Sync */
320 /*! \{ */
322 virtual void resolveLinks(void);
324 /*! \} */
325 /*========================== PRIVATE ================================*/
327 private:
328 /*---------------------------------------------------------------------*/
330 // prohibit default functions (move to 'public' if you need one)
331 void operator =(const SimpleSHLVariableChunkBase &source);
334 typedef SimpleSHLVariableChunkBase *SimpleSHLVariableChunkBaseP;
336 OSG_END_NAMESPACE
338 #endif /* _OSGSIMPLESHLVARIABLECHUNKBASE_H_ */