Crystal Space: csFrameDataHolder< T > Class Template Reference (Crystal Space Public API Reference)

| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csFrameDataHolder< T > Class Template Reference

Helper template to retrieve an instance of some type that has not yet been used in a frame. More...

`#include <cstool/framedataholder.h>`

List of all members.

## Public Member Functions
void | Clear (bool instaClear=false)
| Remove all allocated instances.
| csFrameDataHolder ()
T & | GetUnusedData (bool &created, uint frameNumber)
| Retrieve an instance of the type T whose associated frame number differs from frameNumber.
| ~csFrameDataHolder ()

## Detailed Description

### template<class T>
class csFrameDataHolder< T >

Helper template to retrieve an instance of some type that has not yet been used in a frame.

Retrieval in subsequent frames will reuse already created instances, if appropriate (that is, the associated frame number differs from the provide current frame number).

Definition at line 37 of file framedataholder.h.

## Member Function Documentation

template<class T>

void csFrameDataHolder< T >::Clear | ( | bool | instaClear = `false` | ) | `[inline]`

Remove all allocated instances.

Remarks:
  Warning! Don't use if pointers etc. to contained data still in use!

  By default. does not clear the allocated data instantly but rather upon the next frame (ie when the frameNumber parameter passed to GetUnusedData() differs from the last). To change this behaviour, set instaClear to true.

Definition at line 140 of file framedataholder.h.

template<class T>

T& csFrameDataHolder< T >::GetUnusedData | ( | bool & | created,
|  | uint | frameNumber |
| ) |  |  | `[inline]`

Retrieve an instance of the type T whose associated frame number differs from frameNumber.

In created, it is returned whether a new instance was created (value is true) or an existing one was reused (value is false). Can be used to e.g. determine whether some initialization work can be saved.

Definition at line 96 of file framedataholder.h.

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

- cstool/framedataholder.h