Visualization Library 2.0.0-b3

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(), vl::VLXClassWrapper_Effect::exportEffect(), vl::VLXClassWrapper_ResourceDatabase::exportResourceDatabase(), vl::VLXClassWrapper_Shader::exportShader(), vl::VLXClassWrapper_Uniform::exportUniform(), vl::VLXSerializer::exportVLX(), vl::VLXClassWrapper_Array::exportVLX(), vl::ZippedFile::extract(), vl::AdjacencyExtractor::extract(), vl::EdgeExtractor::extractEdges(), vl::Extrusion::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(), vl::VLXClassWrapper_Array::importVLX(), vl::VLXSerializer::importVLX(), vl::VLXClassWrapper_Geometry::importVLX(), vl::VLXClassWrapper_DrawCall::importVLX(), vl::VLXClassWrapper_PatchParameter::importVLX(), vl::VLXClassWrapper_ResourceDatabase::importVLX(), vl::VLXClassWrapper_Uniform::importVLX(), vl::VLXClassWrapper_Shader::importVLX(), vl::VLXClassWrapper_LODEvaluator::importVLX(), vl::VLXClassWrapper_Effect::importVLX(), vl::VLXClassWrapper_Actor::importVLX(), vl::VLXClassWrapper_Camera::importVLX(), vl::VLXClassWrapper_Viewport::importVLX(), vl::VLXClassWrapper_Transform::importVLX(), vl::VLXClassWrapper_Light::importVLX(), vl::VLXClassWrapper_ClipPlane::importVLX(), vl::VLXClassWrapper_GLSLProgram::importVLX(), vl::VLXClassWrapper_GLSLShader::importVLX(), vl::VLXClassWrapper_VertexAttrib::importVLX(), vl::VLXClassWrapper_Color::importVLX(), vl::VLXClassWrapper_SecondaryColor::importVLX(), vl::VLXClassWrapper_Normal::importVLX(), vl::VLXClassWrapper_Material::importVLX(), vl::VLXClassWrapper_ActorEventCallback::importVLX(), vl::VLXClassWrapper_Texture::importVLX(), vl::VLXClassWrapper_TexParameter::importVLX(), vl::VLXClassWrapper_TextureSampler::importVLX(), vl::DrawArrays::indexIterator(), vl::MultiDrawElements< ArrayUShort1 >::indexIterator(), vl::DrawRangeElements< ArrayUShort1 >::indexIterator(), vl::DrawElements< ArrayUShort1 >::indexIterator(), vl::Terrain::init(), vl::ZippedDirectory::init(), vl::VisualizationLibrary::initCore(), vl::Applet::initialize(), vl::isVLB(), vl::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(), vl::loadVLB(), vl::VLXSerializer::loadVLB(), vl::loadVLT(), vl::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==(), vl::PolygonSimplifier::outputSimplifiedGeometry(), vl::VLXParserVLT::parse(), vl::VLXParserVLB::parse(), vl::DaeLoader::parseGeometry(), vl::VLXParserVLT::parseList(), vl::DaeLoader::parseNode(), vl::VLXParserVLT::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(), vl::VLXSerializer::saveVLB(), vl::saveVLB(), vl::VLXSerializer::saveVLT(), vl::saveVLT(), vl::Geometry::setColorArray(), vl::setDefFontManager(), 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: