OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ogre::StaticCache< cacheSize > Class Template Reference

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

#include <OgreZip.h>

Public Member Functions

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

Protected Attributes

char mBuffer [cacheSize]
 Static buffer. More...
 
size_t mPos
 Current read position. More...
 
size_t mValidBytes
 Number of bytes valid in cache (written from the beginning of static buffer) More...
 

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.

Definition at line 125 of file OgreZip.h.

Constructor & Destructor Documentation

template<size_t cacheSize>
Ogre::StaticCache< cacheSize >::StaticCache ( )
inline

Constructor.

Definition at line 138 of file OgreZip.h.

Member Function Documentation

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

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

Definition at line 219 of file OgreZip.h.

Referenced by Ogre::StaticCache< 2 *OGRE_STREAM_TEMP_SIZE >::cacheData(), Ogre::StaticCache< 2 *OGRE_STREAM_TEMP_SIZE >::ff(), and Ogre::StaticCache< 2 *OGRE_STREAM_TEMP_SIZE >::read().

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.

Definition at line 146 of file OgreZip.h.

template<size_t cacheSize>
void Ogre::StaticCache< cacheSize >::clear ( void  )
inline
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.

Definition at line 204 of file OgreZip.h.

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.

Definition at line 180 of file OgreZip.h.

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.

Definition at line 190 of file OgreZip.h.

Member Data Documentation

template<size_t cacheSize>
char Ogre::StaticCache< cacheSize >::mBuffer[cacheSize]
protected
template<size_t cacheSize>
size_t Ogre::StaticCache< cacheSize >::mValidBytes
protected

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