Public Member Functions | Public Attributes | Friends

fsc_MedPosMgr Class Reference
[File System Catalog]

<Description:> A more elaborate class description that describes all aspects of class usage etc. More...

#include <fsc_MedPosMgr.h>

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

List of all members.

Public Member Functions

 fsc_MedPosMgr (df_SplitInfo &a_splitInfo)
 fsc_MedPosMgr (const fsc_NextEntity_t &a_nextEntity)
virtual ~fsc_MedPosMgr ()
bool Remove (ivd_MediaKey_t a_mediumKey, ivd_MedVolNum_t a_medVolNum)
 Insert a split into Data location tree.
bool Remove (ivd_MediaKey_t a_mediumKey, ivd_MedVolNum_t a_medVolNum, UInt32_t a_blockOffs)
 Remove one particular entry.
bool IsItEqual (df_SplitInfo &a_splitInfo)
bool IsItEqual (fsc_MedPosMgr &a_medPos)
void GetMediaPos (ivd_MediaPos_t &a_mediaPos)
bool Write2DB (fsc_NextEntity_t &a_nextEntity)
bool Write2DB (fsc_MediaPosition_t &a_mediaPos)
void Dump (ostream &os)
bool TreeWalk (fsc_Collector &a_collector)

Public Attributes

bool m_changed
ivd_DataType_t m_dataType
ivd_MedVolNum_t m_medVolNum
ivd_MediaKey_t m_mediaKey
ivd_BlockOffset_t m_blockOffset
 log_CLASSID_m

Friends

class ut_fsc_MedPosMgr

Detailed Description

<Description:> A more elaborate class description that describes all aspects of class usage etc.

Author:
Dejan Volk Lupo, HERMES SoftLab
See also:
<reference>

Definition at line 48 of file fsc_MedPosMgr.h.


Constructor & Destructor Documentation

fsc_MedPosMgr::fsc_MedPosMgr ( df_SplitInfo a_splitInfo  ) 

Definition at line 48 of file fsc_MedPosMgr.cpp.

            :
            m_changed(true),  // it's new
            m_medVolNum(a_splitInfo.medVolNum),
            m_mediaKey(a_splitInfo.mediaKey),
            m_blockOffset(a_splitInfo.blockOffset)
{
//    log_FUNC_m(fsc_MedPosMgr(df_SplitInfo));
    
}

fsc_MedPosMgr::fsc_MedPosMgr ( const fsc_NextEntity_t a_nextEntity  ) 

Definition at line 61 of file fsc_MedPosMgr.cpp.

References fsc_MediaPosition_t::blockOffset, fsc_NextEntity_t::GetMedPosConst(), m_blockOffset, m_mediaKey, m_medVolNum, fsc_MediaPosition_t::mediaKey, and fsc_MediaPosition_t::medVolNum.

            :
            m_changed(false)
{
//    log_FUNC_m(fsc_MedPosMgr);
    const fsc_MediaPosition_t &mediaPosition = a_nextEntity.GetMedPosConst();
    m_medVolNum   = mediaPosition.medVolNum;
    m_mediaKey    = mediaPosition.mediaKey;
    m_blockOffset = mediaPosition.blockOffset;
}

Here is the call graph for this function:

fsc_MedPosMgr::~fsc_MedPosMgr (  )  [virtual]

Definition at line 74 of file fsc_MedPosMgr.cpp.

{

}


Member Function Documentation

void fsc_MedPosMgr::Dump ( ostream &  os  ) 

Definition at line 183 of file fsc_MedPosMgr.cpp.

References log_FUNC_m, m_blockOffset, m_mediaKey, and m_medVolNum.

Referenced by fsc_Split::Dump(), fsc_Generation::Dump(), fsc_Copy::Dump(), and operator<<().

                                    {
    log_FUNC_m(Dump);

    os << "               MediaKey     "  << m_mediaKey << endl;
    os << "               MedVolNum    "  << (int)m_medVolNum << endl;
    os << "               Block offset "  << m_blockOffset << endl;
}

Here is the caller graph for this function:

void fsc_MedPosMgr::GetMediaPos ( ivd_MediaPos_t a_mediaPos  ) 

Definition at line 141 of file fsc_MedPosMgr.cpp.

References ivd_MediaPos_t::blockOffset, dbg_DETAIL, log_DBG_m, log_FUNC_m, m_blockOffset, m_mediaKey, m_medVolNum, ivd_MediaPos_t::mediaKey, and ivd_MediaPos_t::medVolNum.

Referenced by fsc_Generation::GetCopiesPos(), fsc_Split::GetMediaPos(), and fsc_Copy::GetMediaPos().

                                                          {
    log_FUNC_m(GetMediaPos(ivd_MediaPos_t));

     a_mediaPos.mediaKey    = m_mediaKey;
     a_mediaPos.medVolNum   = m_medVolNum;
     a_mediaPos.blockOffset = m_blockOffset;

     log_DBG_m(dbg_DETAIL,"GetMedPos: medKey: " <<  m_mediaKey
                        << ", MedVolNum: "  << (int)m_medVolNum
                        << ", Block offset: "  << m_blockOffset);
}

Here is the caller graph for this function:

bool fsc_MedPosMgr::IsItEqual ( df_SplitInfo a_splitInfo  ) 

Definition at line 123 of file fsc_MedPosMgr.cpp.

References df_SplitInfo::blockOffset, m_blockOffset, m_mediaKey, m_medVolNum, df_SplitInfo::mediaKey, and df_SplitInfo::medVolNum.

Referenced by fsc_Copy::AddSplit(), fsc_Generation::Insert(), and fsc_Split::IsSplitEqual().

                                                        {
//    log_FUNC_m(IsItEqual);

    return (  m_mediaKey    == a_splitInfo.mediaKey
           && m_medVolNum   == a_splitInfo.medVolNum
           && m_blockOffset == a_splitInfo.blockOffset);
}

Here is the caller graph for this function:

bool fsc_MedPosMgr::IsItEqual ( fsc_MedPosMgr a_medPos  ) 

Definition at line 132 of file fsc_MedPosMgr.cpp.

References m_blockOffset, m_mediaKey, and m_medVolNum.

                                                     {
//    log_FUNC_m(IsItEqual);

    return (  m_mediaKey    == a_medPos.m_mediaKey
           && m_medVolNum   == a_medPos.m_medVolNum
           && m_blockOffset == a_medPos.m_blockOffset);
}

bool fsc_MedPosMgr::Remove ( ivd_MediaKey_t  a_mediumKey,
ivd_MedVolNum_t  a_medVolNum,
UInt32_t  a_blockOffs 
)

Remove one particular entry.

Definition at line 100 of file fsc_MedPosMgr.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_blockOffset, m_changed, m_mediaKey, m_medVolNum, and Remove().

                                                            {
    log_FUNC_m(Remove);
    log_DBG_m(dbg_DETAIL,"Check Remove medKey " <<  m_mediaKey
                        << " volNum " << m_medVolNum
                        << " offset " << a_blockOffs);
    if (  m_mediaKey    == a_mediumKey
       && m_medVolNum   == a_medVolNum
       && m_blockOffset == a_blockOffs) {
        log_DBG_m(dbg_DETAIL,"Removed medKey " <<  a_mediumKey
                        << " volNum " << a_medVolNum
                        << " offset " << a_blockOffs);
        m_changed     = true;
        m_mediaKey    = 0;
        m_medVolNum   = 0;
        m_blockOffset = 0;
        return true;
    }
    return false;
}

Here is the call graph for this function:

bool fsc_MedPosMgr::Remove ( ivd_MediaKey_t  a_mediumKey,
ivd_MedVolNum_t  a_medVolNum 
)

Insert a split into Data location tree.

remove all entries from particular volume. Return true if removed.

Definition at line 80 of file fsc_MedPosMgr.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_blockOffset, m_changed, m_mediaKey, and m_medVolNum.

Referenced by fsc_Split::Remove(), Remove(), fsc_Generation::Remove(), and fsc_Copy::Remove().

                                                            {
    log_FUNC_m(Remove);

    log_DBG_m(dbg_DETAIL,"Check Remove medKey " <<  m_mediaKey
                        << " volNum " << m_medVolNum);
    if (  m_mediaKey    == a_mediumKey
       && m_medVolNum   == a_medVolNum) {
        log_DBG_m(dbg_DETAIL,"Removed medKey " <<  a_mediumKey
                        << " volNum " << a_medVolNum);
        m_changed     = true;
        m_mediaKey    = 0;
        m_medVolNum   = 0;
        m_blockOffset = 0;
        return true;
    }
    return false;
}

Here is the caller graph for this function:

bool fsc_MedPosMgr::TreeWalk ( fsc_Collector a_collector  ) 

Definition at line 154 of file fsc_MedPosMgr.cpp.

References fsc_Collector::ProcObjMedPosMgr().

Referenced by fsc_Split::TreeWalk(), fsc_Generation::TreeWalk(), and fsc_Copy::TreeWalk().

                                                         {
//    log_FUNC_m(TreeWalk);
    return a_collector.ProcObjMedPosMgr(this);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool fsc_MedPosMgr::Write2DB ( fsc_NextEntity_t a_nextEntity  ) 

Definition at line 160 of file fsc_MedPosMgr.cpp.

References fsc_MediaPosition_t::blockOffset, dbg_DETAIL, fsc_NextEntity_t::dlcType, fsc_NextEntity_t::GetMedPos(), log_DBG_m, log_FUNC_m, m_blockOffset, m_changed, m_mediaKey, m_medVolNum, fsc_MediaPosition_t::mediaKey, and fsc_MediaPosition_t::medVolNum.

Referenced by fsc_Split::Write2DB(), fsc_Generation::Write2DB(), and fsc_Copy::Write2DB().

                                                           {
    log_FUNC_m(Write2DB(fsc_NextEntity_t));

    fsc_MediaPosition_t &mediaPosition = a_nextEntity.GetMedPos();
    if (  m_mediaKey  == 0
       && m_medVolNum == 0) { // entry was removed
        log_DBG_m(dbg_DETAIL,"MedPos released medKey " <<  m_mediaKey
                          << " volNum " << m_medVolNum);
        a_nextEntity.dlcType = dlc_NotUsed;
        mediaPosition.mediaKey
        = mediaPosition.medVolNum
        = mediaPosition.blockOffset = 0;
    }
    else {
        a_nextEntity.dlcType      = dlc_MediaPos;
        mediaPosition.mediaKey    = m_mediaKey;
        mediaPosition.medVolNum   = m_medVolNum;
        mediaPosition.blockOffset = m_blockOffset;
    }
    return m_changed;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool fsc_MedPosMgr::Write2DB ( fsc_MediaPosition_t a_mediaPos  ) 

Friends And Related Function Documentation

friend class ut_fsc_MedPosMgr [friend]

Definition at line 49 of file fsc_MedPosMgr.h.


Member Data Documentation

Reimplemented from fsc_EntryMgr.

Definition at line 66 of file fsc_MedPosMgr.h.

Definition at line 58 of file fsc_MedPosMgr.h.

Referenced by Remove(), and Write2DB().

Definition at line 60 of file fsc_MedPosMgr.h.


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