Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
The base class for all the reference counted objects. More...
#include <Object.hpp>
Public Member Functions | |
| Object () | |
| Constructor. | |
| Object (const Object &other) | |
| Copy constructor: copies the name, ref count mutex and user data. | |
| Object & | operator= (const Object &other) |
| Copy operator: copies the object's name, ref count mutex and user data. | |
| const std::string & | objectName () const |
| The name of the object, by default set to the object's class name. | |
| void | setObjectName (const char *name) |
| The name of the object, by default set to the object's class name in debug builds. | |
| void | setRefCountMutex (IMutex *mutex) |
| The mutex used to protect the reference counting of an Object across multiple threads. | |
| IMutex * | refCountMutex () |
| The mutex used to protect the reference counting of an Object across multiple threads. | |
| const IMutex * | refCountMutex () const |
| The mutex used to protect the reference counting of an Object across multiple threads. | |
| int | referenceCount () const |
| Returns the number of references of an object. | |
| void | incReference () const |
| Increments the reference count of an object. | |
| void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. | |
| void | setAutomaticDelete (bool autodel_on) |
| If set to true the Object is deleted when its reference count reaches 0. | |
| bool | automaticDelete () const |
| If set to true the Object is deleted when its reference count reaches 0. | |
| template<class T > | |
| T * | as () |
| Casts an Object to the specified class. | |
| template<class T > | |
| const T * | as () const |
| Casts an Object to the specified class. | |
Protected Member Functions | |
| virtual | ~Object () |
Protected Attributes | |
| std::string | mObjectName |
| IMutex * | mRefCountMutex |
| int | mReferenceCount |
| bool | mAutomaticDelete |
The base class for all the reference counted objects.
See also vl::ref.
Definition at line 55 of file Object.hpp.
| vl::Object::Object | ( | ) | [inline] |
Constructor.
Definition at line 61 of file Object.hpp.
References NULL, and VL_DEBUG_SET_OBJECT_NAME.
| vl::Object::Object | ( | const Object & | other | ) | [inline] |
Copy constructor: copies the name, ref count mutex and user data.
Definition at line 78 of file Object.hpp.
References mObjectName, and mRefCountMutex.
| Object::~Object | ( | ) | [protected, virtual] |
Definition at line 45 of file Object.cpp.
References automaticDelete(), vl::Log::bug(), mObjectName, and mReferenceCount.
Copy operator: copies the object's name, ref count mutex and user data.
Definition at line 98 of file Object.hpp.
References mObjectName, and mRefCountMutex.
Referenced by vl::VLTTokenizer::getToken().
| const std::string& vl::Object::objectName | ( | ) | const [inline] |
The name of the object, by default set to the object's class name.
Definition at line 114 of file Object.hpp.
Referenced by vl::TextureSampler::apply(), vl::GLSLShader::compile(), vl::VLXClassWrapper_Actor::exportActor(), vl::VLXClassWrapper_Camera::exportCamera(), vl::VLXClassWrapper_DrawCall::exportDrawCallBase(), vl::VLXClassWrapper_Effect::exportEffect(), vl::VLXClassWrapper_GLSLProgram::exportGLSLProgram(), vl::VLXClassWrapper_Light::exportLight(), vl::VLXClassWrapper_Material::exportMaterial(), vl::VLXClassWrapper_Renderable::exportRenderable(), vl::VLXClassWrapper_ResourceDatabase::exportResourceDatabase(), vl::VLXClassWrapper_Shader::exportShader(), vl::VLXClassWrapper_Texture::exportTexture(), vl::VLXClassWrapper_Transform::exportTransform(), vl::VLXClassWrapper_VertexAttrib::exportVertexAttrib(), vl::VLXClassWrapper_Viewport::exportViewport(), vl::GLSLProgram::infoLog(), vl::MorphingCallback::init(), vl::GLSLProgram::linkProgram(), vl::DaeLoader::load(), vl::Image::print(), vl::GLSLProgram::programBinary(), and vl::GLSLProgram::useProgram().
| void vl::Object::setObjectName | ( | const char * | name | ) | [inline] |
The name of the object, by default set to the object's class name in debug builds.
Definition at line 117 of file Object.hpp.
Referenced by vl::Texture::createTexture(), vl::Image::Image(), vl::VLXClassWrapper_Actor::importActor(), vl::VLXClassWrapper_Camera::importCamera(), vl::VLXClassWrapper_DrawCall::importDrawCall(), vl::VLXClassWrapper_Effect::importEffect(), vl::VLXClassWrapper_GLSLProgram::importGLSLProgram(), vl::VLXClassWrapper_Light::importLight(), vl::VLXClassWrapper_Material::importMaterial(), vl::VLXClassWrapper_Renderable::importRenderable(), vl::VLXClassWrapper_ResourceDatabase::importResourceDatabase(), vl::VLXClassWrapper_Shader::importShader(), vl::VLXClassWrapper_Texture::importTexture(), vl::VLXClassWrapper_Transform::importTransform(), vl::VLXClassWrapper_VertexAttrib::importVertexAttrib(), vl::VLXClassWrapper_Viewport::importViewport(), vl::loadDDS(), and vl::GLSLShader::setSource().
| void vl::Object::setRefCountMutex | ( | IMutex * | mutex | ) | [inline] |
The mutex used to protect the reference counting of an Object across multiple threads.
Definition at line 120 of file Object.hpp.
| IMutex* vl::Object::refCountMutex | ( | ) | [inline] |
The mutex used to protect the reference counting of an Object across multiple threads.
Definition at line 123 of file Object.hpp.
| const IMutex* vl::Object::refCountMutex | ( | ) | const [inline] |
The mutex used to protect the reference counting of an Object across multiple threads.
Definition at line 126 of file Object.hpp.
| int vl::Object::referenceCount | ( | ) | const [inline] |
Returns the number of references of an object.
Definition at line 129 of file Object.hpp.
| void vl::Object::incReference | ( | ) | const [inline] |
Increments the reference count of an object.
Definition at line 135 of file Object.hpp.
| void vl::Object::decReference | ( | ) | [inline] |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0.
Definition at line 149 of file Object.hpp.
References vl::IMutex::lock(), vl::IMutex::unlock(), and VL_CHECK.
| void vl::Object::setAutomaticDelete | ( | bool | autodel_on | ) | [inline] |
If set to true the Object is deleted when its reference count reaches 0.
Definition at line 169 of file Object.hpp.
Referenced by vl::ActorTreeAbstract::ActorTreeAbstract(), vl::DrawPixels::DrawPixels(), vl::Geometry::Geometry(), vl::MarchingCubes::MarchingCubes(), vlMFC::MDIWindow::MDIWindow(), vlMFC::MFCWindow::MFCWindow(), vlQt4::Qt4Widget::Qt4Widget(), vlQt5::Qt5Widget::Qt5Widget(), vl::SceneManagerVectorGraphics::SceneManagerVectorGraphics(), vl::VectorGraphics::VectorGraphics(), and vlWX::WXGLCanvas::WXGLCanvas().
| bool vl::Object::automaticDelete | ( | ) | const [inline] |
If set to true the Object is deleted when its reference count reaches 0.
Definition at line 172 of file Object.hpp.
Referenced by ~Object().
| T* vl::Object::as | ( | ) | [inline] |
Casts an Object to the specified class.
Definition at line 176 of file Object.hpp.
Referenced by vl::PolygonSimplifier::collapse(), vl::expandResourceDatabase(), vl::VLXClassWrapper_Array::export_ArrayT(), vl::VLXClassWrapper_ActorEventCallback::exportActorEventCallback(), vl::VLXClassWrapper_DrawCall::exportDrawCall(), vl::VLXClassWrapper_LODEvaluator::exportLODEvaluator(), vl::VLXClassWrapper_TextureSampler::exportVLX(), vl::VLXClassWrapper_TexParameter::exportVLX(), vl::VLXClassWrapper_Texture::exportVLX(), vl::VLXClassWrapper_ActorEventCallback::exportVLX(), vl::VLXClassWrapper_Material::exportVLX(), vl::VLXClassWrapper_Normal::exportVLX(), vl::VLXClassWrapper_SecondaryColor::exportVLX(), vl::VLXClassWrapper_Color::exportVLX(), vl::VLXClassWrapper_VertexAttrib::exportVLX(), vl::VLXClassWrapper_GLSLShader::exportVLX(), vl::VLXClassWrapper_GLSLProgram::exportVLX(), vl::VLXClassWrapper_ClipPlane::exportVLX(), vl::VLXClassWrapper_Light::exportVLX(), vl::VLXClassWrapper_Transform::exportVLX(), vl::VLXClassWrapper_Viewport::exportVLX(), vl::VLXClassWrapper_Camera::exportVLX(), vl::VLXClassWrapper_Actor::exportVLX(), vl::VLXClassWrapper_Effect::exportVLX(), vl::VLXClassWrapper_LODEvaluator::exportVLX(), vl::VLXClassWrapper_Shader::exportVLX(), vl::VLXClassWrapper_Uniform::exportVLX(), vl::VLXClassWrapper_ResourceDatabase::exportVLX(), vl::VLXClassWrapper_PatchParameter::exportVLX(), vl::VLXClassWrapper_DrawCall::exportVLX(), vl::VLXClassWrapper_VertexAttribInfo::exportVLX(), vl::VLXClassWrapper_Geometry::exportVLX(), vl::Geometry::flipNormals(), vl::VLXClassWrapper_ActorEventCallback::importActorEventCallback(), vl::VLXClassWrapper_DrawCall::importDrawCall(), vl::VLXClassWrapper_GLSLProgram::importGLSLProgram(), vl::VLXClassWrapper_LODEvaluator::importLODEvaluator(), vl::VLXClassWrapper_Transform::importTransform(), vl::Applet::initialize(), vl::DaeLoader::load(), vl::DepthSortCallback::onActorRenderStarted(), vl::VLXValue::setArray(), and vl::Geometry::sortVertices().
| const T* vl::Object::as | ( | ) | const [inline] |
Casts an Object to the specified class.
Definition at line 180 of file Object.hpp.
std::string vl::Object::mObjectName [protected] |
Definition at line 194 of file Object.hpp.
Referenced by vl::GLSLFragmentShader::GLSLFragmentShader(), vl::GLSLGeometryShader::GLSLGeometryShader(), vl::GLSLTessControlShader::GLSLTessControlShader(), vl::GLSLTessEvaluationShader::GLSLTessEvaluationShader(), vl::GLSLVertexShader::GLSLVertexShader(), Object(), operator=(), vl::Image::reset(), and ~Object().
IMutex* vl::Object::mRefCountMutex [protected] |
Definition at line 196 of file Object.hpp.
Referenced by Object(), and operator=().
int vl::Object::mReferenceCount [mutable, protected] |
Definition at line 197 of file Object.hpp.
Referenced by ~Object().
bool vl::Object::mAutomaticDelete [protected] |
Definition at line 198 of file Object.hpp.