# Visualization Library

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

[Home] [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:

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]`

Definition at line 58 of file ResourceDatabase.hpp.

Referenced by vl::expandResourceDatabase(), vl::VLXClassWrapper_ResourceDatabase::exportResourceDatabase(), and vl::VLXClassWrapper_ResourceDatabase::importResourceDatabase().

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]`

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().

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:

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlCore/ResourceDatabase.hpp

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:44:14.
Permission is granted to use this page to write and publish articles regarding Visualization Library.