Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The ResourceDatabase class contains and manipulates a set of resources. More...
#include <ResourceDatabase.hpp>
Public Member Functions | |
ResourceDatabase () | |
const std::vector< ref< Object > > & | resources () const |
std::vector< ref< Object > > & | resources () |
template<class T > | |
T * | next (int &cur_pos) const |
Starts to look for the next object of the specified type from the given position. More... | |
template<class T > | |
void | get (std::vector< ref< T > > &resources, bool clear_vector=true) |
Returns all the objects of the specified type in the given vector. More... | |
template<class T > | |
void | extract (std::vector< ref< T > > &resources, bool clear_vector=true) |
Returns all the objects of the specified type in the given vector and removes them from the ResourceDatabase. More... | |
template<class T > | |
size_t | count () const |
Don't use inside loops! Counts the number object of the specified type. More... | |
template<class T > | |
const T * | get (int j) const |
Don't use inside loops! Returns the j-th object of the specified type (which is different from resources() [j]!). More... | |
template<class T > | |
T * | get (int j) |
Don't use inside loops! Returns the j-th object of the specified type (which is different from resources() [j]!). More... | |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Protected Attributes | |
std::vector< ref< Object > > | mResources |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
The ResourceDatabase class contains and manipulates a set of resources.
It works with any kind of resources derived from vl::Object, even user-customized ones.
Definition at line 48 of file ResourceDatabase.hpp.
|
inline |
Definition at line 53 of file ResourceDatabase.hpp.
|
inline |
Don't use inside loops! Counts the number object of the specified type.
Definition at line 117 of file ResourceDatabase.hpp.
Referenced by vl::MorphingCallback::init(), vl::LoadWriterTIFF::writeResource(), vl::LoadWriterPNG::writeResource(), vl::LoadWriterTGA::writeResource(), and vl::LoadWriterJPG::writeResource().
|
inline |
Returns all the objects of the specified type in the given vector and removes them from the ResourceDatabase.
Definition at line 95 of file ResourceDatabase.hpp.
|
inline |
Returns all the objects of the specified type in the given vector.
Definition at line 80 of file ResourceDatabase.hpp.
Referenced by vlX::VLXClassWrapper_ResourceDatabase::exportVLX(), vl::MorphingCallback::init(), vl::loadImage(), vl::GeometryLoadCallback::operator()(), vl::LoadWriterTIFF::writeResource(), vl::LoadWriterTGA::writeResource(), vl::LoadWriterPNG::writeResource(), and vl::LoadWriterJPG::writeResource().
|
inline |
Don't use inside loops! Returns the j-th object of the specified type (which is different from resources()
[j]!).
Definition at line 131 of file ResourceDatabase.hpp.
References NULL.
|
inline |
Don't use inside loops! Returns the j-th object of the specified type (which is different from resources()
[j]!).
Definition at line 150 of file ResourceDatabase.hpp.
References NULL.
|
inline |
Starts to look for the next object of the specified type from the given position.
Definition at line 64 of file ResourceDatabase.hpp.
References vl::ref< T >::get(), and NULL.
Definition at line 58 of file ResourceDatabase.hpp.
Referenced by vl::expandResourceDatabase(), vlX::VLXClassWrapper_ResourceDatabase::exportResourceDatabase(), vlX::VLXClassWrapper_ResourceDatabase::importResourceDatabase(), vl::load3DS(), vl::loadAC3D(), vl::STLLoader::loadAscii(), vl::STLLoader::loadBinary(), vl::loadMD2(), vl::ObjLoader::loadOBJ(), vl::PlyLoader::loadPly(), main(), and vl::saveImage().
Definition at line 60 of file ResourceDatabase.hpp.
Definition at line 168 of file ResourceDatabase.hpp.
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:11.
© Copyright Michele Bosi. All rights reserved.