Public Member Functions | Public Attributes

stx_CacheVec Class Reference
[Common, basic classes, functions and types]

#include <stx_Cache.h>

List of all members.

Public Member Functions

 stx_CacheVec ()
 ~stx_CacheVec ()
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 ()

Public Attributes

 log_CLASSID_m

Detailed Description

Definition at line 94 of file stx_Cache.h.


Constructor & Destructor Documentation

stx_CacheVec::stx_CacheVec (  )  [inline]

Definition at line 96 of file stx_Cache.h.

{ reserve(8);};

stx_CacheVec::~stx_CacheVec (  )  [inline]

Definition at line 97 of file stx_Cache.h.

                   {
        CleanUp();
    };


Member Function Documentation

void stx_CacheVec::CleanUp (  ) 

Definition at line 114 of file stx_Cache.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, and NULL.

Referenced by stx_CacheArray< _MaxCacheSize >::CleanUp(), and stx_Cache::CleanUp().

                           {
//    log_FUNC_m(CleanUp);
    stx_CacheEl* *ip = &(*begin());
    stx_CacheEl* *ep = &(*end()); // addres of past the end
    for (; ip < ep; ip++) {
        if (*ip != NULL) {
            //log_DBG_m(dbg_DETAIL, " remove EL p= " << *ip
            //                   << " key = " << (*ip)->GetCacheKey());
            delete *ip;
        }
        else {
            log_FUNC_m(CleanUp);
            log_DBG_m(dbg_DETAIL, "Point to NULL. ip: " << ip);
        }
    }
    clear();
}

Here is the caller graph for this function:

void stx_CacheVec::CleanUpAndNotify (  ) 

Definition at line 134 of file stx_Cache.cpp.

References log_FUNC_m, log_WRN_m, and NULL.

Referenced by stx_CacheArray< _MaxCacheSize >::CleanUpAndNotify().

                                    {
//    log_FUNC_m(CleanUpAndNotify);
    stx_CacheEl* *ip = &(*begin());
    stx_CacheEl* *ep = &(*end()); // addres of past the end
    for (; ip < ep; ip++) {
        if (*ip != NULL) {
            (*ip)->RemoveNotification();
            delete *ip;
        }
        else {
            log_FUNC_m(CleanUpAndNotify);
            log_WRN_m("Point to NULL. STRANGE!");
        }
    }
    clear();
}

Here is the caller graph for this function:

stx_CacheEl * stx_CacheVec::Get ( stx_CacheKey_t  a_key  ) 

Definition at line 62 of file stx_Cache.cpp.

Referenced by i_FSC_i::CompleteMigration(), fsc_FileLocStorage::Insert(), and i_FSC_i::InsertSplitFromFRIBlock().

                                                  {
//    log_FUNC_m(Get);

    register stx_CacheEl* *ip = &(*begin());
    register stx_CacheEl* *ep = &(*end()); // addres of past the end
    for (; ip < ep; ip++) {
        if ((*ip)->m_cacheKey == a_key) {
            return *ip;
        }
    }
    return NULL;
}

Here is the caller graph for this function:

void stx_CacheVec::Insert ( stx_CacheEl a_elem_p  )  [inline]

Definition at line 102 of file stx_Cache.h.

Referenced by fsc_FileLocStorage::Insert(), and i_FSC_i::InsertSplitFromFRIBlock().

                                       {
        insert(end(), a_elem_p);
    };

Here is the caller graph for this function:

void stx_CacheVec::RemoveEl ( stx_CacheEl a_elem_p  ) 

Definition at line 98 of file stx_Cache.cpp.

Referenced by i_FSC_i::CompleteMigration(), and i_FSC_i::InsertSplitFromFRIBlock().

                                                {
    stx_CacheEl* *ip = &(*begin());
    stx_CacheEl* *ep = &(*end()); // addres of past the end
    for (; ip < ep; ip++) {
        if ((*ip) == a_elem_p) { // check if point to same object
    //        log_FUNC_m(RemoveEl(stx_CacheEl*));
    //        log_DBG_m(dbg_DETAIL, " remove EL p= " << a_elem_p
    //                           << " key = " << a_elem_p->GetCacheKey());
            *ip = *--ep; // overwrite element with last one
            pop_back(); // remove last
        }
    }
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 110 of file stx_Cache.h.


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