OGRE: Ogre::StaticCache< cacheSize > Class Template Reference

| OGRE 14.5 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::StaticCache< cacheSize > Class Template Reference

Template version of cache based on static array. More...

`#include <OgreDeflate.h>`

## Public Member Functions
| StaticCache ()
| Constructor.
size_t | avail () const
| Returns number of bytes available for reading in cache after rewinding.
size_t | cacheData (const void *buf, size_t count)
| Cache data pointed by 'buf'.
void | clear ()
| Clear the cache.
bool | ff (size_t count)
| Step forward in cached stream by 'count' bytes.
size_t | read (void *buf, size_t count)
| Read data from cache to 'buf' (maximum 'count' bytes).
bool | rewind (size_t count)
| Step back in cached stream by 'count' bytes.

## Detailed Description

template<size_t cacheSize>
class Ogre::StaticCache< cacheSize >

Template version of cache based on static array.

'cacheSize' defines size of cache in bytes.

## Constructor & Destructor Documentation

## ◆ StaticCache()

template<size_t cacheSize>

Ogre::StaticCache< cacheSize >::StaticCache | ( |  | ) |
| inline

Constructor.

## Member Function Documentation

## ◆ cacheData()

template<size_t cacheSize>

size_t Ogre::StaticCache< cacheSize >::cacheData | ( | const void * | buf,
|  | size_t | count )
| inline

Cache data pointed by 'buf'.

If 'count' is greater than cache size, we cache only last bytes. Returns number of bytes written to cache.

References avail().

## ◆ read()

template<size_t cacheSize>

size_t Ogre::StaticCache< cacheSize >::read | ( | void * | buf,
|  | size_t | count )
| inline

Read data from cache to 'buf' (maximum 'count' bytes).

Returns number of bytes read from cache.

References avail().

## ◆ rewind()

template<size_t cacheSize>

bool Ogre::StaticCache< cacheSize >::rewind | ( | size_t | count | ) |
| inline

Step back in cached stream by 'count' bytes.

Returns 'true' if cache contains resulting position.

References clear().

## ◆ ff()

template<size_t cacheSize>

bool Ogre::StaticCache< cacheSize >::ff | ( | size_t | count | ) |
| inline

Step forward in cached stream by 'count' bytes.

Returns 'true' if cache contains resulting position.

References avail(), and clear().

## ◆ avail()

template<size_t cacheSize>

size_t Ogre::StaticCache< cacheSize >::avail | ( |  | ) | const
| inline

Returns number of bytes available for reading in cache after rewinding.

Referenced by cacheData(), ff(), and read().

## ◆ clear()

template<size_t cacheSize>

void Ogre::StaticCache< cacheSize >::clear | ( |  | ) |
| inline

Clear the cache.

Referenced by ff(), and rewind().

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

- OgreDeflate.h