Qt 4.8
Public Functions | Properties | Friends | List of all members
QGLSharedResourceGuard Class Reference

#include <qgl_p.h>

Public Functions

const QGLContextcontext () const
 
GLuint id () const
 
 QGLSharedResourceGuard (const QGLContext *context)
 
 QGLSharedResourceGuard (const QGLContext *context, GLuint id)
 
void setId (GLuint id)
 
 ~QGLSharedResourceGuard ()
 
void setContext (const QGLContext *context)
 

Properties

QGLContextGroupm_group
 
GLuint m_id
 
QGLSharedResourceGuardm_next
 
QGLSharedResourceGuardm_prev
 

Friends

class QGLContextGroup
 

Detailed Description

Definition at line 858 of file qgl_p.h.

Constructors and Destructors

◆ QGLSharedResourceGuard() [1/2]

QGLSharedResourceGuard::QGLSharedResourceGuard ( const QGLContext context)
inline

Definition at line 861 of file qgl_p.h.

862  : m_group(0), m_id(0), m_next(0), m_prev(0)
863  {
864  setContext(context);
865  }
QGLSharedResourceGuard * m_prev
Definition: qgl_p.h:894
QGLContextGroup * m_group
Definition: qgl_p.h:891
void setContext(const QGLContext *context)
Definition: qgl.cpp:5983
QGLSharedResourceGuard * m_next
Definition: qgl_p.h:893

◆ QGLSharedResourceGuard() [2/2]

QGLSharedResourceGuard::QGLSharedResourceGuard ( const QGLContext context,
GLuint  id 
)
inline

Definition at line 866 of file qgl_p.h.

867  : m_group(0), m_id(id), m_next(0), m_prev(0)
868  {
869  setContext(context);
870  }
QGLSharedResourceGuard * m_prev
Definition: qgl_p.h:894
QGLContextGroup * m_group
Definition: qgl_p.h:891
void setContext(const QGLContext *context)
Definition: qgl.cpp:5983
QGLSharedResourceGuard * m_next
Definition: qgl_p.h:893

◆ ~QGLSharedResourceGuard()

QGLSharedResourceGuard::~QGLSharedResourceGuard ( )

Definition at line 5977 of file qgl.cpp.

5978 {
5979  if (m_group)
5980  m_group->removeGuard(this);
5981 }
QGLContextGroup * m_group
Definition: qgl_p.h:891
void removeGuard(QGLSharedResourceGuard *guard)
Definition: qgl.cpp:1706

Functions

◆ context()

const QGLContext* QGLSharedResourceGuard::context ( ) const
inline

Definition at line 873 of file qgl_p.h.

Referenced by QGLShaderPrivate::create(), QGLEngineSharedShaders::findProgramInCache(), and QGLShaderPrivate::~QGLShaderPrivate().

874  {
875  return m_group ? m_group->context() : 0;
876  }
QGLContextGroup * m_group
Definition: qgl_p.h:891
const QGLContext * context() const
Definition: qgl_p.h:252

◆ id()

GLuint QGLSharedResourceGuard::id ( ) const
inline

◆ setContext()

void QGLSharedResourceGuard::setContext ( const QGLContext context)

Definition at line 5983 of file qgl.cpp.

5984 {
5985  if (m_group)
5986  m_group->removeGuard(this);
5987  if (context) {
5989  m_group->addGuard(this);
5990  } else {
5991  m_group = 0;
5992  }
5993 }
void addGuard(QGLSharedResourceGuard *guard)
Definition: qgl.cpp:1697
QGLContextGroup * m_group
Definition: qgl_p.h:891
static QGLContextGroup * contextGroup(const QGLContext *ctx)
Definition: qgl_p.h:464
void removeGuard(QGLSharedResourceGuard *guard)
Definition: qgl.cpp:1706

◆ setId()

void QGLSharedResourceGuard::setId ( GLuint  id)
inline

Definition at line 885 of file qgl_p.h.

Referenced by QGLShaderPrivate::create(), and QGLShaderPrivate::deleteShader().

886  {
887  m_id = id;
888  }
GLuint id() const
Definition: qgl_p.h:880

Friends and Related Functions

◆ QGLContextGroup

friend class QGLContextGroup
friend

Definition at line 896 of file qgl_p.h.

Properties

◆ m_group

QGLContextGroup* QGLSharedResourceGuard::m_group
private

Definition at line 891 of file qgl_p.h.

◆ m_id

GLuint QGLSharedResourceGuard::m_id
private

Definition at line 892 of file qgl_p.h.

◆ m_next

QGLSharedResourceGuard* QGLSharedResourceGuard::m_next
private

Definition at line 893 of file qgl_p.h.

◆ m_prev

QGLSharedResourceGuard* QGLSharedResourceGuard::m_prev
private

Definition at line 894 of file qgl_p.h.


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