# Visualization Library

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

[Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::Collection< T > Class Template Reference

Reference counted container that encapsulates the base functionalites of an std::vector<>. More...

`#include <Collection.hpp>`

Inheritance diagram for vl::Collection< T >:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| Collection (const std::vector< ref< T > > &vector)
| Collection ()
Collection & | operator= (const std::vector< ref< T > > &vector)
| operator std::vector< ref< T > > () const
void | push_back (T *data)
void | pop_back ()
void | resize (int size)
int | size () const
bool | empty () const
void | clear ()
const T * | back () const
T * | back ()
void | reserve (int capacity)
int | capacity () const
const ref< T > & | operator[] (int i) const
ref< T > & | operator[] (int i)
const T * | at (int i) const
T * | at (int i)
void | swap (Collection &other)
void | sort ()
int | find (T *obj) const
void | shrink ()
void | push_back (const Collection< T > &objs)
void | insert (int start, const Collection< T > &objs)
void | set (const Collection< T > &objs)
void | erase (int start, int count)
void | set (int index, T *obj)
void | insert (int index, T *obj)
void | erase (const T *data)
void | eraseAt (int index)
const std::vector< ref< T > > & | vector () const
std::vector< ref< T > > & | vector ()

## Static Protected Member Functions

static bool | less (const ref< T > &a, const ref< T > &b)

## Protected Attributes

std::vector< ref< T > > | mVector

## Detailed Description

### template<typename T>
class vl::Collection< T >

Reference counted container that encapsulates the base functionalites of an std::vector<>.

This container can be used only with objects whose classes derive from Object.

## Constructor & Destructor Documentation

template<typename T>

vl::Collection< T >::Collection | ( | const std::vector< ref< T > > & | vector | ) | `[inline]`

template<typename T>

vl::Collection< T >::Collection | ( |  | ) | `[inline]`

## Member Function Documentation

template<typename T>

virtual const char* vl::Collection< T >::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

Reimplemented in vl::ShaderSequence.

template<typename T>

Collection& vl::Collection< T >::operator= | ( | const std::vector< ref< T > > & | vector | ) | `[inline]`

template<typename T>

vl::Collection< T >::operator std::vector< ref< T > > | ( |  | ) | const`[inline]`

template<typename T>

void vl::Collection< T >::push_back | ( | T * | data | ) | `[inline]`

template<typename T>

void vl::Collection< T >::pop_back | ( |  | ) | `[inline]`

template<typename T>

void vl::Collection< T >::resize | ( | int | size | ) | `[inline]`

template<typename T>

int vl::Collection< T >::size | ( |  | ) | const`[inline]`

template<typename T>

bool vl::Collection< T >::empty | ( |  | ) | const`[inline]`

template<typename T>

void vl::Collection< T >::clear | ( |  | ) | `[inline]`

template<typename T>

const T* vl::Collection< T >::back | ( |  | ) | const`[inline]`

template<typename T>

T* vl::Collection< T >::back | ( |  | ) | `[inline]`

template<typename T>

void vl::Collection< T >::reserve | ( | int | capacity | ) | `[inline]`

template<typename T>

int vl::Collection< T >::capacity | ( |  | ) | const`[inline]`

template<typename T>

const ref<T>& vl::Collection< T >::operator[] | ( | int | i | ) | const`[inline]`

template<typename T>

ref<T>& vl::Collection< T >::operator[] | ( | int | i | ) | `[inline]`

template<typename T>

const T* vl::Collection< T >::at | ( | int | i | ) | const`[inline]`

template<typename T>

T* vl::Collection< T >::at | ( | int | i | ) | `[inline]`

template<typename T>

void vl::Collection< T >::swap | ( | Collection< T > & | other | ) | `[inline]`

template<typename T>

void vl::Collection< T >::sort | ( |  | ) | `[inline]`

template<typename T>

int vl::Collection< T >::find | ( | T * | obj | ) | const`[inline]`

template<typename T>

void vl::Collection< T >::shrink | ( |  | ) | `[inline]`

template<typename T>

void vl::Collection< T >::push_back | ( | const Collection< T > & | objs | ) | `[inline]`

template<typename T>

void vl::Collection< T >::insert | ( | int | start,
|  | const Collection< T > & | objs |
| ) |  |  | `[inline]`

template<typename T>

void vl::Collection< T >::set | ( | const Collection< T > & | objs | ) | `[inline]`

template<typename T>

void vl::Collection< T >::erase | ( | int | start,
|  | int | count |
| ) |  |  | `[inline]`

template<typename T>

void vl::Collection< T >::set | ( | int | index,
|  | T * | obj |
| ) |  |  | `[inline]`

template<typename T>

void vl::Collection< T >::insert | ( | int | index,
|  | T * | obj |
| ) |  |  | `[inline]`

template<typename T>

void vl::Collection< T >::erase | ( | const T * | data | ) | `[inline]`

template<typename T>

void vl::Collection< T >::eraseAt | ( | int | index | ) | `[inline]`

template<typename T>

const std::vector< ref<T> >& vl::Collection< T >::vector | ( |  | ) | const`[inline]`

template<typename T>

std::vector< ref<T> >& vl::Collection< T >::vector | ( |  | ) | `[inline]`

template<typename T>

static bool vl::Collection< T >::less | ( | const ref< T > & | a,
|  | const ref< T > & | b |
| ) |  |  | `[inline, static, protected]`

## Member Data Documentation

template<typename T>

std::vector< ref<T> > vl::Collection< T >::mVector`[protected]`

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/Collection.hpp

Visualization Library v2009.07 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Mon Aug 10 21:41:34 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.