fsc_Generation Class Reference
[File System Catalog]

#include <fsc_Generation.h>

Inheritance diagram for fsc_Generation:

Inheritance graph
[legend]
Collaboration diagram for fsc_Generation:

Collaboration graph
[legend]

List of all members.


Detailed Description

<Description:> A more elaborate class description that describes all aspects of class usage etc.

Author:
Dejan Volk Lupo, HERMES SoftLab
See also:
<reference>

Definition at line 35 of file fsc_Generation.h.


Public Member Functions

 fsc_Generation ()
 fsc_Generation (df_SplitInfo &a_splitInfo)
 fsc_Generation (const fsc_Generation_t &a_generation)
 ~fsc_Generation ()
void Insert (df_SplitInfo &a_splitInfo)
 Insert a split into Data location tree.
void Remove (ivd_MediaKey_t a_mediumKey, ivd_MedVolNum_t a_medVolNum)
 remove all entries from particular volume.
bool Remove (ivd_MediaKey_t a_mediumKey, ivd_MedVolNum_t a_medVolNum, UInt32_t a_blockOffs)
 Remove one particular entry.
void GetCopiesPos (ivd_CopiesPos_v_t &a_copiesPos_v, fsc_MigInfo_t &a_migInfo)
 Get all copies from this generation.
bool Write2DB (fsc_Generation_t &a_genData, fio_Transaction &a_trans)
 invoke next level write2DB and collect data for previous level
void Dump (ostream &os)
bool TreeWalk (fsc_Collector &a_collector)

Public Attributes

ivd_MigrationID_t m_migrationID
ivd_FileSize_t m_size
 the size of the file
ivd_DataType_t m_dataType
 all data type that are stored in splits
 log_CLASSID_m

Private Member Functions

void ReadMembers ()
 create and read next level members

Constructor & Destructor Documentation

fsc_Generation::fsc_Generation (  )  [inline]

Definition at line 38 of file fsc_Generation.h.

Referenced by fsc_Generation().

00038 {};

Here is the caller graph for this function:

fsc_Generation::fsc_Generation ( df_SplitInfo a_splitInfo  ) 

Definition at line 38 of file fsc_Generation.cpp.

References dlc_MediaPos, dlc_Split, df_SplitInfo::Dump(), fsc_Generation(), ie_FSC_TOO_MUCH_COPIES, fsc_Entry::InitNextEntry(), df_SplitInfo::lastSplit, log_FUNC_m, maxNumOfCopies_c, df_SplitInfo::noCopies, and df_SplitInfo::splitOffset.

00039             :
00040             fsc_Entry(),
00041             m_migrationID(a_splitInfo.migrationID),
00042 //  FIX bug 1228    m_size(a_splitInfo.fileSize),
00043             m_size(a_splitInfo.lastSplit // size is defined when last split is insertted
00044                    ? a_splitInfo.splitOffset + a_splitInfo.splitSize
00045                    : 0), 
00046             m_dataType(a_splitInfo.dataType)
00047 {
00048     log_FUNC_m(fsc_Generation(df_SplitInfo));
00049 
00050     if (a_splitInfo.noCopies > maxNumOfCopies_c) {
00051         throw ivd_InternalError(ie_FSC_TOO_MUCH_COPIES, 
00052             "Front end agent created too many copies." + a_splitInfo.Dump(), true);
00053     }
00054 
00055 /*    if (a_splitInfo.noCopies > 1) {
00056         fsc_Entry::InitNextEntry(dlc_Copy, new fsc_CopyMgr(a_splitInfo));        
00057     }
00058     else */
00059     if ( !a_splitInfo.lastSplit
00060             || a_splitInfo.splitOffset > 0) { //FIX  bug 680  if split then generate another empty
00061         fsc_Entry::InitNextEntry(dlc_Split, new fsc_SplitMgr(a_splitInfo));     
00062     }
00063     else {
00064         fsc_Entry::InitNextEntry(dlc_MediaPos, new fsc_MedPosMgr(a_splitInfo));        
00065     }
00066 }
//============================================================================//

Here is the call graph for this function:

fsc_Generation::fsc_Generation ( const fsc_Generation_t a_generation  ) 

Definition at line 69 of file fsc_Generation.cpp.

References dbg_DETAIL, fsc_Generation(), log_DBG_m, log_FUNC_m, fsc_Generation_t::migrationID, and fsc_Generation_t::size.

00071             :
00072             fsc_Entry(a_generation.nextEntity),
00073             m_migrationID(a_generation.migrationID),
00074             m_size(a_generation.size),
00075             m_dataType(a_generation.nextEntity.dataType)
00076 {
00077     log_FUNC_m(fsc_Generation(fsc_generation_t));
00078 
00079     log_DBG_m(dbg_DETAIL,"fsc_Generation_t  migId " << a_generation.migrationID
00080                        << " size " << a_generation.size );
00081 //    a_generation.nextEntity.Dbg();
00082 }
//============================================================================//

Here is the call graph for this function:

fsc_Generation::~fsc_Generation (  ) 

Definition at line 85 of file fsc_Generation.cpp.

00086 {
00087 }


Member Function Documentation

void fsc_Generation::Insert ( df_SplitInfo a_splitInfo  ) 

Insert a split into Data location tree.

Definition at line 90 of file fsc_Generation.cpp.

References fsc_SplitMgr::AddSplit(), fsc_CopyMgr::AddSplit(), cmn_Num2Str(), df_SplitInfo::dataType, dbg_DETAIL, dlc_Copy, dlc_MediaPos, dlc_Split, fsc_NextEntity_t::dlcType, df_SplitInfo::Dump(), ie_INVALID_ARG, fsc_Entry::Init(), fsc_MedPosMgr::IsItEqual(), df_SplitInfo::lastSplit, log_DBG_m, log_FUNC_m, fsc_Entry::m_changed, m_dataType, fsc_Entry::m_entryMgr_p, fsc_Entry::m_nextEntry, m_size, fsc_SplitMgr::m_split_p_l, ReadMembers(), sp_ALREADY_ADDED, sp_CHECK_OTHER_COPIES, sp_INSERTTED, sp_NEW_COPY, sp_REPLACE, df_SplitInfo::splitOffset, and df_SplitInfo::splitSize.

00090                                                       {
00091     log_FUNC_m(Insert);
00092 
00093     ReadMembers();
00094 
00095     // check if some new data type is add
00096     ivd_DataType_t previousDataType = m_dataType; 
00097     ivd_DataType_t dataType         = m_dataType | a_splitInfo.dataType; 
00098     if ( dataType != m_dataType) {
00099         m_dataType = dataType;
00100         m_changed  = true;
00101     }
00102     // fix bug 1228
00103     // when lastSplit is got and size is not updated, update it
00104     if (   a_splitInfo.lastSplit
00105         && (m_size < (a_splitInfo.splitOffset + a_splitInfo.splitSize))) { // 
00106         m_size = a_splitInfo.splitOffset + a_splitInfo.splitSize;
00107         m_changed  = true;
00108     }
00109     
00110     switch (m_nextEntry.dlcType) {
00111         case dlc_Copy : {
00112             log_DBG_m(dbg_DETAIL, "gen: add to copyMgr");
00113             fsc_CopyMgr* copyMgr_p = static_cast<fsc_CopyMgr*>(m_entryMgr_p);
00114             fsc_Split* split_p = new fsc_Split(a_splitInfo);
00115             // it's up to copyMgr or next objects in hierarhy to use or delete split_p
00116             copyMgr_p->AddSplit(split_p);
00117         }
00118         break;
00119 
00120         case dlc_Split : {
00121             log_DBG_m(dbg_DETAIL, "gen: add to splitMgr");
00122             fsc_SplitMgr* splitMgr_p = static_cast<fsc_SplitMgr*>(m_entryMgr_p);
00123             fsc_Split* split_p = new fsc_Split(a_splitInfo);
00124             fsc_Split_p_l_i possibleInsertPoint;
00125             fsc_Split_p_l_t replacedSplit_p_l;
00126             switch (splitMgr_p->AddSplit(split_p, possibleInsertPoint, replacedSplit_p_l)) {
00127             case sp_INSERTTED : 
00128                 log_DBG_m(dbg_DETAIL, "gen: INSERTTED");
00129                 return;
00130 
00131             case sp_CHECK_OTHER_COPIES :  // if no other places then use possibleInsertPoint
00132                 log_DBG_m(dbg_DETAIL, "gen: CHECK_OTHER_COPIES");
00133                 splitMgr_p->m_split_p_l.insert(possibleInsertPoint, split_p);
00134                 return;
00135 
00136             case sp_NEW_COPY : {
00137                 log_DBG_m(dbg_DETAIL, "gen: NEW_COPY");
00138                 fsc_CopyMgr* copyMgr_p = new fsc_CopyMgr(dlc_Split, splitMgr_p, previousDataType);
00139                 m_entryMgr_p = copyMgr_p;
00140                 fsc_Entry::Init(dlc_Copy, 2, m_entryMgr_p);
00141                 // TODO added split is checked twice for fit into same copy
00142                 // once as generation and second as multi copy.
00143                 copyMgr_p->AddSplit(split_p);
00144             }
00145             break;
00146             case sp_REPLACE : { // expect some splits in replacedSplit_p_l list
00147                log_DBG_m(dbg_DETAIL, "gen: REPLACE");
00148                 m_entryMgr_p = new fsc_CopyMgr(dlc_Split, splitMgr_p, previousDataType);
00149                 fsc_Entry::Init(dlc_Copy, 2, m_entryMgr_p);
00150                 fsc_CopyMgr* copyMgr_p = static_cast<fsc_CopyMgr*>(m_entryMgr_p);
00151                 fsc_Split_p_l_i iter = replacedSplit_p_l.begin();
00152                 for ( ; iter != replacedSplit_p_l.end(); ++iter ) {
00153                     // NOTE: recursion, call this method again
00154                     copyMgr_p->AddSplit(*iter); // insert it again
00155                 }                
00156             }
00157             break;
00158 
00159             case sp_ALREADY_ADDED :
00160                 log_DBG_m(dbg_DETAIL, "gen: ALREADY_ADDED");
00161                 delete split_p;
00162                 return;
00163             default : ;
00164             }
00165         }
00166         break;
00167 
00168         case dlc_MediaPos : {  
00169                 log_DBG_m(dbg_DETAIL, "gen: add to medPosMgr");
00170                 fsc_MedPosMgr* medPosMgr_p = static_cast<fsc_MedPosMgr*>(m_entryMgr_p);
00171                 if (medPosMgr_p->IsItEqual(a_splitInfo)) {
00172                     return;
00173                 }
00174                 // new copy of same split
00175                 fsc_CopyMgr* copyMgr_p = new fsc_CopyMgr(dlc_MediaPos, medPosMgr_p, previousDataType);
00176                 m_entryMgr_p = copyMgr_p;
00177                 fsc_Entry::Init(dlc_Copy, 2, m_entryMgr_p);                         
00178                 fsc_Split* split_p = new fsc_Split(a_splitInfo);
00179                 copyMgr_p->AddSplit(split_p);
00180         }
00181         break;
00182 
00183         default:
00184             throw ivd_InternalError(ie_INVALID_ARG, 
00185                 "Wrong dlcType =" + cmn_Num2Str((int)m_nextEntry.dlcType)+ a_splitInfo.Dump(), true);
00186             break;
00187     }
00188 }

Here is the call graph for this function:

void fsc_Generation::Remove ( ivd_MediaKey_t  a_mediumKey,
ivd_MedVolNum_t  a_medVolNum 
)

remove all entries from particular volume.

Definition at line 191 of file fsc_Generation.cpp.

References cmn_Num2Str(), dlc_Copy, dlc_MediaPos, dlc_NotUsed, dlc_Split, fsc_NextEntity_t::dlcType, ie_INVALID_ARG, log_FUNC_m, fsc_Entry::m_entryMgr_p, fsc_Entry::m_nextEntry, ReadMembers(), fsc_MedPosMgr::Remove(), fsc_CopyMgr::Remove(), and fsc_SplitMgr::RemoveEntry().

Referenced by Remove().

00192                                                              {
00193     log_FUNC_m(Remove);
00194     ReadMembers();
00195     
00196     switch (m_nextEntry.dlcType) {
00197     case dlc_NotUsed :
00198          return;
00199     case dlc_Copy : {
00200             fsc_CopyMgr* p = static_cast<fsc_CopyMgr*>(m_entryMgr_p);
00201             p->Remove(a_mediumKey, a_medVolNum);
00202         }
00203         return;
00204 
00205     case dlc_Split : {
00206             fsc_SplitMgr* p = static_cast<fsc_SplitMgr*>(m_entryMgr_p);
00207             p->RemoveEntry(a_mediumKey, a_medVolNum);
00208         }
00209         return;
00210 
00211     case dlc_MediaPos : {
00212             fsc_MedPosMgr* p = static_cast<fsc_MedPosMgr*>(m_entryMgr_p);
00213             p->Remove(a_mediumKey, a_medVolNum);
00214         }
00215         return;
00216 
00217     default:
00218         throw ivd_InternalError(ie_INVALID_ARG, 
00219             "Wrong dlcType =" + cmn_Num2Str((int)m_nextEntry.dlcType), true);
00220         break;
00221     }
00222 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool fsc_Generation::Remove ( ivd_MediaKey_t  a_mediumKey,
ivd_MedVolNum_t  a_medVolNum,
UInt32_t  a_blockOffs 
)

Remove one particular entry.

Definition at line 225 of file fsc_Generation.cpp.

References cmn_Num2Str(), dlc_Copy, dlc_MediaPos, dlc_NotUsed, dlc_Split, fsc_NextEntity_t::dlcType, ie_INVALID_ARG, log_FUNC_m, fsc_Entry::m_entryMgr_p, fsc_Entry::m_nextEntry, ReadMembers(), fsc_MedPosMgr::Remove(), fsc_CopyMgr::Remove(), Remove(), and fsc_SplitMgr::RemoveEntry().

00227                                                              {
00228     log_FUNC_m(Remove);
00229     ReadMembers();
00230     
00231     switch (m_nextEntry.dlcType) {
00232     case dlc_NotUsed :
00233          return false;
00234     case dlc_Copy : {
00235             fsc_CopyMgr* p = static_cast<fsc_CopyMgr*>(m_entryMgr_p);
00236             return p->Remove(a_mediumKey, a_medVolNum, a_blockOffs);
00237         }
00238         break;
00239 
00240     case dlc_Split : {
00241             fsc_SplitMgr* p = static_cast<fsc_SplitMgr*>(m_entryMgr_p);
00242             return p->RemoveEntry(a_mediumKey, a_medVolNum, a_blockOffs);
00243         }
00244         break;
00245 
00246     case dlc_MediaPos : {
00247             fsc_MedPosMgr* p = static_cast<fsc_MedPosMgr*>(m_entryMgr_p);
00248             return p->Remove(a_mediumKey, a_medVolNum, a_blockOffs);
00249         }
00250         break;
00251 
00252     default:
00253         throw ivd_InternalError(ie_INVALID_ARG, 
00254             "Wrong dlcType =" + cmn_Num2Str((int)m_nextEntry.dlcType), true);
00255         break;
00256     }
00257 }

Here is the call graph for this function:

void fsc_Generation::GetCopiesPos ( ivd_CopiesPos_v_t a_copiesPos_v,
fsc_MigInfo_t a_migInfo 
)

Get all copies from this generation.

Definition at line 260 of file fsc_Generation.cpp.

References cmn_Num2Str(), ivd_MediaPos_t::dataType, dlc_Copy, dlc_MediaPos, dlc_Split, fsc_NextEntity_t::dlcType, fsc_CopyMgr::GetCopiesPos(), fsc_MedPosMgr::GetMediaPos(), fsc_SplitMgr::GetMediaPos(), ie_INVALID_ARG, log_FUNC_m, m_dataType, fsc_MigInfo_t::m_dataType, fsc_Entry::m_entryMgr_p, fsc_MigInfo_t::m_migId, m_migrationID, fsc_Entry::m_nextEntry, m_size, fsc_MigInfo_t::m_size, ReadMembers(), ivd_MediaPos_t::splitOffset, and ivd_MediaPos_t::splitSize.

Referenced by fsc_GenerationMgr::GetCopiesPos().

00260                                                                                             {
00261     log_FUNC_m(GetCopiesPos);
00262 
00263     ReadMembers();
00264 
00265     // fix bug 736
00266     a_migInfo.m_migId    = m_migrationID;
00267     a_migInfo.m_size     = m_size;
00268     a_migInfo.m_dataType = m_dataType;
00269 
00270     switch (m_nextEntry.dlcType) {
00271     case dlc_Copy : {
00272 //            a_copiesPos.resize(m_nextEntry.Vector.NumOfElement);
00273         fsc_CopyMgr *copyMgr_p = static_cast<fsc_CopyMgr*>(m_entryMgr_p);
00274         copyMgr_p->GetCopiesPos(a_copiesPos_v, a_migInfo);
00275         }
00276         break;
00277 
00278     case dlc_Split : {// TODO check copy ID and no of copies
00279         a_copiesPos_v.resize(1);    // one copy
00280         fsc_SplitMgr *splitMgr_p = static_cast<fsc_SplitMgr*>(m_entryMgr_p);
00281         splitMgr_p->GetMediaPos(a_copiesPos_v.back(), a_migInfo);
00282         if (a_copiesPos_v.back().size() == 0) {
00283             a_copiesPos_v.clear();
00284         }
00285         }
00286         break;
00287 
00288     case dlc_MediaPos : {
00289         a_copiesPos_v.resize(1);    // one copy
00290         a_copiesPos_v[0].resize(1); // one split
00291         fsc_MedPosMgr *medPosMgr_p = static_cast<fsc_MedPosMgr*>(m_entryMgr_p);
00292         ivd_MediaPos_t &mediaPos = a_copiesPos_v[0][0];
00293         medPosMgr_p->GetMediaPos(mediaPos);
00294         mediaPos.splitOffset = 0;   
00295         mediaPos.splitSize   = m_size;
00296         mediaPos.dataType    = m_dataType;
00297         }
00298         break;
00299 
00300     default:
00301         throw ivd_InternalError(ie_INVALID_ARG, 
00302             "Wrong dlcType =" + cmn_Num2Str((int)m_nextEntry.dlcType), true);
00303         break;
00304     }
00305 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool fsc_Generation::Write2DB ( fsc_Generation_t a_genData,
fio_Transaction a_trans 
)

invoke next level write2DB and collect data for previous level

Definition at line 379 of file fsc_Generation.cpp.

References cmn_Num2Str(), fsc_NextEntity_t::dataType, dlc_Copy, dlc_MediaPos, dlc_Split, fsc_NextEntity_t::dlcType, ie_INVALID_ARG, log_FUNC_m, fsc_Entry::m_changed, m_dataType, fsc_Entry::m_entryMgr_p, m_migrationID, fsc_Entry::m_nextEntry, m_size, fsc_Generation_t::migrationID, fsc_Generation_t::nextEntity, NULL, fsc_Generation_t::size, fsc_MedPosMgr::Write2DB(), fsc_SplitMgr::Write2DB(), and fsc_CopyMgr::Write2DB().

Referenced by fsc_GenerationMgr::Write2DB().

00380                                                          {
00381     
00382 //    log_DBG_m(dbg_DETAIL, "fsc_Generation::Write2DB ");
00383     bool vecIdxOrSizeChanged = false;
00384 
00385     if (m_entryMgr_p != NULL) {
00386 //        log_DBG_m(dbg_DETAIL, "      m_entryMgr_p != NULL")
00387 
00388         // Write and check if changed next entryes first
00389         switch (m_nextEntry.dlcType) {
00390 
00391         case dlc_Copy : {
00392                 fsc_CopyMgr *copyMgr_p = static_cast<fsc_CopyMgr*>(m_entryMgr_p);
00393                 // update next level data 
00394                 vecIdxOrSizeChanged = copyMgr_p->Write2DB(a_genData.nextEntity,
00395                                                           a_trans);
00396             }
00397             break;
00398 
00399         case dlc_Split : {
00400                 fsc_SplitMgr *splitMgr_p = static_cast<fsc_SplitMgr*>(m_entryMgr_p);
00401                 // update next level data 
00402                 vecIdxOrSizeChanged = splitMgr_p->Write2DB(a_genData.nextEntity,
00403                                                            a_trans);
00404             }
00405             break;
00406 
00407         case dlc_MediaPos : {
00408                 fsc_MedPosMgr *medPosMgr_p = static_cast<fsc_MedPosMgr*>(m_entryMgr_p);
00409                 vecIdxOrSizeChanged = medPosMgr_p->Write2DB(a_genData.nextEntity);
00410             }
00411             break;
00412 
00413         default:
00414             log_FUNC_m(Write2DB);
00415             throw ivd_InternalError(ie_INVALID_ARG, 
00416                 "Wrong dlcType =" + cmn_Num2Str((int)m_nextEntry.dlcType), true);
00417             break;
00418         }
00419         m_nextEntry = a_genData.nextEntity;
00420     }
00421     else { // index and size are the same as at construct time
00422 //        log_DBG_m(dbg_DETAIL, "    m_entryMgr_p == NULL");
00423         a_genData.nextEntity = m_nextEntry;
00424     }
00425 //    a_genData.nextEntity.Dbg();
00426 
00427 
00428     //set data, cause of moving vector. Doesn't mather if was not changed.
00429     a_genData.migrationID = m_migrationID;
00430     a_genData.size        = m_size;
00431     a_genData.nextEntity.dataType = m_dataType;
00432 
00433 //    log_DBG_m(dbg_DETAIL, "WR MigID       = " << m_migrationID << endl <<
00434 //                          "   File size   = " << m_size        << endl <<
00435 //                          "   Data type   = " << hex << m_dataType  << dec  << endl);
00436     // if any data changed send message that was changed
00437 //    log_DBG_m(dbg_DETAIL, " vecIdxOrSizeCahnged " << vecIdxOrSizeChanged
00438 //                       << " m_changed " << m_changed);
00439     if (  vecIdxOrSizeChanged 
00440        || m_changed) {
00441         m_changed = false;
00442         return true;
00443     }
00444 
00445     return false;
00446 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fsc_Generation::Dump ( ostream &  os  ) 

Definition at line 449 of file fsc_Generation.cpp.

References cmn_GetMigFlags(), dlc_Copy, dlc_MediaPos, dlc_Split, fsc_NextEntity_t::dlcType, fsc_MedPosMgr::Dump(), fsc_SplitMgr::Dump(), fsc_CopyMgr::Dump(), log_FUNC_m, m_dataType, fsc_Entry::m_entryMgr_p, m_migrationID, fsc_Entry::m_nextEntry, m_size, ReadMembers(), and cmn_Time::Time2YMDhms().

Referenced by fsc_GenerationMgr::Write2DB().

00449                                      {
00450     log_FUNC_m(Dump);
00451 
00452     ReadMembers();
00453 
00454 //    log_DBG_m(dbg_DETAIL, "Generations : idx =" << a_dataL.generationIdx << endl <<
00455 //        cmn_HexDump(g_gensData, firstVecSize * sizeof(fsc_Generation_t), sizeof(fsc_Generation_t), false) );
00456             
00457     cmn_Time t(m_migrationID >> 8);
00458     os << "       MigID           "  << m_migrationID << " " << t.Time2YMDhms() << ";" << (m_migrationID & 0xFF) << endl;
00459     os << "       Generation size "  << m_size << endl;
00460     os << "       Mig Flags:      "  << hex << m_dataType <<  dec << "  " 
00461         << cmn_GetMigFlags(m_dataType) << endl;
00462 
00463     switch (m_nextEntry.dlcType) {
00464     case dlc_Copy : {
00465 //            a_copiesPos.resize(m_nextEntry.Vector.NumOfElement);
00466         fsc_CopyMgr *copyMgr_p = static_cast<fsc_CopyMgr*>(m_entryMgr_p);
00467         copyMgr_p->Dump(os);
00468         }
00469         break;
00470 
00471     case dlc_Split : {// TODO check copy ID and no of copies
00472         fsc_SplitMgr *splitMgr_p = static_cast<fsc_SplitMgr*>(m_entryMgr_p);
00473         splitMgr_p->Dump(os);
00474         }
00475         break;
00476 
00477     case dlc_MediaPos : {
00478         fsc_MedPosMgr *medPosMgr_p = static_cast<fsc_MedPosMgr*>(m_entryMgr_p);
00479         medPosMgr_p->Dump(os);
00480         }
00481         break;
00482 
00483     default:
00484         os << "           Wrong dlcType "  << (int)m_nextEntry.dlcType << endl;
00485 
00486         break;
00487     }
00488 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool fsc_Generation::TreeWalk ( fsc_Collector a_collector  ) 

Definition at line 308 of file fsc_Generation.cpp.

References cmn_Num2Str(), dlc_Copy, dlc_MediaPos, dlc_Split, fsc_NextEntity_t::dlcType, ie_INVALID_ARG, log_FUNC_m, fsc_Entry::m_entryMgr_p, fsc_Entry::m_nextEntry, fsc_Collector::ProcObjGeneration(), ReadMembers(), fsc_MedPosMgr::TreeWalk(), fsc_SplitMgr::TreeWalk(), and fsc_CopyMgr::TreeWalk().

00308                                                           {
00309 //    log_FUNC_m(TreeWalk);
00310 
00311     ReadMembers();
00312 
00313     if (!a_collector.ProcObjGeneration(this)) {
00314         return false;
00315     }
00316     switch (m_nextEntry.dlcType) {
00317     case dlc_Copy : {
00318         fsc_CopyMgr *copyMgr_p = static_cast<fsc_CopyMgr*>(m_entryMgr_p);
00319         return copyMgr_p->TreeWalk(a_collector);
00320         }
00321         break;
00322 
00323     case dlc_Split : {// TODO check copy ID and no of copies
00324         fsc_SplitMgr *splitMgr_p = static_cast<fsc_SplitMgr*>(m_entryMgr_p);
00325         return splitMgr_p->TreeWalk(a_collector);
00326         }
00327         break;
00328 
00329     case dlc_MediaPos : {
00330         fsc_MedPosMgr *medPosMgr_p = static_cast<fsc_MedPosMgr*>(m_entryMgr_p);
00331         return medPosMgr_p->TreeWalk(a_collector);
00332         }
00333         break;
00334 
00335     default:
00336         log_FUNC_m(TreeWalk);
00337         throw ivd_InternalError(ie_INVALID_ARG, 
00338             "Wrong dlcType =" + cmn_Num2Str((int)m_nextEntry.dlcType), true);
00339         break;
00340     }
00341     return true;
00342 }

Here is the call graph for this function:

void fsc_Generation::ReadMembers (  )  [private]

create and read next level members

Definition at line 345 of file fsc_Generation.cpp.

References cmn_Num2Str(), dbg_DETAIL, dlc_Copy, dlc_MediaPos, dlc_Split, fsc_NextEntity_t::dlcType, fsc_Vector_t::entryIdx, ie_INVALID_ARG, log_DBG_m, log_FUNC_m, m_dataType, fsc_Entry::m_entryMgr_p, fsc_Entry::m_nextEntry, NULL, fsc_Vector_t::numOfElement, and fsc_NextEntity_t::vector.

Referenced by Dump(), GetCopiesPos(), Insert(), Remove(), and TreeWalk().

00345                                  {
00346     log_FUNC_m(ReadMembers);
00347 
00348     log_DBG_m(dbg_DETAIL, "m_entryMgr_p = 0x" << hex << m_entryMgr_p
00349                        << " dlcType = 0x" << (int)m_nextEntry.dlcType << dec);
00350     if (m_entryMgr_p == NULL) {
00351             switch (m_nextEntry.dlcType) {
00352             case dlc_Copy :
00353                 m_entryMgr_p = new fsc_CopyMgr(m_nextEntry.vector.numOfElement, 
00354                                                m_nextEntry.vector.entryIdx,
00355                                                m_dataType);
00356                 break;
00357 
00358             case dlc_Split :
00359                 m_entryMgr_p = new fsc_SplitMgr(m_nextEntry.vector.numOfElement, 
00360                                                 m_nextEntry.vector.entryIdx);
00361                 break;
00362 
00363             case dlc_MediaPos :
00364                 m_entryMgr_p = new fsc_MedPosMgr(m_nextEntry);
00365                 break;
00366 
00367             default:
00368                 log_FUNC_m(ReadMembers);
00369                 throw ivd_InternalError(ie_INVALID_ARG, 
00370                     "Wrong dlcType =" + cmn_Num2Str((int)m_nextEntry.dlcType), true);
00371                 break;
00372             }
00373 //        }
00374     }
00375 
00376 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

all data type that are stored in splits

Definition at line 51 of file fsc_Generation.h.

Referenced by Dump(), GetCopiesPos(), Insert(), fsc_SplitInfoCollector::ProcObjGeneration(), fsc_ColGeneration::ProcObjGenerationMgr(), ReadMembers(), and Write2DB().

Reimplemented from fsc_Entry.

Definition at line 54 of file fsc_Generation.h.


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

Generated on Mon Feb 27 19:21:06 2012 for OPENARCHIVE by  doxygen 1.5.6