fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / NodeCores / Groups / Misc / OSGProxyGroup.h
bloba71749d438c3ebf0dafb917c472fa6a8b764c8d8
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 #ifndef _OSGPROXYGROUP_H_
40 #define _OSGPROXYGROUP_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include <queue>
47 #include "OSGProxyGroupBase.h"
48 #include "OSGLock.h"
50 OSG_BEGIN_NAMESPACE
52 /*! \brief ProxyGroup
53 \ingroup GrpGroupMiscObj
54 \ingroup GrpLibOSGGroup
55 \includebasedoc
58 class OSG_GROUP_DLLMAPPING ProxyGroup : public ProxyGroupBase
60 /*========================== PUBLIC =================================*/
62 public:
64 enum
66 NOT_LOADED = 0,
67 LOAD_THREAD_RUNNING = 1,
68 LOAD_THREAD_FINISHED = 2,
69 LOADED = 4,
70 LOAD_ERROR = 100
73 /*---------------------------------------------------------------------*/
74 /*! \name Sync */
75 /*! \{ */
77 virtual void changed(ConstFieldMaskArg whichField,
78 UInt32 origin,
79 BitVector detail);
81 /*! \} */
82 /*---------------------------------------------------------------------*/
83 /*! \name Dump */
84 /*! \{ */
86 virtual void dump( UInt32 uiIndent = 0,
87 const BitVector bvFlags = 0) const;
89 /*! \} */
90 /*========================= PROTECTED ===============================*/
92 protected:
94 typedef ProxyGroupBase Inherited;
96 /*---------------------------------------------------------------------*/
97 /*! \name Constructors */
98 /*! \{ */
100 ProxyGroup(void);
101 ProxyGroup(const ProxyGroup &source);
103 /*! \} */
104 /*---------------------------------------------------------------------*/
105 /*! \name Destructors */
106 /*! \{ */
108 virtual ~ProxyGroup(void);
110 /*! \} */
111 /*---------------------------------------------------------------------*/
112 /*! \name Draw */
113 /*! \{ */
115 Action::ResultE renderEnter(Action *action);
117 /*! \} */
118 /*---------------------------------------------------------------------*/
119 /*! \name NodeCore Specific */
120 /*! \{ */
122 virtual void resolveLinks(void);
124 /*! \} */
125 /*---------------------------------------------------------------------*/
126 /*! \name NodeCore Specific */
127 /*! \{ */
129 void adjustVolume(Volume & volume);
131 /*! \} */
132 /*---------------------------------------------------------------------*/
133 /*! \name loading */
134 /*! \{ */
136 void startLoading(void);
138 /*! \} */
139 /*========================== PRIVATE ================================*/
141 private:
143 friend class FieldContainer;
144 friend class ProxyGroupBase;
146 /*---------------------------------------------------------------------*/
147 /*! \name thread local */
148 /*! \{ */
150 NodeUnrecPtr _loadedRoot;
152 /*! \} */
153 /*---------------------------------------------------------------------*/
154 /*! \name Init */
155 /*! \{ */
157 static void initMethod(InitPhase ePhase);
159 /*! \} */
161 /*---------------------------------------------------------------------*/
162 /*! \name load thread */
163 /*! \{ */
165 static Thread *_loadThread;
166 static std::queue<ProxyGroupUnrecPtr> _loadQueue;
167 static Lock *_loadLock;
169 static void loadProc(void *);
171 /*! \} */
172 /*---------------------------------------------------------------------*/
174 /*!\brief prohibit default function (move to 'public' if needed) */
175 void operator =(const ProxyGroup &source);
178 typedef ProxyGroup *ProxyGroupP;
180 OSG_END_NAMESPACE
182 #include "OSGProxyGroupBase.inl"
183 #include "OSGProxyGroup.inl"
185 #endif /* _OSGPROXYGROUP_H_ */