osg::OperationThread Class Reference

`#include <OperationThread>`

Inheritance diagram for osg::OperationThread:

## Public Member Functions

| OperationThread ()
void | setParent (Object *parent)
Object * | getParent ()
const Object * | getParent () const
void | setOperationQueue (OperationQueue *opq)
OperationQueue * | getOperationQueue ()
const OperationQueue * | getOperationQueue () const
void | add (Operation *operation)
void | remove (Operation *operation)
void | remove (const std::string &name)
void | removeAllOperations ()
osg::ref_ptr< Operation > | getCurrentOperation ()
virtual void | run ()
void | setDone (bool done)
bool | getDone () const
virtual int | cancel ()
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
virtual void | setThreadSafeRefUnref (bool)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const
Public Member Functions inherited from OpenThreads::Thread
| Thread ()
virtual | ~Thread ()
size_t | getThreadId ()
size_t | getProcessId ()
int | start ()
int | startThread ()
int | testCancel ()
int | setSchedulePriority (ThreadPriority priority)
int | getSchedulePriority ()
int | setSchedulePolicy (ThreadPolicy policy)
int | getSchedulePolicy ()
int | setStackSize (size_t size)
size_t | getStackSize ()
void | printSchedulingInfo ()
int | detach ()
int | join ()
int | setCancelModeDisable ()
int | setCancelModeAsynchronous ()
int | setCancelModeDeferred ()
bool | isRunning ()
virtual void | cancelCleanup ()
void * | getImplementation ()
int | setProcessorAffinity (const Affinity &affinity)

## Protected Member Functions

virtual | ~OperationThread ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const

## Protected Attributes

observer_ptr< Object > | _parent
OpenThreads::Atomic | _done
OpenThreads::Mutex | _threadMutex
osg::ref_ptr< OperationQueue > | _operationQueue
osg::ref_ptr< Operation > | _currentOperation
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Additional Inherited Members

Public Types inherited from OpenThreads::Thread
enum | ThreadPriority { THREAD_PRIORITY_MAX , THREAD_PRIORITY_HIGH , THREAD_PRIORITY_NOMINAL , THREAD_PRIORITY_LOW , THREAD_PRIORITY_MIN , THREAD_PRIORITY_DEFAULT }
enum | ThreadPolicy { THREAD_SCHEDULE_FIFO , THREAD_SCHEDULE_ROUND_ROBIN , THREAD_SCHEDULE_TIME_SHARE , THREAD_SCHEDULE_DEFAULT }
Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()
Static Public Member Functions inherited from OpenThreads::Thread
static int | SetConcurrency (int concurrencyLevel)
static int | GetConcurrency ()
static Thread * | CurrentThread ()
static size_t | CurrentThreadId ()
static void | Init ()
static int | YieldCurrentThread ()
static ThreadPriority | GetMasterPriority ()
static int | microSleep (unsigned int microsec)

## Detailed Description

OperationThread is a helper class for running Operation within a single thread.

## Constructor & Destructor Documentation

## OperationThread()

osg::OperationThread::OperationThread | ( |  | ) |

## ~OperationThread()

virtual osg::OperationThread::~OperationThread | ( |  | ) |

protected virtual

## Member Function Documentation

## add()

void osg::OperationThread::add | ( | Operation * | operation | ) |

Add operation to end of OperationQueue, this will be executed by the graphics thread once this operation gets to the head of the queue.

## cancel()

virtual int osg::OperationThread::cancel | ( |  | ) |

virtual

Cancel this graphics thread.

Reimplemented from OpenThreads::Thread.

## getCurrentOperation()

osg::ref_ptr< Operation > osg::OperationThread::getCurrentOperation | ( |  | ) |

inline

Get the operation currently being run.

References _currentOperation.

## getDone()

bool osg::OperationThread::getDone | ( |  | ) | const

inline

References _done.

## getOperationQueue() [1/2]

OperationQueue * osg::OperationThread::getOperationQueue | ( |  | ) |

inline

Get the OperationQueue.

References _operationQueue.

## getOperationQueue() [2/2]

const OperationQueue * osg::OperationThread::getOperationQueue | ( |  | ) | const

inline

Get the const OperationQueue.

References _operationQueue.

## getParent() [1/2]

Object * osg::OperationThread::getParent | ( |  | ) |

inline

References _parent.

## getParent() [2/2]

const Object * osg::OperationThread::getParent | ( |  | ) | const

inline

References _parent.

## remove() [1/2]

void osg::OperationThread::remove | ( | const std::string & | name | ) |

Remove named operation from OperationQueue.

## remove() [2/2]

void osg::OperationThread::remove | ( | Operation * | operation | ) |

Remove operation from OperationQueue.

## removeAllOperations()

void osg::OperationThread::removeAllOperations | ( |  | ) |

Remove all operations from OperationQueue.

## run()

virtual void osg::OperationThread::run | ( |  | ) |

virtual

Run does the opertion thread run loop.

Implements OpenThreads::Thread.

Reimplemented in osg::GraphicsThread.

## setDone()

void osg::OperationThread::setDone | ( | bool | done | ) |

## setOperationQueue()

void osg::OperationThread::setOperationQueue | ( | OperationQueue * | opq | ) |

Set the OperationQueue.

## setParent()

void osg::OperationThread::setParent | ( | Object * | parent | ) |

inline

References _parent.

## Member Data Documentation

## _currentOperation

osg::ref_ptr<Operation> osg::OperationThread::_currentOperation

protected

Referenced by getCurrentOperation().

## _done

OpenThreads::Atomic osg::OperationThread::_done

protected

Referenced by getDone().

## _operationQueue

osg::ref_ptr<OperationQueue> osg::OperationThread::_operationQueue

protected

Referenced by getOperationQueue(), and getOperationQueue().

## _parent

observer_ptr<Object> osg::OperationThread::_parent

protected

Referenced by getParent(), getParent(), and setParent().

## _threadMutex

OpenThreads::Mutex osg::OperationThread::_threadMutex

protected

The documentation for this class was generated from the following file:

- OperationThread