fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / RenderingBackend / OSGHashSorter.inl
blob91141d5591dedbb8db51281576c5fdbf0bc9b529
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *             Copyright (C) 2000-2002 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 //---------------------------------------------------------------------------
40 //  Includes
41 //---------------------------------------------------------------------------
43 OSG_BEGIN_NAMESPACE
45 /***************************************************************************\
46  *                               Types                                     *
47 \***************************************************************************/
50 /***************************************************************************\
51  *                           Class variables                               *
52 \***************************************************************************/
55 /***************************************************************************\
56  *                           Class methods                                 *
57 \***************************************************************************/
60 /*-------------------------------------------------------------------------*\
61  -  public                                                                 -
62 \*-------------------------------------------------------------------------*/
64 /*-------------------------------------------------------------------------*\
65  -  protected                                                              -
66 \*-------------------------------------------------------------------------*/
68 inline
69 void HashSorter::Level3Sorter::clear(void)
71     _mLevelMap.clear();
73     _pRoot = NULL;
76 inline
77 void HashSorter::Level3Sorter::init(void)
79     _mLevelMap.set_empty_key  (0xFFFF);
80     _mLevelMap.set_deleted_key(0xFFFE);
82     _pRoot = NULL;
85 inline
86 void HashSorter::Level2Sorter::clear(void)
88     _mLevelMap.clear();
90     _pRoot = NULL;
93 inline
94 void HashSorter::Level2Sorter::init(void)
96     _mLevelMap.set_empty_key  (0xFFFF);
97     _mLevelMap.set_deleted_key(0xFFFE);
99     _pRoot = NULL;
102 inline
103 void HashSorter::Level1Sorter::clear(void)
105     _mLevelMap.clear();
107     _pRoot = NULL;
110 inline
111 void HashSorter::Level1Sorter::init(void)
113     _mLevelMap.set_empty_key  (0xFFFF);
114     _mLevelMap.set_deleted_key(0xFFFE);
116     _pRoot = NULL;
119 inline
120 void HashSorter::Level1Sorter::setupRoot(RenderTreeNode *pRoot)
122     OSG_ASSERT(_pRoot == NULL);
124     _pRoot = pRoot;
127 inline
128 void HashSorter::initLevel2Sorter(Level2Sorter *pElement)
130     pElement->init();
133 inline
134 void HashSorter::initLevel3Sorter(Level3Sorter *pElement)
136     pElement->init();
139 /*-------------------------------------------------------------------------*\
140  -  private                                                                -
141 \*-------------------------------------------------------------------------*/
143 /***************************************************************************\
144  *                           Instance methods                              *
145 \***************************************************************************/
147 /*-------------------------------------------------------------------------*\
148  -  public                                                                 -
149 \*-------------------------------------------------------------------------*/
151 inline
152 void HashSorter::reset(void)
154     _oLevel3Pool.freeAll();
155     _oLevel2Pool.freeAll();
157     _oLevel1Sorter.clear();
160 inline
161 void HashSorter::setupLevel1Root(RenderTreeNode *pRoot)
163     return _oLevel1Sorter.setupRoot(pRoot);
167 /*------------- constructors & destructors --------------------------------*/
169 /*------------------------------ access -----------------------------------*/
171 /*---------------------------- properties ---------------------------------*/
173 /*-------------------------- your_category---------------------------------*/
175 /*-------------------------- assignment -----------------------------------*/
177 /*-------------------------- comparison -----------------------------------*/
179 /*-------------------------------------------------------------------------*\
180  -  protected                                                              -
181 \*-------------------------------------------------------------------------*/
183 /*-------------------------------------------------------------------------*\
184  -  private                                                                -
185 \*-------------------------------------------------------------------------*/
187 OSG_END_NAMESPACE