Public Member Functions | Private Attributes

df_MgrWriter Class Reference
[IVD Data format.]

This class is used on top of df_BlockManager to perform write operations to the buffer queue inside the df_BlockManager. More...

#include <df.h>

Collaboration diagram for df_MgrWriter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 df_MgrWriter (df_BlockManager &a_mgr)
 ~df_MgrWriter ()
df_DataBlockGetFree ()
void Flush ()
void SetError (ivd_Exception *a_err)

Private Attributes

 log_CLASSID_m
df_BlockManagerm_mgr
df_DataBlockm_allocated
 Holds a pointer to the last allocated df_DataBlock.

Detailed Description

This class is used on top of df_BlockManager to perform write operations to the buffer queue inside the df_BlockManager.

Destructor automatically sets end of data.

Definition at line 249 of file df.h.


Constructor & Destructor Documentation

df_MgrWriter::df_MgrWriter ( df_BlockManager a_mgr  ) 

Definition at line 60 of file df_blockmanager.cpp.

References log_FUNC_m, m_mgr, and df_BlockManager::RegisterWriter().

Here is the call graph for this function:

df_MgrWriter::~df_MgrWriter (  ) 

Definition at line 69 of file df_blockmanager.cpp.

References dbg_LOW, Flush(), df_DataBlock::IsClosed(), df_DataBlock::IsEmpty(), log_DBG_m, log_FUNC_m, m_allocated, m_mgr, NULL, and df_BlockManager::SetEndOfData().

                            {

    log_FUNC_m(~df_MgrWriter);

    if (   m_allocated != NULL
        && !m_allocated->IsEmpty()
        && !m_allocated->IsClosed() ) {

        log_DBG_m(dbg_LOW, "df_MgrWriter: Flushing last block on EOD.");
        Flush();
    }

    // In theory, there is a possibility that the reader thread outruns this one
    // and waits for m_mgr.m_closed_c again before m_mgr.m_endOfData is set.
    m_mgr.SetEndOfData();
}

Here is the call graph for this function:


Member Function Documentation

void df_MgrWriter::Flush (  ) 

Definition at line 91 of file df_blockmanager.cpp.

References df_BlockManager::Flush(), m_allocated, and m_mgr.

Referenced by bea_FRI::ReadFRI(), blk_NetReader::Run(), blk_BufferReader::Run(), bea_VolumeReader::Run(), and ~df_MgrWriter().

                         {
    m_mgr.Flush();
    m_allocated = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

df_DataBlock * df_MgrWriter::GetFree (  ) 

Definition at line 86 of file df_blockmanager.cpp.

References df_BlockManager::GetFree(), m_allocated, and m_mgr.

Referenced by bea_FRI::ReadFRI(), blk_NetReader::Run(), blk_BufferReader::Run(), and bea_VolumeReader::Run().

Here is the call graph for this function:

Here is the caller graph for this function:

void df_MgrWriter::SetError ( ivd_Exception a_err  )  [inline]

Definition at line 258 of file df.h.

Referenced by blk_NetReader::Run(), blk_BufferReader::Run(), and bea_VolumeReader::Run().

{ m_mgr.SetWriterError(a_err); };

Here is the caller graph for this function:


Member Data Documentation

Definition at line 258 of file df.h.

Holds a pointer to the last allocated df_DataBlock.

df_MgrWriter::Flush() sets it back to NULL.

Used in shutdown to detect if Flush() must be performed before setting EOD.

Definition at line 272 of file df.h.

Referenced by Flush(), GetFree(), and ~df_MgrWriter().

Definition at line 263 of file df.h.

Referenced by df_MgrWriter(), Flush(), GetFree(), and ~df_MgrWriter().


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