Public Member Functions | Private Member Functions | Private Attributes

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.

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

Detailed Description

template<int _MaxCacheSize>
class stx_CacheArray< _MaxCacheSize >

Definition at line 151 of file stx_Cache.h.


Constructor & Destructor Documentation

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

Definition at line 153 of file stx_Cache.h.

                     { 
        Resize(_MaxCacheSize);
    };

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

Definition at line 157 of file stx_Cache.h.

                                   { 
        Resize(a_usedSize);
    };


Member Function Documentation

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

Definition at line 177 of file stx_Cache.h.

References stx_CacheVec::CleanUp().

                  {
        stx_CacheVec *ip = m_cacheArray;
        stx_CacheVec *ep = &m_cacheArray[m_usedSize]; // addres of past the end
        for (; ip < ep; ip++) {
                ip->CleanUp();
        }
    };

Here is the call graph for this function:

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

Definition at line 185 of file stx_Cache.h.

References stx_CacheVec::CleanUpAndNotify().

Referenced by fsc_DataLMgr::FlushChangesAndCleanCache().

                           {
        stx_CacheVec *ip = m_cacheArray;
        stx_CacheVec *ep = &m_cacheArray[m_usedSize]; // addres of past the end
        for (; ip < ep; ip++) {
                ip->CleanUpAndNotify();
        }
    };

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented in stx_CacheArrayOfRefEl< _MaxCacheSize >.

Definition at line 161 of file stx_Cache.h.

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

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

Here is the caller graph for this function:

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

Definition at line 199 of file stx_Cache.h.

{ return m_usedSize; };

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

Definition at line 201 of file stx_Cache.h.

                                            {
        return (UInt32_t)(a_key % m_usedSize);
    };

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

Definition at line 165 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().

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

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 173 of file stx_Cache.h.

References stx_CacheEl::GetCacheKey().

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

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

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 193 of file stx_Cache.h.

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

                                { (a_usedSize > _MaxCacheSize)
                                  ? m_usedSize = _MaxCacheSize
                                  : (a_usedSize < 4)
                                    ? 4
                                    : m_usedSize = a_usedSize; };

Here is the caller graph for this function:


Member Data Documentation

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

Definition at line 203 of file stx_Cache.h.

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

Definition at line 207 of file stx_Cache.h.


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