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.


Detailed Description

Definition at line 35 of file fsc_FLSPerMedia.h.


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(.
ivd_MedVolNum_t m_lastVolIdx
int m_iterIdx

Constructor & Destructor Documentation

fsc_FLSPerMedia::fsc_FLSPerMedia ( ivd_MediaKey_t  a_medKey  ) 

Definition at line 36 of file fsc_FLSPerMedia.cpp.

References fsc_MAX_VOL_NUMBER_d, log_FUNC_m, m_mediumVolumes_p_v, and NULL.

00037     : 
00038     stx_CacheEl(a_medKey),
00039     m_medKey(a_medKey),
00040     m_lastVolIdx(0), 
00041     m_iterIdx(1) // volume number 0 is not used
00042 {
00043     log_FUNC_m(fsc_FLSPerMedia);
00044     // reserve and set to NULL all fsc_MAX_VOL_NUMBER_d of pointers
00045     m_mediumVolumes_p_v.resize(fsc_MAX_VOL_NUMBER_d + 1);
00046     fsc_FLSPerVolume** pi = &m_mediumVolumes_p_v[0];
00047     fsc_FLSPerVolume** pe = &m_mediumVolumes_p_v[fsc_MAX_VOL_NUMBER_d + 1];
00048     for (; pi != pe; ++pi) {
00049         *pi = NULL;
00050     }    
00051 }

fsc_FLSPerMedia::~fsc_FLSPerMedia ( void   )  [virtual]

Definition at line 54 of file fsc_FLSPerMedia.cpp.

References log_FUNC_m, m_lastVolIdx, m_mediumVolumes_p_v, and NULL.

00054                                       {
00055     log_FUNC_m(~fsc_FLSPerMedia);
00056     fsc_FLSPerVolume** pi = &m_mediumVolumes_p_v[0];
00057     fsc_FLSPerVolume** pe = &m_mediumVolumes_p_v[m_lastVolIdx + 1];
00058     for (; pi != pe; ++pi) {
00059         if (*pi != NULL) {
00060             delete *pi;
00061         }
00062     }    
00063 }


Member Function Documentation

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

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

00067                                                                {
00068     log_FUNC_m(Insert);
00069     if (a_volNum > fsc_MAX_VOL_NUMBER_d) {
00070         ostringstream sstr;
00071         sstr << "Vulume number exceed max value. VolNum: " << a_volNum
00072              << " > MAX_VOL_NUMBER: " << fsc_MAX_VOL_NUMBER_d;
00073         throw ivd_InternalError(ie_FATAL_ERROR, sstr.str());
00074     }
00075     log_DBG_m(dbg_DETAIL, "a_volNum: " << a_volNum);
00076     fsc_FLSPerVolume** p = &m_mediumVolumes_p_v[a_volNum];
00077         
00078     if (*p == NULL) {
00079         *p = new fsc_FLSPerVolume(a_volNum);
00080         log_DBG_m(dbg_DETAIL, "Create new fsc_FLSPerVolume");
00081     }
00082     (*p)->Insert(a_fileLoc);
00083     if (m_lastVolIdx < a_volNum) {
00084         m_lastVolIdx = a_volNum;
00085     }
00086 }

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 89 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().

00090                                                                                   {
00091     log_FUNC_m(GetNextFSLPerVolume);
00092     
00093     log_DBG_m(dbg_DETAIL, "m_iterIdx: " << m_iterIdx);
00094     
00095     fsc_FLSPerVolume* p = m_mediumVolumes_p_v[m_iterIdx];
00096     while (  (p == NULL)
00097           && (m_iterIdx <= m_lastVolIdx) ) {
00098         p = m_mediumVolumes_p_v[++m_iterIdx];
00099     }
00100     if (p != NULL) {    
00101         m_mediumVolumes_p_v[m_iterIdx] = NULL; // element is stolen
00102         a_medKey = m_medKey;
00103         // iterIdx not represent volume number.
00104         // This is true only at inser mode.
00105         a_volNum = p->GetVolNum();
00106         log_DBG_m(dbg_DETAIL, "m_iterIdx: " << m_iterIdx 
00107                            << ", a_medKey: " << a_medKey
00108                            << ", a_volNum: " << a_volNum);
00109         ++m_iterIdx;
00110     }
00111     return p;
00112 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fsc_FLSPerMedia::SortList (  ) 

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

00115                                {
00116     log_FUNC_m(SortList);
00117 
00118     m_mediumVolumes_p_v.resize(m_lastVolIdx + 1);
00119         
00120     fsc_FLSPerVolume_p_v_i iter = m_mediumVolumes_p_v.begin();
00121     
00122     for (; iter != m_mediumVolumes_p_v.end(); ++iter) {
00123         fsc_FLSPerVolume* pi = (*iter);
00124         if (pi != NULL) {
00125             pi->SortByOffset();
00126         }
00127     }    
00128 }

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_MediaKey_t fsc_FLSPerMedia::GetMediaKey (  )  [inline]

Definition at line 53 of file fsc_FLSPerMedia.h.

Referenced by fsc_FileLocStorage::GetNextFSLMedium().

00053 { return m_medKey; };

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from stx_CacheEl.

Definition at line 53 of file fsc_FLSPerMedia.h.

Definition at line 58 of file fsc_FLSPerMedia.h.

Referenced by GetNextFSLPerVolume().

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 63 of file fsc_FLSPerMedia.h.

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

Definition at line 65 of file fsc_FLSPerMedia.h.

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

Definition at line 67 of file fsc_FLSPerMedia.h.

Referenced by GetNextFSLPerVolume().


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

Generated on Mon Feb 27 19:20:40 2012 for OPENARCHIVE by  doxygen 1.5.6