Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes

fsc_MedVolume Class Reference
[File System Catalog]

#include <fsc_MedVolume.h>

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

List of all members.

Public Member Functions

 fsc_MedVolume (const cmn_Path &a_fscDirectory, ivd_MediaKey_t a_mediaKey, ivd_MedVolNum_t a_medVolNum, UInt32_t a_blockOfs)
 fsc_MedVolume (const cmn_Path &a_fscDirectory, ivd_MediaKey_t a_mediaKey, ivd_MedVolNum_t a_medVolNum)
virtual ~fsc_MedVolume ()

Static Public Member Functions

static const cmn_Path GetMedVolFileName (const cmn_Path &a_fscDirectory, ivd_MediaKey_t a_mediaKey, ivd_MedVolNum_t a_medVolNum, UInt32_t a_blockOfs)

Public Attributes

 log_CLASSID_m

Protected Member Functions

void InitBuffer ()

Protected Attributes

const cmn_Path m_fscDirectory
 return the number of read bytes
const ivd_MediaKey_t m_mediaKey
const ivd_MedVolNum_t m_medVolNum
UInt32_t m_buffCapacity
 file name is compound of mediaKey + medVolNum example: "m000000001v001.lcf"
UInt32_t m_buffSize
fsc_medVolData_tm_medVolDataBuf
fsc_medVolData_tm_buffPos
fsc_medVolData_tm_buffEnd

Static Protected Attributes

static int m_objCounter
static int m_ofsBitMask

Detailed Description

Definition at line 43 of file fsc_MedVolume.h.


Constructor & Destructor Documentation

fsc_MedVolume::fsc_MedVolume ( const cmn_Path a_fscDirectory,
ivd_MediaKey_t  a_mediaKey,
ivd_MedVolNum_t  a_medVolNum,
UInt32_t  a_blockOfs 
)

Definition at line 90 of file fsc_MedVolume.cpp.

References InitBuffer(), log_FUNC_m, and m_objCounter.

Referenced by fsc_MedVolume().

Here is the call graph for this function:

Here is the caller graph for this function:

fsc_MedVolume::fsc_MedVolume ( const cmn_Path a_fscDirectory,
ivd_MediaKey_t  a_mediaKey,
ivd_MedVolNum_t  a_medVolNum 
)

Definition at line 110 of file fsc_MedVolume.cpp.

References fsc_MedVolume(), log_FUNC_m, and m_objCounter.

Here is the call graph for this function:

fsc_MedVolume::~fsc_MedVolume (  )  [virtual]

Definition at line 158 of file fsc_MedVolume.cpp.

References log_FUNC_m, m_medVolDataBuf, and m_objCounter.


Member Function Documentation

const cmn_Path fsc_MedVolume::GetMedVolFileName ( const cmn_Path a_fscDirectory,
ivd_MediaKey_t  a_mediaKey,
ivd_MedVolNum_t  a_medVolNum,
UInt32_t  a_blockOfs 
) [static]

Definition at line 68 of file fsc_MedVolume.cpp.

References fsc_byVolDir_c, fsc_MedDirPrefix_c, fsc_MedVolFileExt_c, fsc_OfsFilePrefix_c(), fsc_VolDirPrefix_c, m_ofsBitMask, and snprintf.

Referenced by fsc_MedVolReader::fsc_MedVolReader(), and fsc_MedVolWriter::fsc_MedVolWriter().

{
    char sMediaKey[16];
    char sMedVolNum[8];
    char sBlockOfs[10];
// file name is compound of "med" + mediaKey + "/vol" + medVolNum  + "/ofs" + volume offset
// example: "med000000001/vol001/ofs0000000000.lvf"
    snprintf(sMediaKey , 16, "%09d", a_mediaKey);
    snprintf(sMedVolNum,  8, "%03d", a_medVolNum);
    snprintf(sBlockOfs , 10, "%09d", a_blockOfs & m_ofsBitMask);
    return a_fscDirectory + fsc_byVolDir_c
                          + (fsc_MedDirPrefix_c + sMediaKey)
                          + (fsc_VolDirPrefix_c + sMedVolNum)
                          + (fsc_OfsFilePrefix_c + sBlockOfs + fsc_MedVolFileExt_c);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void fsc_MedVolume::InitBuffer (  )  [protected]

Definition at line 130 of file fsc_MedVolume.cpp.

References cmn_GetEnvVariable(), dbg_DETAIL, fsc_MaxMedVolBuffSize_c(), fsc_MedVolBuffSize_c(), cmn_File::GetFullPathRef(), log_DBG_m, log_FUNC_m, m_buffCapacity, m_buffEnd, m_buffPos, m_buffSize, and m_medVolDataBuf.

Referenced by fsc_MedVolume().

                               {
    log_FUNC_m(InitBuffer);

    string sBuffSize = cmn_GetEnvVariable(fsc_MedVolBuffSize_c);
    if (!sBuffSize.empty()) {
        unsigned int buffSize = atoi(sBuffSize.c_str());
        // to round on fsc_medVolData_t size
        m_buffCapacity = buffSize / sizeof(fsc_medVolData_t);
    }

    if (m_buffCapacity > fsc_MaxMedVolBuffSize_c) {
        m_buffCapacity = fsc_MaxMedVolBuffSize_c;
    }

    m_medVolDataBuf = new  fsc_medVolData_t[m_buffCapacity];

    m_buffSize = sizeof(fsc_medVolData_t) * m_buffCapacity;
    m_buffPos  = m_medVolDataBuf;
    m_buffEnd  = m_medVolDataBuf + m_buffCapacity;
    log_DBG_m(dbg_DETAIL, GetFullPathRef() << " bufCap = " << m_buffCapacity
                          <<  " sizeof(fsc_medVolData_t) =" << sizeof(fsc_medVolData_t)
                          <<  " buffSize =" << m_buffSize
                          <<  " buff_p =" << hex << m_buffPos
                          <<  " buffEnd_p =" << hex << m_buffEnd << dec);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from cmn_File.

Reimplemented in fsc_MedVolWriter, and fsc_MedVolReader.

Definition at line 57 of file fsc_MedVolume.h.

file name is compound of mediaKey + medVolNum example: "m000000001v001.lcf"

Definition at line 71 of file fsc_MedVolume.h.

Referenced by fsc_MedVolReader::GetFSCdata(), InitBuffer(), and fsc_MedVolReader::SortData().

Definition at line 72 of file fsc_MedVolume.h.

Referenced by fsc_MedVolReader::GetFSCdata(), and InitBuffer().

return the number of read bytes

Definition at line 67 of file fsc_MedVolume.h.

int fsc_MedVolume::m_objCounter [static, protected]

Definition at line 77 of file fsc_MedVolume.h.

Referenced by fsc_MedVolume(), and ~fsc_MedVolume().

int fsc_MedVolume::m_ofsBitMask [static, protected]

Definition at line 81 of file fsc_MedVolume.h.

Referenced by GetMedVolFileName(), and fsc_MedVolWriter::KeyGen().


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