stx_CacheArray< _MaxCacheSize > Class Template Reference
[Common, basic classes, functions and types]

#include <stx_Cache.h>

Inheritance diagram for stx_CacheArray< _MaxCacheSize >:

Inheritance graph
[legend]
Collaboration diagram for stx_CacheArray< _MaxCacheSize >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<int _MaxCacheSize>
class stx_CacheArray< _MaxCacheSize >

Definition at line 137 of file stx_Cache.h.


Public Member Functions

 stx_CacheArray ()
 stx_CacheArray (int a_usedSize)
stx_CacheElGet (stx_CacheKey_t a_key)
void Insert (stx_CacheEl *a_elem_p)
void RemoveEl (stx_CacheEl *a_elem_p)
void CleanUp ()
void CleanUpAndNotify ()
void Resize (int a_usedSize)
int GetSize ()

Private Member Functions

UInt32_t HashFunc (stx_CacheKey_t a_key)

Private Attributes

stx_CacheVec m_cacheArray [_MaxCacheSize]
int m_usedSize

Constructor & Destructor Documentation

template<int _MaxCacheSize>
stx_CacheArray< _MaxCacheSize >::stx_CacheArray (  )  [inline]

Definition at line 139 of file stx_Cache.h.

00139                      { 
00140         Resize(_MaxCacheSize);
00141     };

template<int _MaxCacheSize>
stx_CacheArray< _MaxCacheSize >::stx_CacheArray ( int  a_usedSize  )  [inline]

Definition at line 143 of file stx_Cache.h.

00143                                    { 
00144         Resize(a_usedSize);
00145     };


Member Function Documentation

template<int _MaxCacheSize>
stx_CacheEl* stx_CacheArray< _MaxCacheSize >::Get ( stx_CacheKey_t  a_key  )  [inline]

Reimplemented in stx_CacheArrayOfRefEl< _MaxCacheSize >.

Definition at line 147 of file stx_Cache.h.

Referenced by fsc_DataLMgr::DumpTree(), fsc_DataLMgr::FastInsert(), stx_CacheArrayOfRefEl< _MaxCacheSize >::Get(), and fsc_DataLMgr::Remove().

00147                                           {
00148         return m_cacheArray[HashFunc(a_key)].Get(a_key);
00149     };

Here is the caller graph for this function:

template<int _MaxCacheSize>
void stx_CacheArray< _MaxCacheSize >::Insert ( stx_CacheEl a_elem_p  )  [inline]

Definition at line 151 of file stx_Cache.h.

References stx_CacheEl::GetCacheKey(), and push_back().

Referenced by fsc_DataLMgr::FastInsert(), stx_CacheArrayOfRefEl< _MaxCacheSize >::Insert(), and fsc_DataLMgr::Remove().

00151                                       {
00152         m_cacheArray[HashFunc(a_elem_p->GetCacheKey())].push_back(a_elem_p);
00153     };

Here is the call graph for this function:

Here is the caller graph for this function:

template<int _MaxCacheSize>
void stx_CacheArray< _MaxCacheSize >::RemoveEl ( stx_CacheEl a_elem_p  )  [inline]

Definition at line 159 of file stx_Cache.h.

References stx_CacheEl::GetCacheKey().

Referenced by stx_CacheArrayOfRefEl< _MaxCacheSize >::RemoveEl().

00159                                         {
00160         m_cacheArray[HashFunc(a_elem_p->GetCacheKey())].RemoveEl(a_elem_p);
00161     };

Here is the call graph for this function:

Here is the caller graph for this function:

template<int _MaxCacheSize>
void stx_CacheArray< _MaxCacheSize >::CleanUp (  )  [inline]

Definition at line 163 of file stx_Cache.h.

References stx_CacheVec::CleanUp().

00163                   {
00164         stx_CacheVec *ip = m_cacheArray;
00165         stx_CacheVec *ep = &m_cacheArray[m_usedSize]; // addres of past the end
00166         for (; ip < ep; ip++) {
00167                 ip->CleanUp();
00168         }
00169     };

Here is the call graph for this function:

template<int _MaxCacheSize>
void stx_CacheArray< _MaxCacheSize >::CleanUpAndNotify (  )  [inline]

Definition at line 171 of file stx_Cache.h.

References stx_CacheVec::CleanUpAndNotify().

Referenced by fsc_DataLMgr::FlushChangesAndCleanCache().

00171                            {
00172         stx_CacheVec *ip = m_cacheArray;
00173         stx_CacheVec *ep = &m_cacheArray[m_usedSize]; // addres of past the end
00174         for (; ip < ep; ip++) {
00175                 ip->CleanUpAndNotify();
00176         }
00177     };

Here is the call graph for this function:

Here is the caller graph for this function:

template<int _MaxCacheSize>
void stx_CacheArray< _MaxCacheSize >::Resize ( int  a_usedSize  )  [inline]

Definition at line 179 of file stx_Cache.h.

Referenced by fsc_FRIunpacker::fsc_FRIunpacker(), fsc_DataLMgr::Insert(), i_FSC_i::InsertSplitFromFRIBlock(), and fsc_DataLMgr::Remove().

00179                                 { (a_usedSize > _MaxCacheSize)
00180                                   ? m_usedSize = _MaxCacheSize
00181                                   : (a_usedSize < 4)
00182                                     ? 4
00183                                     : m_usedSize = a_usedSize; };

Here is the caller graph for this function:

template<int _MaxCacheSize>
int stx_CacheArray< _MaxCacheSize >::GetSize (  )  [inline]

Definition at line 185 of file stx_Cache.h.

00185 { return m_usedSize; };

template<int _MaxCacheSize>
UInt32_t stx_CacheArray< _MaxCacheSize >::HashFunc ( stx_CacheKey_t  a_key  )  [inline, private]

Definition at line 187 of file stx_Cache.h.

00187                                             {
00188         return (UInt32_t)(a_key % m_usedSize);
00189     };


Member Data Documentation

template<int _MaxCacheSize>
stx_CacheVec stx_CacheArray< _MaxCacheSize >::m_cacheArray[_MaxCacheSize] [private]

Definition at line 189 of file stx_Cache.h.

template<int _MaxCacheSize>
int stx_CacheArray< _MaxCacheSize >::m_usedSize [private]

Definition at line 193 of file stx_Cache.h.


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

Generated on Mon Feb 27 19:50:34 2012 for OPENARCHIVE by  doxygen 1.5.6