Public Member Functions | Private Attributes

fsc_FLSPerMedia Class Reference
[G_new_group]

#include <fsc_FLSPerMedia.h>

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

List of all members.

Public Member Functions

 fsc_FLSPerMedia (ivd_MediaKey_t a_medKey)
virtual ~fsc_FLSPerMedia (void)
void Insert (ivd_MedVolNum_t a_volNum, ivd_FileLocationData_t &a_fileLoc)
fsc_FLSPerVolumeGetNextFSLPerVolume (ivd_MediaKey_t &a_medKey, ivd_MedVolNum_t &a_volNum)
void SortList ()
ivd_MediaKey_t GetMediaKey ()

Private Attributes

 log_CLASSID_m
ivd_MediaKey_t m_medKey
fsc_FLSPerVolume_p_v_t m_mediumVolumes_p_v
 Vector contains pointers because objects will be passed to recall jobs by fsc_FSLPerVolume* GetNextFSLPerVolume(...) command.
ivd_MedVolNum_t m_lastVolIdx
int m_iterIdx

Detailed Description

Definition at line 49 of file fsc_FLSPerMedia.h.


Constructor & Destructor Documentation

fsc_FLSPerMedia::fsc_FLSPerMedia ( ivd_MediaKey_t  a_medKey  ) 

Definition at line 50 of file fsc_FLSPerMedia.cpp.

References fsc_MAX_VOL_NUMBER_d, log_FUNC_m, and m_mediumVolumes_p_v.

    : 
    stx_CacheEl(a_medKey),
    m_medKey(a_medKey),
    m_lastVolIdx(0), 
    m_iterIdx(1) // volume number 0 is not used
{
    log_FUNC_m(fsc_FLSPerMedia);
    // reserve and set to NULL all fsc_MAX_VOL_NUMBER_d of pointers
    m_mediumVolumes_p_v.resize(fsc_MAX_VOL_NUMBER_d + 1);
    fsc_FLSPerVolume** pi = &m_mediumVolumes_p_v[0];
    fsc_FLSPerVolume** pe = &m_mediumVolumes_p_v[fsc_MAX_VOL_NUMBER_d + 1];
    for (; pi != pe; ++pi) {
        *pi = NULL;
    }    
}

fsc_FLSPerMedia::~fsc_FLSPerMedia ( void   )  [virtual]

Definition at line 68 of file fsc_FLSPerMedia.cpp.

References log_FUNC_m, m_lastVolIdx, m_mediumVolumes_p_v, and NULL.

                                      {
    log_FUNC_m(~fsc_FLSPerMedia);
    fsc_FLSPerVolume** pi = &m_mediumVolumes_p_v[0];
    fsc_FLSPerVolume** pe = &m_mediumVolumes_p_v[m_lastVolIdx + 1];
    for (; pi != pe; ++pi) {
        if (*pi != NULL) {
            delete *pi;
        }
    }    
}


Member Function Documentation

ivd_MediaKey_t fsc_FLSPerMedia::GetMediaKey (  )  [inline]

Definition at line 67 of file fsc_FLSPerMedia.h.

Referenced by fsc_FileLocStorage::GetNextFSLMedium().

{ return m_medKey; };

Here is the caller graph for this function:

fsc_FLSPerVolume * fsc_FLSPerMedia::GetNextFSLPerVolume ( ivd_MediaKey_t a_medKey,
ivd_MedVolNum_t a_volNum 
)

Definition at line 103 of file fsc_FLSPerMedia.cpp.

References dbg_DETAIL, fsc_FLSPerVolume::GetVolNum(), log_DBG_m, log_FUNC_m, m_iterIdx, m_lastVolIdx, m_mediumVolumes_p_v, m_medKey, and NULL.

Referenced by i_EfficientRecallJob_i::PrepareResource(), and i_EfficientRecallJob_i::SetNextVolume().

                                                                                  {
    log_FUNC_m(GetNextFSLPerVolume);
    
    log_DBG_m(dbg_DETAIL, "m_iterIdx: " << m_iterIdx);
    
    fsc_FLSPerVolume* p = m_mediumVolumes_p_v[m_iterIdx];
    while (  (p == NULL)
          && (m_iterIdx <= m_lastVolIdx) ) {
        p = m_mediumVolumes_p_v[++m_iterIdx];
    }
    if (p != NULL) {    
        m_mediumVolumes_p_v[m_iterIdx] = NULL; // element is stolen
        a_medKey = m_medKey;
        // iterIdx not represent volume number.
        // This is true only at inser mode.
        a_volNum = p->GetVolNum();
        log_DBG_m(dbg_DETAIL, "m_iterIdx: " << m_iterIdx 
                           << ", a_medKey: " << a_medKey
                           << ", a_volNum: " << a_volNum);
        ++m_iterIdx;
    }
    return p;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void fsc_FLSPerMedia::Insert ( ivd_MedVolNum_t  a_volNum,
ivd_FileLocationData_t a_fileLoc 
)

Definition at line 80 of file fsc_FLSPerMedia.cpp.

References dbg_DETAIL, fsc_MAX_VOL_NUMBER_d, ie_FATAL_ERROR, log_DBG_m, log_FUNC_m, m_lastVolIdx, m_mediumVolumes_p_v, and NULL.

Referenced by fsc_FileLocStorage::Insert().

                                                               {
    log_FUNC_m(Insert);
    if (a_volNum > fsc_MAX_VOL_NUMBER_d) {
        ostringstream sstr;
        sstr << "Vulume number exceed max value. VolNum: " << a_volNum
             << " > MAX_VOL_NUMBER: " << fsc_MAX_VOL_NUMBER_d;
        throw ivd_InternalError(ie_FATAL_ERROR, sstr.str());
    }
    log_DBG_m(dbg_DETAIL, "a_volNum: " << a_volNum);
    fsc_FLSPerVolume** p = &m_mediumVolumes_p_v[a_volNum];
        
    if (*p == NULL) {
        *p = new fsc_FLSPerVolume(a_volNum);
        log_DBG_m(dbg_DETAIL, "Create new fsc_FLSPerVolume");
    }
    (*p)->Insert(a_fileLoc);
    if (m_lastVolIdx < a_volNum) {
        m_lastVolIdx = a_volNum;
    }
}

Here is the caller graph for this function:

void fsc_FLSPerMedia::SortList (  ) 

Definition at line 129 of file fsc_FLSPerMedia.cpp.

References log_FUNC_m, m_lastVolIdx, m_mediumVolumes_p_v, NULL, and fsc_FLSPerVolume::SortByOffset().

Referenced by fsc_FileLocStorage::SortList().

                               {
    log_FUNC_m(SortList);

    m_mediumVolumes_p_v.resize(m_lastVolIdx + 1);
        
    fsc_FLSPerVolume_p_v_i iter = m_mediumVolumes_p_v.begin();
    
    for (; iter != m_mediumVolumes_p_v.end(); ++iter) {
        fsc_FLSPerVolume* pi = (*iter);
        if (pi != NULL) {
            pi->SortByOffset();
        }
    }    
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from stx_CacheEl.

Definition at line 67 of file fsc_FLSPerMedia.h.

Definition at line 81 of file fsc_FLSPerMedia.h.

Referenced by GetNextFSLPerVolume().

Definition at line 79 of file fsc_FLSPerMedia.h.

Referenced by GetNextFSLPerVolume(), Insert(), SortList(), and ~fsc_FLSPerMedia().

Vector contains pointers because objects will be passed to recall jobs by fsc_FSLPerVolume* GetNextFSLPerVolume(...) command.

media could have fsc_MAX_VOL_NUMBER_d

Definition at line 77 of file fsc_FLSPerMedia.h.

Referenced by fsc_FLSPerMedia(), GetNextFSLPerVolume(), Insert(), SortList(), and ~fsc_FLSPerMedia().

Definition at line 72 of file fsc_FLSPerMedia.h.

Referenced by GetNextFSLPerVolume().


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