Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

stx_Cache Class Reference
[Common, basic classes, functions and typesFSC]

stx_CacheEl objects. More...

#include <stx_Cache.h>

Inheritance diagram for stx_Cache:
Inheritance graph
[legend]
Collaboration diagram for stx_Cache:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 stx_Cache (int a_maxCacheSize=1000)
stx_CacheElGet (stx_CacheKey_t a_key)
void Insert (stx_CacheEl *a_elem_p)
void RemoveEl (stx_CacheEl *a_elem_p)
void CleanUp ()
void Resize (UInt32_t a_cacheSize)

Public Attributes

 log_CLASSID_m

Private Member Functions

UInt32_t HashFunc (stx_CacheKey_t a_key)

Private Attributes

int m_cacheSize

Detailed Description

stx_CacheEl objects.

Reorganization scan proces collects data of each file location on volume. Such a collected info is packed inside ivd_FileLocationData_t structure. These records are then strored to file that belonged to particular volume. The class store every records to m_volContents Records of files that have to be reorganized are stored to m_volFilesToReorg too.

Definition at line 122 of file stx_Cache.h.


Constructor & Destructor Documentation

stx_Cache::stx_Cache ( int  a_maxCacheSize = 1000  ) 

Definition at line 155 of file stx_Cache.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_cacheSize, and Resize().

                                    {
    log_FUNC_m(stx_Cache);
    Resize(a_cacheSize);
    log_DBG_m(dbg_DETAIL, ">>stx_Cache with " << m_cacheSize << " elements IS_CREATED.");
}

Here is the call graph for this function:


Member Function Documentation

void stx_Cache::CleanUp (  ) 

Definition at line 191 of file stx_Cache.cpp.

References stx_CacheVec::CleanUp().

                        {
//    log_FUNC_m(CleanUp);
    stx_CacheVec *ip = &(*begin());
    stx_CacheVec *ep = &(*end()); // addres of past the end
    for (; ip < ep; ip++) {
            ip->CleanUp();
    }
}

Here is the call graph for this function:

stx_CacheEl * stx_Cache::Get ( stx_CacheKey_t  a_key  ) 

Definition at line 163 of file stx_Cache.cpp.

References HashFunc().

Referenced by fsc_CollectorRedunCopy::PostCopiesProc(), fsc_SplitInfoCollector::ProcObjMedPosMgr(), fsc_RawReorgScanDataCollector::ProcRecMedPosMgr(), and fsc_RawMedVolCollector::ProcRecMedPosMgr().

                                               {
//    log_FUNC_m(Get);
    return operator[](HashFunc(a_key)).Get(a_key);
}

Here is the call graph for this function:

Here is the caller graph for this function:

UInt32_t stx_Cache::HashFunc ( stx_CacheKey_t  a_key  )  [inline, private]

Definition at line 140 of file stx_Cache.h.

Referenced by Get(), Insert(), and RemoveEl().

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

Here is the caller graph for this function:

void stx_Cache::Insert ( stx_CacheEl a_elem_p  ) 

Definition at line 170 of file stx_Cache.cpp.

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

Referenced by fsc_CollectorRedunCopy::PostCopiesProc(), fsc_SplitInfoCollector::ProcObjMedPosMgr(), fsc_RawReorgScanDataCollector::ProcRecMedPosMgr(), and fsc_RawMedVolCollector::ProcRecMedPosMgr().

                                           {
//    log_FUNC_m(Insert);
    operator[](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:

void stx_Cache::RemoveEl ( stx_CacheEl a_elem_p  ) 

Definition at line 184 of file stx_Cache.cpp.

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

                                             {
//    log_FUNC_m(RemoveEl(CacheEl*));
    operator[](HashFunc(a_elem_p->GetCacheKey())).RemoveEl(a_elem_p);
}

Here is the call graph for this function:

void stx_Cache::Resize ( UInt32_t  a_cacheSize  )  [inline]

Definition at line 132 of file stx_Cache.h.

Referenced by stx_Cache().

                                      {  (a_cacheSize == 0)
                                        ? m_cacheSize = 1
                                        : m_cacheSize = a_cacheSize; 
                                        resize(m_cacheSize);
    };

Here is the caller graph for this function:


Member Data Documentation

Definition at line 136 of file stx_Cache.h.

int stx_Cache::m_cacheSize [private]

Definition at line 142 of file stx_Cache.h.

Referenced by stx_Cache().


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