Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends

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.

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

Detailed Description

Definition at line 52 of file fsc_nsDirEntryVec.h.


Constructor & Destructor Documentation

fsc_nsDirEntryVec::fsc_nsDirEntryVec (  ) 

It is used when owner is not yet known.

Definition at line 51 of file fsc_nsDirEntryVec.cpp.

References log_FUNC_m.

Referenced by CreateNextVector(), and fsc_nsDirEntryVec().

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 60 of file fsc_nsDirEntryVec.cpp.

References fsc_nsDirEntryVec(), log_FUNC_m, and size.

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 71 of file fsc_nsDirEntryVec.cpp.

  : fsc_nsDirEntryFormattedVec(a_nextMemberIdx),
    m_nextDirEntryVec_p(a_nextDirEntryVec_p){
  //    log_FUNC_m(fsc_nsDirEntryVec);
}

fsc_nsDirEntryVec::~fsc_nsDirEntryVec ( void   ) 

Definition at line 81 of file fsc_nsDirEntryVec.cpp.

References log_FUNC_m, m_nextDirEntryVec_p, and NULL.


Member Function Documentation

void fsc_nsDirEntryVec::Clear ( void   ) 

Reimplemented from fsc_nsDirEntryFormattedVec.

Definition at line 179 of file fsc_nsDirEntryVec.cpp.

References log_FUNC_m, and m_nextDirEntryVec_p.

Referenced by fsc_nsDirEntryMgr::RemoveEntry().

Here is the caller graph for this function:

void fsc_nsDirEntryVec::CreateNextVector (  )  [private]

Definition at line 171 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:

void fsc_nsDirEntryVec::Dump ( ostream &  os  ) 

Reimplemented from fsc_nsDirEntryFormattedVec.

Definition at line 201 of file fsc_nsDirEntryVec.cpp.

References Dump(), GetNextDirEntryVecPtr(), m_nextDirEntryVec_p, and NULL.

Referenced by Dump(), and fsc_nsDirEntryMgr::Dump().

Here is the call graph for this function:

Here is the caller graph for this function:

fsc_nsDirEntryVec * fsc_nsDirEntryVec::GetNextDirEntryVecPtr (  ) 

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

                                                            {    
    log_FUNC_m(GetNextDirEntryVecPtr);    
    if (m_nextDirEntryVec_p != NULL) {        
        // continue    
    } 
    else if (*m_nextVecIdx_p != 0) {        
        CreateNextVector();    
    }    
    return m_nextDirEntryVec_p;
}

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 105 of file fsc_nsDirEntryVec.h.

References fsc_nsDirEntryFormattedVec::m_nextVecIdx_p.

{return *m_nextVecIdx_p;};

void fsc_nsDirEntryVec::Init ( ivd_RecordIDX_t  a_nextMemberIdx,
fsc_nsDirEntryVec a_nextDirEntryVec_p 
)

to initialize again abbandon vector

Definition at line 92 of file fsc_nsDirEntryVec.cpp.

References log_FUNC_m, and m_nextDirEntryVec_p.

Referenced by fsc_nsDirEntryMgr::AddEntry().

                                                                    {    
    log_FUNC_m(Init);    
    
    m_nextDirEntryVec_p = a_nextDirEntryVec_p;    
    fsc_nsDirEntryFormattedVec::Init(a_nextMemberIdx);
}

Here is the caller graph for this function:

bool fsc_nsDirEntryVec::IsLastInChain (  )  [inline]

Definition at line 108 of file fsc_nsDirEntryVec.h.

References m_nextDirEntryVec_p, and fsc_nsDirEntryFormattedVec::m_nextVecIdx_p.

                         {        
        return    (*m_nextVecIdx_p     == 0)                
            && (m_nextDirEntryVec_p == NULL); 
    // vector has no next one    
    };

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 103 of file fsc_nsDirEntryVec.cpp.

References log_FUNC_m, fsc_nsDirEntryFormattedVec::RemoveEntry(), and RemoveEntryFromNextVec().

Referenced by RemoveEntryFromNextVec().

                                                                    {    
    log_FUNC_m(RemoveEntry);    
    if (fsc_nsDirEntryFormattedVec::RemoveEntry(a_idxToRemove, a_idxToReplace)) {        
        return true;    
    }    
    else {        
        return RemoveEntryFromNextVec(a_idxToRemove, a_idxToReplace);    
    }
}

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

                                                                               {    
                                               
    log_FUNC_m(RemoveEntryFromNextVec);
    if (m_nextDirEntryVec_p != NULL) {        
        // continue
    }
    else if (*m_nextVecIdx_p != 0) {
        CreateNextVector();
    }
    else {        
        // @todo write a warning in ivd.log that directory entry missing.        
        return false;    
    }    
    return m_nextDirEntryVec_p->RemoveEntry(a_idxToRemove, a_idxToReplace);
}

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 137 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, and Write2DB().

Referenced by Write2DB(), and fsc_nsDirEntryMgr::Write2DB().

                                                           {

    log_FUNC_m(Write2DB(numOfElement));

    // if next vector exist call its write2DB method first and get record index.
    if (m_nextDirEntryVec_p != NULL) {
        if (m_nextDirEntryVec_p->Write2DB(*m_nextVecIdx_p, a_trans)) {
            m_changed = true;
        }
        log_DBG_m(dbg_DETAIL, "Write chained vectors first. on idx " << *m_nextVecIdx_p);
    }
    return fsc_nsDirEntryFormattedVec::Write2DB(a_numOfElement, a_recordIdx, a_trans);
}

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 156 of file fsc_nsDirEntryVec.cpp.

References log_FUNC_m, fio_Vector::m_changed, m_nextDirEntryVec_p, fsc_nsDirEntryFormattedVec::m_nextVecIdx_p, NULL, and Write2DB().

                                                           {
    log_FUNC_m(Write2DB);    
    // if next vector exist call its write2DB method first and get record index.    
    if (m_nextDirEntryVec_p != NULL) {        
        if (m_nextDirEntryVec_p->Write2DB(*m_nextVecIdx_p, a_trans)) {            
            m_changed = true;        
        }    
    }     
    return fsc_nsDirEntryFormattedVec::Write2DB(a_recordIdx, a_trans);
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class ut_fsc_nsDirEntryVec [friend]

Definition at line 53 of file fsc_nsDirEntryVec.h.


Member Data Documentation

Reimplemented from fsc_nsDirEntryFormattedVec.

Definition at line 116 of file fsc_nsDirEntryVec.h.


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