OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
unrefqueue.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_COMPONENTS_UNREFQUEUE_H
2 #define OPENMW_COMPONENTS_UNREFQUEUE_H
3 
4 #include <osg/ref_ptr>
5 #include <osg/Referenced>
6 
7 namespace osg
8 {
9  class Object;
10 }
11 
12 namespace SceneUtil
13 {
14  class WorkQueue;
15  class UnrefWorkItem;
16 
19  class UnrefQueue : public osg::Referenced
20  {
21  public:
22  UnrefQueue();
23 
25  void push(const osg::Object* obj);
26 
29  void flush(SceneUtil::WorkQueue* workQueue);
30 
31  private:
32  osg::ref_ptr<UnrefWorkItem> mWorkItem;
33  };
34 
35 }
36 
37 #endif
A work queue that users can push work items onto, to be completed by one or more background threads...
Definition: workqueue.hpp:45
void flush(SceneUtil::WorkQueue *workQueue)
Definition: unrefqueue.cpp:38
void push(const osg::Object *obj)
Adds an object to the list of objects to be unreferenced. Call from the main thread.
Definition: unrefqueue.cpp:33
Handles unreferencing of objects through the WorkQueue. Typical use scenario would be the main thread...
Definition: unrefqueue.hpp:19
UnrefQueue()
Definition: unrefqueue.cpp:28
osg::ref_ptr< UnrefWorkItem > mWorkItem
Definition: unrefqueue.hpp:32