Visualization Library 2.1.0

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes | List of all members
vl::ref< T > Class Template Reference

The ref<> class is used to reference-count an Object. More...

#include <Object.hpp>

Public Member Functions

 ref (const ref &other)
 
 ref (const T *object=NULL)
 
template<class T2 >
 ref (const ref< T2 > &other)
 
 ~ref ()
 
refoperator= (const ref &other)
 
refoperator= (const T *other)
 
template<class T2 >
refoperator= (const ref< T2 > &other)
 
void swap (ref &other)
 
T * get_writable () const
 This is mainly useful when using ref<> with std::map, std::set, etc. More...
 
const T * get () const
 
const T * operator-> () const
 
const T & operator* () const
 
T * get ()
 
T * operator-> ()
 
T & operator* ()
 
bool operator< (const ref &other) const
 
 operator bool () const
 

Protected Attributes

T * mObject
 

Detailed Description

template<class T>
class vl::ref< T >

The ref<> class is used to reference-count an Object.

When the last ref<> that points to an Object is deallocated also the pointed Object is deallocated.

Note
IMPORTANT: assigning to a ref<> 'washes aways' the constness of an object.

Definition at line 55 of file Object.hpp.

Constructor & Destructor Documentation

◆ ref() [1/3]

template<class T>
vl::ref< T >::ref ( const ref< T > &  other)
inline

Definition at line 59 of file Object.hpp.

◆ ref() [2/3]

template<class T>
vl::ref< T >::ref ( const T *  object = NULL)
inline

Definition at line 65 of file Object.hpp.

◆ ref() [3/3]

template<class T>
template<class T2 >
vl::ref< T >::ref ( const ref< T2 > &  other)
inline

Definition at line 72 of file Object.hpp.

◆ ~ref()

template<class T>
vl::ref< T >::~ref ( )
inline

Definition at line 78 of file Object.hpp.

Member Function Documentation

◆ get() [1/2]

template<class T>
const T* vl::ref< T >::get ( ) const
inline

Definition at line 128 of file Object.hpp.

Referenced by vl::FontManager::acquireFont(), vl::ActorTreeAbstract::addActor(), vl::Molecule::addBond(), vl::Molecule::atomsStyle(), vl::Molecule::ballAndStickStyle(), vl::DaeLoader::bindMaterials(), vl::ActorKdTree::child(), vl::VectorGraphics::clearColor(), vl::VectorGraphics::clearStencil(), vl::MemoryDirectory::clone(), vl::Geometry::colorizePrimitives(), vl::VolumePlot::compute(), vl::Geometry::computeNormals(), vl::Geometry::convertDrawCallToDrawArrays(), vl::createCubemap(), vl::EdgeRenderer::declareActor(), vl::VectorGraphics::drawActorCopy(), vl::VectorGraphics::drawLineLoop(), vl::VectorGraphics::drawLines(), vl::VectorGraphics::drawLineStrip(), vl::VectorGraphics::drawPoints(), vl::VectorGraphics::drawText(), vlX::VLXClassWrapper_Effect::exportEffect(), vlX::VLXClassWrapper_ResourceDatabase::exportResourceDatabase(), vlX::VLXClassWrapper_Shader::exportShader(), vlX::VLXClassWrapper_Uniform::exportUniform(), vlX::VLXSerializer::exportVLX(), vlX::VLXClassWrapper_Array::exportVLX(), vl::ZippedFile::extract(), vl::AdjacencyExtractor::extract(), vl::EdgeExtractor::extractEdges(), vl::Extrusion::extrude(), vl::Extrusions::extrude(), vl::VectorGraphics::fillPolygon(), vl::VectorGraphics::fillQuad(), vl::VectorGraphics::fillQuads(), vl::VectorGraphics::fillQuadStrip(), vl::VectorGraphics::fillTriangleFan(), vl::VectorGraphics::fillTriangles(), vl::VectorGraphics::fillTriangleStrip(), vl::Molecule::generateAtomLabel(), vl::Molecule::generateAtomLabels(), vl::EdgeExtractor::generateEdgeGeometry(), vl::DaeLoader::generateGeometry(), vl::Molecule::generateRings(), vl::DaeLoader::getSource(), vl::UniformSet::gocUniform(), vlX::VLXClassWrapper_Array::importVLX(), vlX::VLXSerializer::importVLX(), vlX::VLXClassWrapper_Geometry::importVLX(), vlX::VLXClassWrapper_DrawCall::importVLX(), vlX::VLXClassWrapper_PatchParameter::importVLX(), vlX::VLXClassWrapper_ResourceDatabase::importVLX(), vlX::VLXClassWrapper_Uniform::importVLX(), vlX::VLXClassWrapper_Shader::importVLX(), vlX::VLXClassWrapper_LODEvaluator::importVLX(), vlX::VLXClassWrapper_Effect::importVLX(), vlX::VLXClassWrapper_Actor::importVLX(), vlX::VLXClassWrapper_Camera::importVLX(), vlX::VLXClassWrapper_Viewport::importVLX(), vlX::VLXClassWrapper_Transform::importVLX(), vlX::VLXClassWrapper_Light::importVLX(), vlX::VLXClassWrapper_ClipPlane::importVLX(), vlX::VLXClassWrapper_GLSLProgram::importVLX(), vlX::VLXClassWrapper_GLSLShader::importVLX(), vlX::VLXClassWrapper_VertexAttrib::importVLX(), vlX::VLXClassWrapper_Color::importVLX(), vlX::VLXClassWrapper_SecondaryColor::importVLX(), vlX::VLXClassWrapper_Normal::importVLX(), vlX::VLXClassWrapper_Material::importVLX(), vlX::VLXClassWrapper_ActorEventCallback::importVLX(), vlX::VLXClassWrapper_Texture::importVLX(), vlX::VLXClassWrapper_TexParameter::importVLX(), vlX::VLXClassWrapper_TextureImageUnit::importVLX(), vl::DrawArrays::indexIterator(), vl::MultiDrawElements< ArrayUShort1 >::indexIterator(), vl::DrawRangeElements< ArrayUShort1 >::indexIterator(), vl::DrawElements< ArrayUShort1 >::indexIterator(), vl::Terrain::init(), vl::ZippedDirectory::init(), vl::Applet::initialize(), vl::VisualizationLibrary::isCoreInitialized(), vlX::isVLB(), vlX::isVLT(), vl::DaeLoader::load(), vl::LoadWriterDae::load(), vl::load3DS(), vl::loadAC3D(), vl::STLLoader::loadAscii(), vl::STLLoader::loadBinary(), vl::loadBMP(), vl::loadCubemap(), vl::loadDAT(), vl::loadDDS(), vl::loadDICOM(), vl::loadImage(), vl::loadJPG(), vl::loadMD2(), vl::loadMHD(), vl::loadMOL2(), vl::loadOBJ(), vl::ObjLoader::loadOBJ(), vl::loadPLY(), vl::PlyLoader::loadPly(), vl::loadPNG(), vl::LoadWriterManager::loadResource(), vl::loadSTL(), vl::String::loadText(), vl::loadTGA(), vl::loadTIFF(), vlX::loadVLB(), vlX::VLXSerializer::loadVLB(), vlX::loadVLT(), vlX::VLXSerializer::loadVLT(), main(), vl::makeBox(), vl::makeCapsule(), vl::makeCircle(), vl::makeCone(), vl::makeCylinder(), vl::makeGrid(), vl::makeIcosahedron(), vl::makeIcosphere(), vl::makePoints(), vl::makePyramid(), makeScales(), vl::makeTeapot(), vl::makeTorus(), vl::makeUVSphere(), vl::MemoryDirectory::memoryFile(), vl::Geometry::mergeDrawCallsWithMultiDrawElements(), vl::Geometry::mergeDrawCallsWithPrimitiveRestart(), vl::Geometry::mergeDrawCallsWithTriangles(), vl::Geometry::mergeTriangleStrips(), vl::ResourceDatabase::next(), vl::SlicedVolume::onActorRenderStarted(), vl::GZipCodec::open(), vl::operator!=(), vl::ref< vl::Dae::Mesh >::operator=(), vl::ZippedFile::operator=(), vl::operator==(), vlX::VisitorExportToVLB::outputFile(), vl::PolygonSimplifier::outputSimplifiedGeometry(), vlX::ParserVLT::parse(), vlX::ParserVLB::parse(), vl::DaeLoader::parseGeometry(), vlX::ParserVLT::parseList(), vl::DaeLoader::parseNode(), vlX::ParserVLT::parseStructure(), vl::VectorGraphics::popScissor(), vl::Text::rawboundingRect(), vl::CoreText::rawboundingRect(), vl::RaycastVolume::RaycastVolume(), vl::DoubleVertexRemover::removeDoubles(), vl::EdgeRenderer::renderLines(), vl::SceneManagerPortals::renderPortal(), vl::EdgeRenderer::renderSolids(), vl::saveImage(), vl::saveJPG(), vl::savePNG(), vl::saveTGA(), vl::saveTIFF(), vlX::saveVLB(), vlX::VLXSerializer::saveVLB(), vlX::saveVLT(), vlX::VLXSerializer::saveVLT(), vl::Geometry::setColorArray(), vl::VolumePlot::setupLabels(), vl::DaeLoader::setupLights(), vl::ShaderNode::shader(), vl::RenderQueue::sort(), vl::Molecule::sticksStyle(), vl::TriangleStripGenerator::stripfy(), vl::Tessellator::tessellateGeometry(), vl::Texture::Texture(), vl::DrawArrays::triangleIterator(), vl::MultiDrawElements< ArrayUShort1 >::triangleIterator(), vl::DrawRangeElements< ArrayUShort1 >::triangleIterator(), vl::DrawElements< ArrayUShort1 >::triangleIterator(), vl::BezierSurface::updateBezierSurface(), vl::Molecule::wireframeStyle(), vl::ZippedDirectory::ZippedDirectory(), and vl::ZippedDirectory::zippedFile().

◆ get() [2/2]

template<class T>
T* vl::ref< T >::get ( )
inline

Definition at line 132 of file Object.hpp.

◆ get_writable()

template<class T>
T* vl::ref< T >::get_writable ( ) const
inline

This is mainly useful when using ref<> with std::map, std::set, etc.

Definition at line 126 of file Object.hpp.

◆ operator bool()

template<class T>
vl::ref< T >::operator bool ( ) const
inline

Definition at line 138 of file Object.hpp.

◆ operator*() [1/2]

template<class T>
const T& vl::ref< T >::operator* ( ) const
inline

Definition at line 130 of file Object.hpp.

◆ operator*() [2/2]

template<class T>
T& vl::ref< T >::operator* ( )
inline

Definition at line 134 of file Object.hpp.

◆ operator->() [1/2]

template<class T>
const T* vl::ref< T >::operator-> ( ) const
inline

Definition at line 129 of file Object.hpp.

◆ operator->() [2/2]

template<class T>
T* vl::ref< T >::operator-> ( )
inline

Definition at line 133 of file Object.hpp.

◆ operator<()

template<class T>
bool vl::ref< T >::operator< ( const ref< T > &  other) const
inline

Definition at line 136 of file Object.hpp.

◆ operator=() [1/3]

template<class T>
ref& vl::ref< T >::operator= ( const ref< T > &  other)
inline

Definition at line 86 of file Object.hpp.

◆ operator=() [2/3]

template<class T>
ref& vl::ref< T >::operator= ( const T *  other)
inline

Definition at line 97 of file Object.hpp.

◆ operator=() [3/3]

template<class T>
template<class T2 >
ref& vl::ref< T >::operator= ( const ref< T2 > &  other)
inline

Definition at line 108 of file Object.hpp.

◆ swap()

template<class T>
void vl::ref< T >::swap ( ref< T > &  other)
inline

Definition at line 118 of file Object.hpp.

Member Data Documentation

◆ mObject

template<class T>
T* vl::ref< T >::mObject
protected

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