Public Member Functions | Static Private Member Functions | Private Attributes

fsc_CollectorDelete Class Reference
[FSC]

#include <fsc_CollectorDelete.h>

Inheritance diagram for fsc_CollectorDelete:
Inheritance graph
[legend]
Collaboration diagram for fsc_CollectorDelete:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 fsc_CollectorDelete (ivd_MediaKey_t a_origMedKey, vector< UInt32_t > a_origMedVol, fsc_DataLMgr &a_dataLMgr)
virtual ~fsc_CollectorDelete (void)
virtual bool ProcFileID (ivd_RecordIDX_t a_fileID)
 this methods are called by raw FSC scaner when fsc tree is scanned.
virtual bool ProcRecGeneration (fsc_Generation_t &a_gen, UInt32_t a_status)
 Called for each generation.
virtual bool PostRecCopy (fsc_Copy_t &a_copy)
 Called after each copy processed.
virtual bool ProcRecSplit (fsc_Split_t &a_split)
 Called when generation or copy has splits.
virtual bool ProcRecMedPosMgr (fsc_MediaPosition_t &a_medPos)
 Called when media position is known.

Static Private Member Functions

static UInt64_t KeyGen (ivd_MediaKey_t a_mediaKey, ivd_MedVolNum_t a_medVolNum)
 Key to searc element in stx_cache.

Private Attributes

 log_CLASSID_m
const ivd_MediaKey_t m_medKey
vector< UInt32_tm_medVol
UInt32_t m_currentVolume
stx_Cache m_cache
 MedVolume file storage.
ivd_FileSize_t m_streamSize
 stream size stored in generation
UInt8_t m_dataType
 each generation set this member
ivd_FileSize_t m_dataOffset
 generation and MedPos set to 0, split set its value
ivd_FileSize_t m_dataSize
 generation and MedPos set to m_streamSize, split set its value
ivd_CopiesPos_v_t m_cpyMedPos_v
 each generation clear and fill its media position
ivd_CopiesPos_v_i m_copyIter
ivd_MediaPos_v_i m_medPosIter
bool m_doDelete
 Set if exist copy on original medium, reset for each gen.
fsc_DataLMgrm_dataLMgr
ivd_FileLocationData_t m_fileLocationData

Detailed Description

Definition at line 46 of file fsc_CollectorDelete.h.


Constructor & Destructor Documentation

fsc_CollectorDelete::fsc_CollectorDelete ( ivd_MediaKey_t  a_origMedKey,
vector< UInt32_t a_origMedVol,
fsc_DataLMgr a_dataLMgr 
)

Definition at line 57 of file fsc_CollectorDelete.cpp.

References log_FUNC_m.

        :
        m_medKey(a_medKey),
        m_medVol(a_medVol),
        m_currentVolume(0),
        m_cache(1024), // small amount of different media is possible
        m_dataLMgr(a_dataLMgr)
{
    log_FUNC_m(fsc_CollectorDelete);
}

fsc_CollectorDelete::~fsc_CollectorDelete ( void   )  [virtual]

Definition at line 71 of file fsc_CollectorDelete.cpp.

                                          {

}


Member Function Documentation

static UInt64_t fsc_CollectorDelete::KeyGen ( ivd_MediaKey_t  a_mediaKey,
ivd_MedVolNum_t  a_medVolNum 
) [inline, static, private]

Key to searc element in stx_cache.

Definition at line 78 of file fsc_CollectorDelete.h.

                                                    {
        return UInt64_t(a_mediaKey << 6) + a_medVolNum;
    };

bool fsc_CollectorDelete::PostRecCopy ( fsc_Copy_t a_copy  )  [virtual]

Called after each copy processed.

Reimplemented from fsc_RawCollector.

Definition at line 106 of file fsc_CollectorDelete.cpp.

References log_FUNC_m, and m_copyIter.

                                                        {
    log_FUNC_m(PostRecCopy);
    ++m_copyIter; // next copy
    return true;
}

bool fsc_CollectorDelete::ProcFileID ( ivd_RecordIDX_t  a_fileID  )  [virtual]

this methods are called by raw FSC scaner when fsc tree is scanned.

The scan stops if calee return false

Reimplemented from fsc_RawCollector.

Definition at line 76 of file fsc_CollectorDelete.cpp.

References dbg_DETAIL, ivd_FileLocationData_t::fileID, log_DBG_m, log_FUNC_m, and m_fileLocationData.

                                                             {
    log_FUNC_m(ProcFileID);
    m_fileLocationData.fileID = a_fileID;
    log_DBG_m(dbg_DETAIL, "New locData.  fileID = " << m_fileLocationData.fileID);
    return true;
}

bool fsc_CollectorDelete::ProcRecGeneration ( fsc_Generation_t a_gen,
UInt32_t  a_status 
) [virtual]
bool fsc_CollectorDelete::ProcRecMedPosMgr ( fsc_MediaPosition_t a_medPos  )  [virtual]

Called when media position is known.

Reimplemented from fsc_RawCollector.

Definition at line 120 of file fsc_CollectorDelete.cpp.

References fsc_MediaPosition_t::blockOffset, ivd_FileLocationData_t::blockOffset, dbg_DETAIL, ivd_FileLocationData_t::fileID, log_DBG_m, log_FUNC_m, m_currentVolume, m_dataLMgr, m_doDelete, m_fileLocationData, m_medKey, m_medVol, fsc_MediaPosition_t::mediaKey, fsc_MediaPosition_t::medVolNum, and fsc_DataLMgr::Remove().

                                                                        {
    log_FUNC_m(ProcRecMedPosMgr);
    
    m_currentVolume = a_medPos.medVolNum;
    m_fileLocationData.blockOffset = a_medPos.blockOffset;
    
    if (!m_doDelete) {
        
        for (UInt32_t i(0); i < m_medVol.size(); i++){
            log_DBG_m(dbg_DETAIL, "m_medVol[i] " << m_medVol[i] <<  
                                  " m_currentVolume " << m_currentVolume);
            if ( (m_medVol[i] == m_currentVolume) && 
                 (m_medKey == a_medPos.mediaKey) ) {
                m_doDelete = true;
                break;    
            }      
        }
        
        log_DBG_m(dbg_DETAIL, "a_medPos.mediaKey: " << a_medPos.mediaKey 
                           << ", m_medKey: " << m_medKey 
                           << ", m_currentVolume" << m_currentVolume
                           << "\n Do delete copy " << boolalpha << m_doDelete);
    }
    if (m_doDelete) {
    
        log_DBG_m(dbg_DETAIL, "m_fileLocationData.fileID " << m_fileLocationData.fileID
                            << "\n  m_medKey " << m_medKey
                            << "\n  m_currentVolume      " << m_currentVolume 
                            << "\n  m_fileLocationData.blockOffset " << m_fileLocationData.blockOffset);
        
                
        m_dataLMgr.Remove( m_fileLocationData.fileID,
                           m_medKey,
                           m_currentVolume,
                           m_fileLocationData.blockOffset );
                
        
                
    }
    
    return true;
}

Here is the call graph for this function:

bool fsc_CollectorDelete::ProcRecSplit ( fsc_Split_t a_split  )  [virtual]

Called when generation or copy has splits.

Reimplemented from fsc_RawCollector.

Definition at line 113 of file fsc_CollectorDelete.cpp.

References fsc_Split_t::dataSize, log_FUNC_m, m_fileLocationData, and ivd_FileLocationData_t::splitSize.


Member Data Documentation

Reimplemented from fsc_RawCollector.

Definition at line 74 of file fsc_CollectorDelete.h.

MedVolume file storage.

Definition at line 88 of file fsc_CollectorDelete.h.

Definition at line 104 of file fsc_CollectorDelete.h.

Referenced by PostRecCopy(), and ProcRecGeneration().

each generation clear and fill its media position

Definition at line 103 of file fsc_CollectorDelete.h.

Referenced by ProcRecGeneration().

Definition at line 85 of file fsc_CollectorDelete.h.

Referenced by ProcRecMedPosMgr().

Definition at line 110 of file fsc_CollectorDelete.h.

Referenced by ProcRecMedPosMgr().

generation and MedPos set to 0, split set its value

Definition at line 97 of file fsc_CollectorDelete.h.

Referenced by ProcRecGeneration().

generation and MedPos set to m_streamSize, split set its value

Definition at line 100 of file fsc_CollectorDelete.h.

each generation set this member

Definition at line 94 of file fsc_CollectorDelete.h.

Referenced by ProcRecGeneration().

Set if exist copy on original medium, reset for each gen.

Definition at line 108 of file fsc_CollectorDelete.h.

Referenced by ProcRecGeneration(), and ProcRecMedPosMgr().

Definition at line 81 of file fsc_CollectorDelete.h.

Referenced by ProcRecMedPosMgr().

Definition at line 105 of file fsc_CollectorDelete.h.

Definition at line 84 of file fsc_CollectorDelete.h.

Referenced by ProcRecMedPosMgr().

stream size stored in generation

Definition at line 91 of file fsc_CollectorDelete.h.

Referenced by ProcRecGeneration().


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