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

fsc_MedVolWriter Class Reference
[File System Catalog]

#include <fsc_MedVolume.h>

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

List of all members.

Public Member Functions

 fsc_MedVolWriter (const cmn_Path &a_fscDirectory, ivd_MediaKey_t a_mediaKey, ivd_MedVolNum_t a_medVolNum, UInt32_t a_blockOfs)
 ~fsc_MedVolWriter ()
void Write (fsc_medVolData_t *a_medVolData_p)

Static Public Member Functions

static UInt64_t KeyGen (ivd_MediaKey_t a_mediaKey, ivd_MedVolNum_t a_medVolNum, UInt32_t a_blockOfs)

Public Attributes

 log_CLASSID_m

Protected Member Functions

void Flush ()

Detailed Description

Definition at line 86 of file fsc_MedVolume.h.


Constructor & Destructor Documentation

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

Definition at line 180 of file fsc_MedVolume.cpp.

References cmn_CreatePath(), fsc_MedVolume::GetMedVolFileName(), log_FUNC_m, fsc_MedVolume::m_mediaKey, fsc_MedVolume::m_medVolNum, path, cmn_File::SetFullPath(), and cmn_Path::UpPath().

    :
    stx_CacheEl(KeyGen(a_mediaKey, a_medVolNum, a_blockOfs)),
    fsc_MedVolume(a_fscDirectory, a_mediaKey, a_medVolNum, a_blockOfs)
{
    log_FUNC_m(fsc_MedVolWriter);
    cmn_Path path = GetMedVolFileName(a_fscDirectory, m_mediaKey, m_medVolNum, a_blockOfs);
    SetFullPath(path);
    cmn_CreatePath(path.UpPath());
}

Here is the call graph for this function:

fsc_MedVolWriter::~fsc_MedVolWriter (  ) 

Definition at line 197 of file fsc_MedVolume.cpp.

References Flush(), and log_FUNC_m.

Here is the call graph for this function:


Member Function Documentation

void fsc_MedVolWriter::Flush (  )  [protected]

Definition at line 232 of file fsc_MedVolume.cpp.

References cmn_File::CloseF(), dbg_DETAIL, fom_OPEN_ALWAYS, fom_WRITE, cmn_File::GetFullPathRef(), log_DBG_m, log_FUNC_m, fsc_MedVolume::m_buffPos, fsc_MedVolume::m_medVolDataBuf, cmn_File::OpenF(), cmn_File::SeekEndF(), size, and cmn_File::WriteF().

Referenced by Write(), and ~fsc_MedVolWriter().

                             {
    log_FUNC_m(Flush);

    OpenF(fom_WRITE | fom_OPEN_ALWAYS); // binary | create | rdwr
    ivd_FilePosition_t pos = SeekEndF();
    UInt32_t size = (char*)m_buffPos - (char*)m_medVolDataBuf;
    log_DBG_m(dbg_DETAIL, GetFullPathRef() << " File pos " << pos
                          <<  " buff size " << size);
    WriteF(m_medVolDataBuf, size);
    CloseF();
    m_buffPos  = m_medVolDataBuf;
}

Here is the call graph for this function:

Here is the caller graph for this function:

UInt64_t fsc_MedVolWriter::KeyGen ( ivd_MediaKey_t  a_mediaKey,
ivd_MedVolNum_t  a_medVolNum,
UInt32_t  a_blockOfs 
) [static]

Definition at line 204 of file fsc_MedVolume.cpp.

References fsc_MedVolume::m_ofsBitMask.

Referenced by fsc_SplitInfoCollector::ProcObjMedPosMgr(), and fsc_RawMedVolCollector::ProcRecMedPosMgr().

                                                                 {
    //log_FUNC_m(KeyGen);
    //log_DBG_m(dbg_DETAIL, "BlockOfs "   << a_blockOfs
    //                   << " mediaKey "  << a_mediaKey
    //                   << " medVolNum " << a_medVolNum);
    UInt64_t key = (UInt64_t(a_blockOfs & m_ofsBitMask) << 32) + (a_mediaKey << 8) + a_medVolNum;
//    log_DBG_m(dbg_DETAIL, "MedVolWriter Key = " << key << ", 0x" << hex << key);
    return key;
}

Here is the caller graph for this function:

void fsc_MedVolWriter::Write ( fsc_medVolData_t a_medVolData_p  ) 

Definition at line 218 of file fsc_MedVolume.cpp.

References Flush(), fsc_MedVolume::m_buffEnd, and fsc_MedVolume::m_buffPos.

Referenced by fsc_SplitInfoCollector::ProcObjMedPosMgr(), and fsc_RawMedVolCollector::ProcRecMedPosMgr().

                                                             {
    //log_FUNC_m(Write);
    //log_DBG_m(dbg_DETAIL, GetFullPathRef() << " bufCap = " << m_buffCapacity
    //                      <<  " buff_p =" << hex << m_buffPos
    //                      <<  " buffEnd_p =" << hex << m_buffEnd << dec);

    *m_buffPos++ = *a_medVolData_p;
    if (m_buffPos >= m_buffEnd) {
        Flush();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from fsc_MedVolume.

Definition at line 103 of file fsc_MedVolume.h.


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