Visualization Library v1.0.3A 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. | |
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. | |
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. | |
template<class T > | |
size_t | count () const |
Don't use inside loops! Counts the number object of the specified type. | |
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]!). | |
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]!). | |
Protected Attributes | |
std::vector< ref< Object > > | mResources |
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.
vl::ResourceDatabase::ResourceDatabase | ( | ) | [inline] |
Definition at line 53 of file ResourceDatabase.hpp.
References VL_DEBUG_SET_OBJECT_NAME.
Definition at line 58 of file ResourceDatabase.hpp.
Referenced by vl::expandResourceDatabase(), vl::VLXClassWrapper_ResourceDatabase::exportResourceDatabase(), and vl::VLXClassWrapper_ResourceDatabase::importResourceDatabase().
Definition at line 60 of file ResourceDatabase.hpp.
T* vl::ResourceDatabase::next | ( | int & | cur_pos ) | const [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.
void vl::ResourceDatabase::get | ( | std::vector< ref< T > > & | resources, |
bool | clear_vector = true |
||
) | [inline] |
Returns all the objects of the specified type in the given vector.
Definition at line 80 of file ResourceDatabase.hpp.
Referenced by vl::VLXClassWrapper_ResourceDatabase::exportVLX(), vl::MorphingCallback::init(), vl::GeometryLoadCallback::operator()(), vl::LoadWriterTIFF::writeResource(), vl::LoadWriterTGA::writeResource(), vl::LoadWriterPNG::writeResource(), and vl::LoadWriterJPG::writeResource().
void vl::ResourceDatabase::extract | ( | std::vector< ref< T > > & | resources, |
bool | clear_vector = true |
||
) | [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.
size_t vl::ResourceDatabase::count | ( | ) | const [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::LoadWriterTGA::writeResource(), vl::LoadWriterPNG::writeResource(), and vl::LoadWriterJPG::writeResource().
const T* vl::ResourceDatabase::get | ( | int | j ) | const [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.
T* vl::ResourceDatabase::get | ( | int | j ) | [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.
std::vector< ref<Object> > vl::ResourceDatabase::mResources [protected] |
Definition at line 168 of file ResourceDatabase.hpp.