MICACHEARRAY< _CT > Class Template Reference

< GENERATING_DOXYGEN_OUTPUT More...

#include <mi32/micachearray.h>

Inheritance diagram for MICACHEARRAY< _CT >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 MICACHEARRAY (MICACHEARRAYIO< _CT > &ioref)
virtual ~MICACHEARRAY ()
ERRVALUE Create (INT32 NumBuckets, INT32 BucketSize=32768, bool bSynchronizeAccess=false, INT32 ItemSize=sizeof(_CT))
ERRVALUE Flush ()
void Free ()
ERRVALUE Read (INT32 ItemIdx, _CT &item, void *UserDataPtr=0)
ERRVALUE Write (INT32 ItemIdx, const _CT &item, void *UserDataPtr=0)

Detailed Description

template<class _CT>
class MICACHEARRAY< _CT >

< GENERATING_DOXYGEN_OUTPUT


Constructor & Destructor Documentation

template<class _CT >
MICACHEARRAY< _CT >::MICACHEARRAY ( MICACHEARRAYIO< _CT > &  ioref  )  [inline, explicit]

Default constructor.

This performs initialization only. Use the appropriate Create() method to actually create the cache.

template<class _CT >
virtual MICACHEARRAY< _CT >::~MICACHEARRAY (  )  [inline, virtual]

Destructor.


Member Function Documentation

template<class _CT >
ERRVALUE MICACHEARRAY< _CT >::Create ( INT32  NumBuckets,
INT32  BucketSize = 32768,
bool  bSynchronizeAccess = false,
INT32  ItemSize = sizeof(_CT) 
) [inline]

Create cache with equal-sized entries.

Allocation will be handled by the MICACHE class. If items are only to be read and not modified then the CACHEIO.CacheSave() method does not need to do anything but return 0. 'NumCache' needs to be at least as much as the number of threads that will use the cache, otherwise an ECacheItemsExhausted error may result.

Parameters:
NumBuckets Number of cache buckets to use.
BucketSize Initial size of the bucket in bytes
bSynchronizeAccess Set to 'true' if multiple threads will use this cache
ItemSize Size of each array item in bytes
template<class _CT >
ERRVALUE MICACHEARRAY< _CT >::Flush (  )  [inline]

Flush all modified entries to external storage.

This may cause the WriteFunc callback to be invoked.

template<class _CT >
void MICACHEARRAY< _CT >::Free (  )  [inline]

Free the cache.

template<class _CT >
ERRVALUE MICACHEARRAY< _CT >::Read ( INT32  ItemIdx,
_CT &  item,
void *  UserDataPtr = 0 
) [inline]

Read data from cache item.

An EInvalidCacheResize error will be returned if this method is called while another thread is calling Resize().

Parameters:
ItemIdx Item number to read
item Item to read into
UserDataPtr User data pointer to attach to the cache item before reading
template<class _CT >
ERRVALUE MICACHEARRAY< _CT >::Write ( INT32  ItemIdx,
const _CT &  item,
void *  UserDataPtr = 0 
) [inline]

Write data to cache item.

An EInvalidCacheResize error will be returned if this method is called while another thread is calling Resize().

Parameters:
ItemIdx Item number to write
item Item to write from
UserDataPtr User data pointer to attach to the cache item before writing

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

Generated on Sun Oct 7 21:33:35 2012 for TNTsdk 2012 by  doxygen 1.6.1