Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Protected Attributes

vl::Object Class Reference

The base class for all the reference counted objects. More...

#include <Object.hpp>

Inheritance diagram for vl::Object:
vl::BufferedStream< char, 128 *1024 > vl::BufferedStream< unsigned char, 128 *1024 > vl::Collection< Actor > vl::Collection< Shader > vl::Actor vl::ActorEventCallback vl::ActorTreeAbstract vl::ArrayAbstract vl::Atom vl::AttribInfo vl::BezierPatch vl::Bond vl::Buffer vl::BufferedStream< Element_Type, Chunk_Size > vl::Camera vl::CatmullRomInterpolator< T > vl::Collection< T > vl::Dae::ColorOrTexture vl::Dae::Effect vl::Dae::Input vl::Dae::Material vl::Dae::Mesh vl::Dae::NewParam vl::Dae::Node vl::Dae::Primitive vl::Dae::Sampler2D vl::Dae::Source vl::Dae::Surface vl::Dae::TechniqueCOMMON vl::DrawCall vl::DrawPixels::Pixels vl::EdgeExtractor vl::Effect vl::EnableSet vl::Extrusion vl::FBOAbstractAttachment vl::FileSystem vl::Font vl::FontManager vl::Framebuffer vl::Frustum vl::GlobalSettings vl::GLSLShader vl::Glyph vl::Image vl::IndexIterator vl::IndexIteratorAbstract vl::Interpolator vl::KeyValues vl::LinearInterpolator< T > vl::LoadCallback vl::LoadWriterDae::LoadOptions vl::LoadWriterManager vl::LODEvaluator vl::Log vl::MersenneTwister vl::Molecule vl::NaryQuickMap< KeyType, ValueType, MaxMapType > vl::ObjMaterial vl::ObjMesh vl::OpenGLContext vl::PatchParameter vl::Plane vl::PlyLoader::PlyElement vl::PlyLoader::PlyPropertyAbstract vl::PolygonSimplifier vl::Portal vl::ProjViewTransfCallback vl::Random vl::RayIntersection vl::RayIntersector vl::Renderable vl::RendererAbstract vl::RenderEventCallback vl::RenderingAbstract vl::RenderQueue vl::RenderQueueSorter vl::RenderState vl::RenderStateSet vl::RenderToken vl::ResourceDatabase vl::ResourceLoadWriter vl::SceneManager vl::Scissor vl::Sector vl::Sector::VisibilityCallback vl::Shader vl::ShaderAnimator vl::ShaderNode vl::StereoCamera vl::Tessellator vl::TexParameter vl::Texture vl::Texture::SetupParams vl::Time vl::Transform vl::TriangleIteratorAbstract vl::UIEventListener vl::Uniform vl::UniformInfo vl::UniformSet vl::VectorGraphics vl::VertexAttribInfo vl::VertexMapper vl::Viewport vl::VirtualDirectory vl::VirtualFile vl::VLXClassWrapper vl::VLXParser vl::VLXRegistry vl::VLXSerializer vl::VLXTaggedValue vl::VLXVisitor vl::Volume vl::VolumeInfo vl::VolumePlot vl::WriteCallback vl::ZippedFileInfo

List of all members.

Public Member Functions

 Object ()
 Constructor.
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data.
Objectoperator= (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.
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads.
const IMutexrefCountMutex () 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
IMutexmRefCountMutex
int mReferenceCount
bool mAutomaticDelete

Detailed Description

The base class for all the reference counted objects.

See also vl::ref.

Definition at line 55 of file Object.hpp.


Constructor & Destructor Documentation

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.


Member Function Documentation

Object& vl::Object::operator= ( const Object other ) [inline]

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]
void vl::Object::setObjectName ( const char *  name ) [inline]
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]
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().

template<class T >
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().

template<class T >
const T* vl::Object::as (  ) const [inline]

Casts an Object to the specified class.

Definition at line 180 of file Object.hpp.


Member Data Documentation

std::string vl::Object::mObjectName [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.


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:07.
Permission is granted to use this page to write and publish articles regarding Visualization Library.