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

fsc_RawMedVolPathCollector Class Reference

is not used now, will be in future when need list of files stayed on particular medium. More...

#include <fsc_RawMedVolPathCollector.h>

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

List of all members.

Public Member Functions

 fsc_RawMedVolPathCollector (const string &a_partName, UInt32_t a_mediumKey, UInt32_t a_medVolNum)
virtual ~fsc_RawMedVolPathCollector (void)
virtual bool ProcFileID (ivd_RecordIDX_t a_fileID)
 coll inrerit method and clean filePath
virtual bool ProcRecMedPosMgr (fsc_MediaPosition_t &a_medPos)
 this method is called by fsc_MedPosMgs to collect media's block offset
ivd_RecordIDX_t GetFileID ()

Public Attributes

 log_CLASSID_m

Private Member Functions

const cmn_Path GetFileName (const string &a_partName, ivd_MediaKey_t a_mediaKey)

Private Attributes

fsc_medVolData_t m_medVolData
 to collect each split info
UInt32_t m_pathCounter
UInt32_t m_mediumKey
 when medium key is set then get filePath too and collect only particular medium and volume if set othervice all volumes from medium.
UInt32_t m_medVolNum
string m_filePath
ofstream m_output

Detailed Description

is not used now, will be in future when need list of files stayed on particular medium.

Definition at line 40 of file fsc_RawMedVolPathCollector.h.


Constructor & Destructor Documentation

fsc_RawMedVolPathCollector::fsc_RawMedVolPathCollector ( const string &  a_partName,
UInt32_t  a_mediumKey,
UInt32_t  a_medVolNum 
)

Definition at line 50 of file fsc_RawMedVolPathCollector.cpp.

References cmn_File::DeleteFile(), GetFileName(), ie_INVALID_ARG, m_mediumKey, m_output, and path.

    :
    m_pathCounter(0),
    m_mediumKey(a_mediumKey),
    m_medVolNum(a_medVolNum)
{
    // open proper file 
    if (m_mediumKey == 0) {
        throw ivd_InternalError(ie_INVALID_ARG, "Medium Key must be greater than 0");
    }
    cmn_Path path = GetFileName(a_partName, a_mediumKey);
    try {
        cmn_File::DeleteFile(path.c_str());
    }
    catch (ivd_SysError) {  // file is not generated 
    }
    m_output.open(path.c_str());
}

Here is the call graph for this function:

fsc_RawMedVolPathCollector::~fsc_RawMedVolPathCollector ( void   )  [virtual]

Definition at line 72 of file fsc_RawMedVolPathCollector.cpp.

References m_output.

                                                            {
    m_output.close();
}


Member Function Documentation

ivd_RecordIDX_t fsc_RawMedVolPathCollector::GetFileID ( void   )  [inline]

Reimplemented from fsc_RawCollector.

Definition at line 57 of file fsc_RawMedVolPathCollector.h.

{ return m_medVolData.fileID;};

const cmn_Path fsc_RawMedVolPathCollector::GetFileName ( const string &  a_partName,
ivd_MediaKey_t  a_mediaKey 
) [private]

Definition at line 109 of file fsc_RawMedVolPathCollector.cpp.

References cmn_Global::dirs, g_cmn, ivd_Directories::log, and snprintf.

Referenced by fsc_RawMedVolPathCollector().

                                                                                         {
    char sMediaKey[16];
    
// file name is compound of files-on-med<mediakey>-<part-name>.txt
// example: "files-on-med000000001-cosmos.txt"
    snprintf(sMediaKey , 16, "%09d", a_mediaKey);
    return g_cmn.dirs.log + (string("files-on-med") + sMediaKey + "-" + a_partName + ".txt");
}

Here is the caller graph for this function:

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

coll inrerit method and clean filePath

Reimplemented from fsc_RawCollector.

Definition at line 77 of file fsc_RawMedVolPathCollector.cpp.

References fsc_medVolData_t::fileID, m_filePath, and m_medVolData.

                                                                    {
    fsc_RawCollector::ProcFileID(a_fileID);
    m_medVolData.fileID = a_fileID;
    m_filePath.clear();
    return true;
}

bool fsc_RawMedVolPathCollector::ProcRecMedPosMgr ( fsc_MediaPosition_t a_medPos  )  [virtual]

this method is called by fsc_MedPosMgs to collect media's block offset

Reimplemented from fsc_RawCollector.

Definition at line 85 of file fsc_RawMedVolPathCollector.cpp.

References fsc_medVolData_t::fileID, fsc_nsCreateElementObj(), fsc_nsRemoveElementObj(), fsc_nsElement::GetFullPath(), log_FUNC_m, m_filePath, m_mediumKey, m_medVolData, m_medVolNum, m_output, m_pathCounter, fsc_MediaPosition_t::mediaKey, fsc_MediaPosition_t::medVolNum, and NULL.

                                                                              {
    log_FUNC_m(ProcRecMedPosMgr);      
    if ( m_mediumKey != 0 ) {
        if (m_mediumKey != a_medPos.mediaKey
            || (m_medVolNum != 0
             && m_medVolNum != a_medPos.medVolNum)) {
            return true; // skip, not proper volume
        }
    }
    m_pathCounter++;
    
    if (m_filePath.empty()) {
        fsc_nsElement *nsElement = fsc_nsCreateElementObj(m_medVolData.fileID);
        nsElement->GetFullPath(m_filePath);
        if (nsElement != NULL) {
            fsc_nsRemoveElementObj(nsElement);
        }
    }
    m_output << (int)a_medPos.medVolNum << " " << m_medVolData.fileID << " " << m_filePath << endl;

    return true;
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented from fsc_RawCollector.

Definition at line 57 of file fsc_RawMedVolPathCollector.h.

Definition at line 75 of file fsc_RawMedVolPathCollector.h.

Referenced by ProcFileID(), and ProcRecMedPosMgr().

when medium key is set then get filePath too and collect only particular medium and volume if set othervice all volumes from medium.

Definition at line 73 of file fsc_RawMedVolPathCollector.h.

Referenced by fsc_RawMedVolPathCollector(), and ProcRecMedPosMgr().

to collect each split info

Definition at line 66 of file fsc_RawMedVolPathCollector.h.

Referenced by ProcFileID(), and ProcRecMedPosMgr().

Definition at line 74 of file fsc_RawMedVolPathCollector.h.

Referenced by ProcRecMedPosMgr().

Definition at line 67 of file fsc_RawMedVolPathCollector.h.

Referenced by ProcRecMedPosMgr().


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