1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2006 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 _OSGCHUNKBLOCK_H_
40 #define _OSGCHUNKBLOCK_H_
45 #include "OSGChunkBlockBase.h"
46 #include "OSGChunkListHandlerMixin.h"
47 #include "OSGChunkListHelper.h"
52 class OSBChunkBlockElement
;
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
74 class OSG_SYSTEM_DLLMAPPING ChunkBlock
:
75 public ChunkListHandlerMixin
<ChunkBlockListHandlerDesc
>
79 /*========================== PUBLIC =================================*/
83 typedef ChunkListHandlerMixin
<ChunkBlockListHandlerDesc
> Inherited
;
84 typedef ChunkBlock Self
;
86 /*---------------------------------------------------------------------*/
90 virtual void changed(ConstFieldMaskArg whichField
,
95 /*---------------------------------------------------------------------*/
99 bool addChunk (StateChunk
*chunk
,
100 Int32 slot
= State::AutoSlotReplace
);
102 bool subChunk (StateChunk
*chunk
,
103 Int32 slot
= State::AutoSlotReplace
);
105 void clearChunks(void );
108 /*---------------------------------------------------------------------*/
112 Int32
find( StateChunk
*chunk
);
113 StateChunk
*find(const StateChunkClass
&type
,
114 Int32 slot
= State::AutoSlotReplace
);
117 /*---------------------------------------------------------------------*/
121 MFUnrecStateChunkPtr::const_iterator
beginChunks(void) const;
122 MFUnrecStateChunkPtr::const_iterator
endChunks (void) const;
125 /*---------------------------------------------------------------------*/
129 virtual void dump( UInt32 uiIndent
= 0,
130 const BitVector bvFlags
= 0) const;
133 /*========================= PROTECTED ===============================*/
137 // Variables should all be in ChunkBlockBase.
139 /*---------------------------------------------------------------------*/
140 /*! \name Constructors */
144 ChunkBlock(const ChunkBlock
&source
);
147 /*---------------------------------------------------------------------*/
148 /*! \name Destructors */
151 virtual ~ChunkBlock(void);
154 /*---------------------------------------------------------------------*/
158 Int32
getSlot(StateChunk
*pChunk
);
161 /*---------------------------------------------------------------------*/
162 /*! \name Ptr MField Set */
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
);
172 /*---------------------------------------------------------------------*/
176 static void initMethod(InitPhase ePhase
);
179 /*========================== 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
;
199 #include "OSGChunkBlockBase.inl"
200 #include "OSGChunkBlock.inl"
202 #endif /* _OSGCHUNKBLOCK_H_ */