#include <fsc_FLSPerMedia.h>


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_FLSPerVolume * | GetNextFSLPerVolume (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 |
| 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 }
| 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 }

| 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 }


| 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 }


| 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; };

fsc_FLSPerMedia::log_CLASSID_m [private] |
ivd_MediaKey_t fsc_FLSPerMedia::m_medKey [private] |
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().
ivd_MedVolNum_t fsc_FLSPerMedia::m_lastVolIdx [private] |
Definition at line 65 of file fsc_FLSPerMedia.h.
Referenced by GetNextFSLPerVolume(), Insert(), SortList(), and ~fsc_FLSPerMedia().
int fsc_FLSPerMedia::m_iterIdx [private] |
1.5.6