#include <fsc_nsDirEntryVec.h>


Definition at line 38 of file fsc_nsDirEntryVec.h.
Public Member Functions | |
| fsc_nsDirEntryVec () | |
| It is used when owner is not yet known. | |
| fsc_nsDirEntryVec (UInt8_t a_vectorSize, ivd_RecordIDX_t a_idx) | |
| It creates nsDirEntryVec object filled with members got from DB on index a_idx. | |
| fsc_nsDirEntryVec (ivd_RecordIDX_t a_nextMemberIdx, fsc_nsDirEntryVec *a_nextDirEntryVec_p) | |
| Create 256 sized vector with. | |
| ~fsc_nsDirEntryVec (void) | |
| void | Init (ivd_RecordIDX_t a_nextMemberIdx, fsc_nsDirEntryVec *a_nextDirEntryVec_p) |
| to initialize again abbandon vector | |
| bool | RemoveEntry (ivd_RecordIDX_t a_idxToRemove, ivd_RecordIDX_t a_idxToReplace) |
| If a_idxToRemove is in vector then replace it with a_idxToReplace and return true, otherwice try in next vector. | |
| bool | RemoveEntryFromNextVec (ivd_RecordIDX_t a_idxToRemove, ivd_RecordIDX_t a_idxToReplace) |
| check if next vector idx exist and if is creatted. | |
| bool | Write2DB (UInt8_t &a_numOfElement, ivd_RecordIDX_t &a_recordIdx, fio_Transaction &a_trans) |
| If vector is changed then write2DB method perform its actions. | |
| void | Clear () |
| ivd_RecordIDX_t | GetNextMemberIdx () |
| fsc_nsDirEntryVec * | GetNextDirEntryVecPtr () |
| bool | IsLastInChain () |
| void | Dump (ostream &os) |
Public Attributes | |
| log_CLASSID_m | |
Private Member Functions | |
| bool | Write2DB (ivd_RecordIDX_t &a_recordIdx, fio_Transaction &a_trans) |
| If vector is changed then write2DB method perform its actions. | |
| void | CreateNextVector () |
Private Attributes | |
| fsc_nsDirEntryVec * | m_nextDirEntryVec_p |
Friends | |
| class | ut_fsc_nsDirEntryVec |
| fsc_nsDirEntryVec::fsc_nsDirEntryVec | ( | ) |
It is used when owner is not yet known.
Definition at line 37 of file fsc_nsDirEntryVec.cpp.
References log_FUNC_m.
Referenced by CreateNextVector(), and fsc_nsDirEntryVec().
00038 : m_nextDirEntryVec_p(NULL) { 00039 00040 log_FUNC_m(fsc_nsDirEntryMgr); 00041 }

| fsc_nsDirEntryVec::fsc_nsDirEntryVec | ( | UInt8_t | a_vectorSize, | |
| ivd_RecordIDX_t | a_idx | |||
| ) |
It creates nsDirEntryVec object filled with members got from DB on index a_idx.
if a_idx is 0 no members are generatted.
Definition at line 46 of file fsc_nsDirEntryVec.cpp.
References fsc_nsDirEntryVec(), log_FUNC_m, and size.
00048 : fsc_nsDirEntryFormattedVec(a_vectorSize, a_idx), 00049 m_nextDirEntryVec_p(NULL) { 00050 00051 log_FUNC_m(fsc_nsDirEntryVec(size, idx)); 00052 }

| fsc_nsDirEntryVec::fsc_nsDirEntryVec | ( | ivd_RecordIDX_t | a_nextMemberIdx, | |
| fsc_nsDirEntryVec * | a_nextDirEntryVec_p | |||
| ) |
Create 256 sized vector with.
Definition at line 57 of file fsc_nsDirEntryVec.cpp.
00059 : fsc_nsDirEntryFormattedVec(a_nextMemberIdx), 00060 m_nextDirEntryVec_p(a_nextDirEntryVec_p){ 00061 // log_FUNC_m(fsc_nsDirEntryVec); 00062 }
| fsc_nsDirEntryVec::~fsc_nsDirEntryVec | ( | void | ) |
Definition at line 67 of file fsc_nsDirEntryVec.cpp.
References log_FUNC_m, m_nextDirEntryVec_p, and NULL.
00067 { 00068 log_FUNC_m(~fsc_nsDirEntryVec); 00069 00070 if (m_nextDirEntryVec_p != NULL) { 00071 delete m_nextDirEntryVec_p; 00072 } 00073 }
| void fsc_nsDirEntryVec::Init | ( | ivd_RecordIDX_t | a_nextMemberIdx, | |
| fsc_nsDirEntryVec * | a_nextDirEntryVec_p | |||
| ) |
to initialize again abbandon vector
Definition at line 78 of file fsc_nsDirEntryVec.cpp.
References fsc_nsDirEntryFormattedVec::Init(), log_FUNC_m, and m_nextDirEntryVec_p.
Referenced by fsc_nsDirEntryMgr::AddEntry().
00079 { 00080 log_FUNC_m(Init); 00081 00082 m_nextDirEntryVec_p = a_nextDirEntryVec_p; 00083 fsc_nsDirEntryFormattedVec::Init(a_nextMemberIdx); 00084 }


| bool fsc_nsDirEntryVec::RemoveEntry | ( | ivd_RecordIDX_t | a_idxToRemove, | |
| ivd_RecordIDX_t | a_idxToReplace | |||
| ) |
If a_idxToRemove is in vector then replace it with a_idxToReplace and return true, otherwice try in next vector.
If element is not found return false
Reimplemented from fsc_nsDirEntryFormattedVec.
Definition at line 89 of file fsc_nsDirEntryVec.cpp.
References log_FUNC_m, fsc_nsDirEntryFormattedVec::RemoveEntry(), and RemoveEntryFromNextVec().
Referenced by RemoveEntryFromNextVec().
00090 { 00091 log_FUNC_m(RemoveEntry); 00092 if (fsc_nsDirEntryFormattedVec::RemoveEntry(a_idxToRemove, a_idxToReplace)) { 00093 return true; 00094 } 00095 else { 00096 return RemoveEntryFromNextVec(a_idxToRemove, a_idxToReplace); 00097 } 00098 }


| bool fsc_nsDirEntryVec::RemoveEntryFromNextVec | ( | ivd_RecordIDX_t | a_idxToRemove, | |
| ivd_RecordIDX_t | a_idxToReplace | |||
| ) |
check if next vector idx exist and if is creatted.
If it is not creatted then create it and call its RemoveEntry method.
Definition at line 103 of file fsc_nsDirEntryVec.cpp.
References CreateNextVector(), log_FUNC_m, m_nextDirEntryVec_p, fsc_nsDirEntryFormattedVec::m_nextVecIdx_p, NULL, and RemoveEntry().
Referenced by RemoveEntry(), and fsc_nsDirEntryMgr::RemoveEntry().
00104 { 00105 00106 log_FUNC_m(RemoveEntryFromNextVec); 00107 if (m_nextDirEntryVec_p != NULL) { 00108 // continue 00109 } 00110 else if (*m_nextVecIdx_p != 0) { 00111 CreateNextVector(); 00112 } 00113 else { 00114 // @todo write a warning in ivd.log that directory entry missing. 00115 return false; 00116 } 00117 return m_nextDirEntryVec_p->RemoveEntry(a_idxToRemove, a_idxToReplace); 00118 }


| bool fsc_nsDirEntryVec::Write2DB | ( | UInt8_t & | a_numOfElement, | |
| ivd_RecordIDX_t & | a_recordIdx, | |||
| fio_Transaction & | a_trans | |||
| ) |
If vector is changed then write2DB method perform its actions.
If method is called from fsc_nsDirEntryVec object then a_firstInVecChain parameter must be false
Reimplemented from fsc_nsDirEntryFormattedVec.
Definition at line 123 of file fsc_nsDirEntryVec.cpp.
References dbg_DETAIL, log_DBG_m, log_FUNC_m, fio_Vector::m_changed, m_nextDirEntryVec_p, fsc_nsDirEntryFormattedVec::m_nextVecIdx_p, NULL, fsc_nsDirEntryFormattedVec::Write2DB(), and Write2DB().
Referenced by Write2DB(), and fsc_nsDirEntryMgr::Write2DB().
00125 { 00126 00127 log_FUNC_m(Write2DB(numOfElement)); 00128 00129 // if next vector exist call its write2DB method first and get record index. 00130 if (m_nextDirEntryVec_p != NULL) { 00131 if (m_nextDirEntryVec_p->Write2DB(*m_nextVecIdx_p, a_trans)) { 00132 m_changed = true; 00133 } 00134 log_DBG_m(dbg_DETAIL, "Write chained vectors first. on idx " << *m_nextVecIdx_p); 00135 } 00136 return fsc_nsDirEntryFormattedVec::Write2DB(a_numOfElement, a_recordIdx, a_trans); 00137 }


| bool fsc_nsDirEntryVec::Write2DB | ( | ivd_RecordIDX_t & | a_recordIdx, | |
| fio_Transaction & | a_trans | |||
| ) | [private] |
If vector is changed then write2DB method perform its actions.
This method must be called only from fsc_nsDirEntryVec
Reimplemented from fsc_nsDirEntryFormattedVec.
Definition at line 142 of file fsc_nsDirEntryVec.cpp.
References log_FUNC_m, fio_Vector::m_changed, m_nextDirEntryVec_p, fsc_nsDirEntryFormattedVec::m_nextVecIdx_p, NULL, fsc_nsDirEntryFormattedVec::Write2DB(), and Write2DB().
00143 { 00144 log_FUNC_m(Write2DB); 00145 // if next vector exist call its write2DB method first and get record index. 00146 if (m_nextDirEntryVec_p != NULL) { 00147 if (m_nextDirEntryVec_p->Write2DB(*m_nextVecIdx_p, a_trans)) { 00148 m_changed = true; 00149 } 00150 } 00151 return fsc_nsDirEntryFormattedVec::Write2DB(a_recordIdx, a_trans); 00152 }

| void fsc_nsDirEntryVec::Clear | ( | void | ) |
Reimplemented from fsc_nsDirEntryFormattedVec.
Definition at line 165 of file fsc_nsDirEntryVec.cpp.
References fsc_nsDirEntryFormattedVec::Clear(), log_FUNC_m, m_nextDirEntryVec_p, and NULL.
Referenced by fsc_nsDirEntryMgr::RemoveEntry().
00165 { 00166 log_FUNC_m(Clear); 00167 fsc_nsDirEntryFormattedVec::Clear(); 00168 m_nextDirEntryVec_p = NULL; 00169 }


| ivd_RecordIDX_t fsc_nsDirEntryVec::GetNextMemberIdx | ( | ) | [inline] |
Definition at line 91 of file fsc_nsDirEntryVec.h.
References fsc_nsDirEntryFormattedVec::m_nextVecIdx_p.
00091 {return *m_nextVecIdx_p;};
| fsc_nsDirEntryVec * fsc_nsDirEntryVec::GetNextDirEntryVecPtr | ( | ) |
Definition at line 174 of file fsc_nsDirEntryVec.cpp.
References CreateNextVector(), log_FUNC_m, m_nextDirEntryVec_p, fsc_nsDirEntryFormattedVec::m_nextVecIdx_p, and NULL.
Referenced by fsc_RawScan::DirTreeWalk(), Dump(), and fsc_nsDirEntryMgr::RemoveEntry().
00174 { 00175 log_FUNC_m(GetNextDirEntryVecPtr); 00176 if (m_nextDirEntryVec_p != NULL) { 00177 // continue 00178 } 00179 else if (*m_nextVecIdx_p != 0) { 00180 CreateNextVector(); 00181 } 00182 return m_nextDirEntryVec_p; 00183 }


| bool fsc_nsDirEntryVec::IsLastInChain | ( | ) | [inline] |
Definition at line 94 of file fsc_nsDirEntryVec.h.
References m_nextDirEntryVec_p, fsc_nsDirEntryFormattedVec::m_nextVecIdx_p, and NULL.
00094 { 00095 return (*m_nextVecIdx_p == 0) 00096 && (m_nextDirEntryVec_p == NULL); 00097 // vector has no next one 00098 };
| void fsc_nsDirEntryVec::Dump | ( | ostream & | os | ) |
Reimplemented from fsc_nsDirEntryFormattedVec.
Definition at line 187 of file fsc_nsDirEntryVec.cpp.
References Dump(), fsc_nsDirEntryFormattedVec::Dump(), GetNextDirEntryVecPtr(), m_nextDirEntryVec_p, and NULL.
Referenced by Dump(), and fsc_nsDirEntryMgr::Dump().
00187 { 00188 fsc_nsDirEntryFormattedVec::Dump(os); 00189 GetNextDirEntryVecPtr(); 00190 if (m_nextDirEntryVec_p != NULL) { 00191 m_nextDirEntryVec_p->Dump(os); 00192 } 00193 }


| void fsc_nsDirEntryVec::CreateNextVector | ( | ) | [private] |
Definition at line 157 of file fsc_nsDirEntryVec.cpp.
References c_maxRFVecSize, fsc_nsDirEntryVec(), log_FUNC_m, m_nextDirEntryVec_p, and fsc_nsDirEntryFormattedVec::m_nextVecIdx_p.
Referenced by GetNextDirEntryVecPtr(), and RemoveEntryFromNextVec().
00157 { 00158 log_FUNC_m(CreateNextVector); 00159 m_nextDirEntryVec_p = new fsc_nsDirEntryVec(c_maxRFVecSize, *m_nextVecIdx_p); 00160 }


friend class ut_fsc_nsDirEntryVec [friend] |
Definition at line 39 of file fsc_nsDirEntryVec.h.
Definition at line 111 of file fsc_nsDirEntryVec.h.
Referenced by Clear(), CreateNextVector(), Dump(), GetNextDirEntryVecPtr(), Init(), IsLastInChain(), RemoveEntryFromNextVec(), Write2DB(), and ~fsc_nsDirEntryVec().
1.5.6