fsc_nsDirEntryVec Class Reference
[G_new_group]

#include <fsc_nsDirEntryVec.h>

Inheritance diagram for fsc_nsDirEntryVec:

Inheritance graph
[legend]
Collaboration diagram for fsc_nsDirEntryVec:

Collaboration graph
[legend]

List of all members.


Detailed Description

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_nsDirEntryVecGetNextDirEntryVecPtr ()
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_nsDirEntryVecm_nextDirEntryVec_p

Friends

class ut_fsc_nsDirEntryVec

Constructor & Destructor Documentation

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 }

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

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 }


Member Function Documentation

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class ut_fsc_nsDirEntryVec [friend]

Definition at line 39 of file fsc_nsDirEntryVec.h.


Member Data Documentation

Reimplemented from fsc_nsDirEntryFormattedVec.

Definition at line 102 of file fsc_nsDirEntryVec.h.


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

Generated on Mon Feb 27 19:22:44 2012 for OPENARCHIVE by  doxygen 1.5.6