osg::Window::GLObject Class Reference

#include <OSGWindow.h>

List of all members.

Public Member Functions

 GLObject (GLObjectFunctor funct)
GLObjectFunctorgetFunctor (void)
void setFunctor (GLObjectFunctor funct)
UInt32 getLastValidate (void)
void setLastValidate (UInt32 val)
UInt32 getRefCounter (void)
UInt32 incRefCounter (void)
UInt32 decRefCounter (void)

Protected Attributes

GLObjectFunctor _functor
volatile UInt32 _refCounter
UInt32 _lastValidate


Detailed Description

Definition at line 298 of file OSGWindow.h.


Constructor & Destructor Documentation

osg::Window::GLObject::GLObject ( GLObjectFunctor  funct  )  [inline]

Definition at line 236 of file OSGWindow.inl.

00236                                                        :
00237             _functor(funct),
00238             _refCounter(0),
00239             _lastValidate(0)
00240 {
00241 }


Member Function Documentation

Window::GLObjectFunctor & osg::Window::GLObject::getFunctor ( void   )  [inline]

Definition at line 243 of file OSGWindow.inl.

References _functor.

00244 {
00245     return _functor;
00246 };

void osg::Window::GLObject::setFunctor ( GLObjectFunctor  funct  )  [inline]

Definition at line 248 of file OSGWindow.inl.

References _functor.

00249 {
00250     _functor = funct;
00251 };

UInt32 osg::Window::GLObject::getLastValidate ( void   )  [inline]

Definition at line 253 of file OSGWindow.inl.

References _lastValidate.

00254 {
00255     return _lastValidate;
00256 }

void osg::Window::GLObject::setLastValidate ( UInt32  val  )  [inline]

Definition at line 258 of file OSGWindow.inl.

References _lastValidate.

00259 {
00260     _lastValidate = val;
00261 }

UInt32 osg::Window::GLObject::getRefCounter ( void   )  [inline]

Definition at line 263 of file OSGWindow.inl.

References _refCounter.

Referenced by osg::Window::frameExit().

00264 {
00265     return _refCounter;
00266 }

UInt32 osg::Window::GLObject::incRefCounter ( void   )  [inline]

Definition at line 268 of file OSGWindow.inl.

References osg::Window::_GLObjectLock, _refCounter, osg::Lock::aquire(), osg::ThreadManager::getLock(), osg::Lock::release(), and osg::ThreadManager::the().

00269 {
00270     UInt32 val;
00271 
00272     if ( ! _GLObjectLock )
00273     {
00274         _GLObjectLock = ThreadManager::the()->getLock(NULL);
00275     }
00276 
00277     _GLObjectLock->aquire();
00278     val = _refCounter = _refCounter + 1;
00279     _GLObjectLock->release();
00280 
00281     return val;
00282 }

UInt32 osg::Window::GLObject::decRefCounter ( void   )  [inline]

Definition at line 284 of file OSGWindow.inl.

References osg::Window::_GLObjectLock, _refCounter, osg::Lock::aquire(), osg::ThreadManager::getLock(), osg::Lock::release(), and osg::ThreadManager::the().

Referenced by osg::Window::onDestroy().

00285 {
00286     UInt32 val;
00287 
00288     if(! _GLObjectLock)
00289     {
00290         _GLObjectLock = ThreadManager::the()->getLock(NULL);
00291     }
00292 
00293     _GLObjectLock->aquire();
00294     if(_refCounter)
00295         val = _refCounter = _refCounter - 1;
00296     else
00297         val = 0;
00298     _GLObjectLock->release();
00299 
00300     return val;
00301 }


Member Data Documentation

Definition at line 314 of file OSGWindow.h.

Referenced by getFunctor(), and setFunctor().

Definition at line 315 of file OSGWindow.h.

Referenced by decRefCounter(), getRefCounter(), and incRefCounter().

Definition at line 316 of file OSGWindow.h.

Referenced by getLastValidate(), and setLastValidate().


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

Generated on Mon Mar 17 11:25:15 2008 for OpenSG by  doxygen 1.5.5