14#ifndef OSG_OPERATIONTHREAD
15#define OSG_OPERATIONTHREAD 1
20#include <OpenThreads/Thread>
21#include <OpenThreads/Barrier>
22#include <OpenThreads/Condition>
23#include <OpenThreads/Block>
45 OpenThreads::BlockCount(blockCount) {}
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
OperationThread OperationsThread
Definition OperationThread:216
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for observed objects, that automatically set pointers to them to null when they are del...
Definition observer_ptr:39
RefBlock()
Definition OperationThread:34
RefBlockCount(unsigned blockCount)
Definition OperationThread:43
Base class for implementing graphics operations.
Definition OperationThread:51
virtual void operator()(Object *)=0
Do the actual task of this operation.
void setKeep(bool keep)
Set whether the operation should be kept once its been applied.
Definition OperationThread:66
bool getKeep() const
Get whether the operation should be kept once its been applied.
Definition OperationThread:69
const std::string & getName() const
Get the human readable name of the operation.
Definition OperationThread:63
bool _keep
Definition OperationThread:85
Operation(const std::string &name, bool keep)
Definition OperationThread:54
std::string _name
Definition OperationThread:84
void setName(const std::string &name)
Set the human readable name of the operation.
Definition OperationThread:60
virtual void release()
if this operation is a barrier then release it.
Definition OperationThread:72
Operation()
Definition OperationThread:79
virtual ~Operation()
Definition OperationThread:82
Definition OperationThread:91
osg::ref_ptr< Operation > getNextOperation(bool blockIfEmpty=false)
Get the next operation from the operation queue.
virtual ~OperationQueue()
OperationThreads _operationThreads
Definition OperationThread:149
unsigned int getNumOperationsInQueue()
Return the num of pending operations that are sitting in the OperationQueue.
void addOperationThread(OperationThread *thread)
Operations::iterator _currentOperationIterator
Definition OperationThread:147
void removeOperationThread(OperationThread *thread)
void releaseOperationsBlock()
Release operations block that is used to block threads that are waiting on an empty operations queue.
void removeAllOperations()
Remove all operations from OperationQueue.
const OperationThreads & getOperationThreads() const
Get the set of OperationThreads that are sharing this OperationQueue.
Definition OperationThread:131
OpenThreads::Mutex _operationsMutex
Definition OperationThread:144
bool empty()
Return true if the operation queue is empty.
void runOperations(Object *callingObject=0)
Run the operations.
std::set< OperationThread * > OperationThreads
Definition OperationThread:128
friend class OperationThread
Definition OperationThread:137
osg::ref_ptr< osg::RefBlock > _operationsBlock
Definition OperationThread:145
Operations _operations
Definition OperationThread:146
void remove(const std::string &name)
Remove named operation from OperationQueue.
void releaseAllOperations()
Call release on all operations.
std::list< osg::ref_ptr< Operation > > Operations
Definition OperationThread:142
void remove(Operation *operation)
Remove operation from OperationQueue.
void add(Operation *operation)
Add operation to end of OperationQueue, this will be executed by the operation thread once this opera...
OperationThread is a helper class for running Operation within a single thread.
Definition OperationThread:154
OperationQueue * getOperationQueue()
Get the OperationQueue.
Definition OperationThread:169
void setParent(Object *parent)
Definition OperationThread:158
const Object * getParent() const
Definition OperationThread:162
void remove(Operation *operation)
Remove operation from OperationQueue.
osg::ref_ptr< OperationQueue > _operationQueue
Definition OperationThread:211
osg::ref_ptr< Operation > _currentOperation
Definition OperationThread:212
const OperationQueue * getOperationQueue() const
Get the const OperationQueue.
Definition OperationThread:172
observer_ptr< Object > _parent
Definition OperationThread:206
OpenThreads::Mutex _threadMutex
Definition OperationThread:210
bool getDone() const
Definition OperationThread:197
void setOperationQueue(OperationQueue *opq)
Set the OperationQueue.
void removeAllOperations()
Remove all operations from OperationQueue.
Object * getParent()
Definition OperationThread:160
virtual ~OperationThread()
void add(Operation *operation)
Add operation to end of OperationQueue, this will be executed by the graphics thread once this operat...
virtual int cancel()
Cancel this graphics thread.
OpenThreads::Atomic _done
Definition OperationThread:208
osg::ref_ptr< Operation > getCurrentOperation()
Get the operation currently being run.
Definition OperationThread:190
virtual void run()
Run does the opertion thread run loop.
void remove(const std::string &name)
Remove named operation from OperationQueue.
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Base class for providing reference counted objects.
Definition Referenced:44
#define OSG_EXPORT
Definition Export:39