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 Attributes

vl::ResourceDatabase Class Reference

The ResourceDatabase class contains and manipulates a set of resources. More...

#include <ResourceDatabase.hpp>

Inheritance diagram for vl::ResourceDatabase:
vl::Object

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

vl::ResourceDatabase::ResourceDatabase (  ) [inline]

Definition at line 53 of file ResourceDatabase.hpp.

References VL_DEBUG_SET_OBJECT_NAME.


Member Function Documentation

const std::vector< ref<Object> >& vl::ResourceDatabase::resources (  ) const [inline]
std::vector< ref<Object> >& vl::ResourceDatabase::resources (  ) [inline]

Definition at line 60 of file ResourceDatabase.hpp.

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

template<class T >
void vl::ResourceDatabase::get ( std::vector< ref< T > > &  resources,
bool  clear_vector = true 
) [inline]
template<class T >
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.

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

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

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


Member Data Documentation

std::vector< ref<Object> > vl::ResourceDatabase::mResources [protected]

Definition at line 168 of file ResourceDatabase.hpp.


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

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.