changed: gcc8 base update
[opensg.git] / Source / System / State / Base / OSGChunkBlock.h
blob0c0db2f216886801bc3c9db29ffa1ed0676c44db
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
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 #ifndef _OSGCHUNKBLOCK_H_
40 #define _OSGCHUNKBLOCK_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGChunkBlockBase.h"
46 #include "OSGChunkListHandlerMixin.h"
47 #include "OSGChunkListHelper.h"
48 #include "OSGState.h"
50 OSG_BEGIN_NAMESPACE
52 class OSBChunkBlockElement;
54 template <class Desc>
55 class MapCacheHandlerMixin;
57 struct ChunkBlockListHandlerDesc
59 typedef ChunkBlockBase ParentT;
60 typedef ChunkBlock FinalContainer;
61 typedef ChunkListHelper ChunkHelper;
63 typedef MFUnrecStateChunkPtr ChunksFieldType;
66 /*! \brief ChunkBlock class. See \ref
67 PageSystemChunkBlock for a description.
69 \ingroup GrpSystemStateBase
70 \ingroup GrpLibOSGSystem
71 \includebasedoc
74 class OSG_SYSTEM_DLLMAPPING ChunkBlock :
75 public ChunkListHandlerMixin<ChunkBlockListHandlerDesc>
77 protected:
79 /*========================== PUBLIC =================================*/
81 public:
83 typedef ChunkListHandlerMixin<ChunkBlockListHandlerDesc> Inherited;
84 typedef ChunkBlock Self;
86 /*---------------------------------------------------------------------*/
87 /*! \name Sync */
88 /*! \{ */
90 virtual void changed(ConstFieldMaskArg whichField,
91 UInt32 origin,
92 BitVector details );
94 /*! \} */
95 /*---------------------------------------------------------------------*/
96 /*! \name Output */
97 /*! \{ */
99 bool addChunk (StateChunk *chunk,
100 Int32 slot = State::AutoSlotReplace);
102 bool subChunk (StateChunk *chunk,
103 Int32 slot = State::AutoSlotReplace);
105 void clearChunks(void );
107 /*! \} */
108 /*---------------------------------------------------------------------*/
109 /*! \name Output */
110 /*! \{ */
112 Int32 find( StateChunk *chunk);
113 StateChunk *find(const StateChunkClass &type,
114 Int32 slot = State::AutoSlotReplace);
116 /*! \} */
117 /*---------------------------------------------------------------------*/
118 /*! \name Output */
119 /*! \{ */
121 MFUnrecStateChunkPtr::const_iterator beginChunks(void) const;
122 MFUnrecStateChunkPtr::const_iterator endChunks (void) const;
124 /*! \} */
125 /*---------------------------------------------------------------------*/
126 /*! \name Output */
127 /*! \{ */
129 virtual void dump( UInt32 uiIndent = 0,
130 const BitVector bvFlags = 0) const;
132 /*! \} */
133 /*========================= PROTECTED ===============================*/
135 protected:
137 // Variables should all be in ChunkBlockBase.
139 /*---------------------------------------------------------------------*/
140 /*! \name Constructors */
141 /*! \{ */
143 ChunkBlock(void);
144 ChunkBlock(const ChunkBlock &source);
146 /*! \} */
147 /*---------------------------------------------------------------------*/
148 /*! \name Destructors */
149 /*! \{ */
151 virtual ~ChunkBlock(void);
153 /*! \} */
154 /*---------------------------------------------------------------------*/
155 /*! \name Render */
156 /*! \{ */
158 Int32 getSlot(StateChunk *pChunk);
160 /*! \} */
161 /*---------------------------------------------------------------------*/
162 /*! \name Ptr MField Set */
163 /*! \{ */
165 void pushToChunks (StateChunk * const value );
166 void replaceChunk (UInt32 uiIndex,
167 StateChunk * const value );
168 void removeFromChunks(UInt32 uiIndex );
169 void removeFromChunks(StateChunk * const value );
171 /*! \} */
172 /*---------------------------------------------------------------------*/
173 /*! \name Init */
174 /*! \{ */
176 static void initMethod(InitPhase ePhase);
178 /*! \} */
179 /*========================== PRIVATE ================================*/
181 private:
183 friend class FieldContainer;
184 friend class ChunkBlockBase;
185 friend class ChunkListHandlerMixin<ChunkBlockListHandlerDesc>;
186 friend class OSBChunkBlockElement;
188 template <class Desc>
189 friend class MapCacheHandlerMixin;
191 // prohibit default functions (move to 'public' if you need one)
192 void operator =(const ChunkBlock &source);
195 typedef ChunkBlock *ChunkBlockP;
197 OSG_END_NAMESPACE
199 #include "OSGChunkBlockBase.inl"
200 #include "OSGChunkBlock.inl"
202 #endif /* _OSGCHUNKBLOCK_H_ */