df_MgrWriter Class Reference
[IVD Data format.]

#include <df.h>

Collaboration diagram for df_MgrWriter:

Collaboration graph
[legend]

List of all members.


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 235 of file df.h.


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.

Constructor & Destructor Documentation

df_MgrWriter::df_MgrWriter ( df_BlockManager a_mgr  ) 

Definition at line 46 of file df_blockmanager.cpp.

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

00047   : m_mgr(a_mgr),
00048     m_allocated(NULL) {
00049 
00050     log_FUNC_m(df_MgrWriter);
00051 
00052     m_mgr.RegisterWriter();
00053 }

Here is the call graph for this function:

df_MgrWriter::~df_MgrWriter (  ) 

Definition at line 55 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().

00055                             {
00056 
00057     log_FUNC_m(~df_MgrWriter);
00058 
00059     if (   m_allocated != NULL
00060         && !m_allocated->IsEmpty()
00061         && !m_allocated->IsClosed() ) {
00062 
00063         log_DBG_m(dbg_LOW, "df_MgrWriter: Flushing last block on EOD.");
00064         Flush();
00065     }
00066 
00067     // In theory, there is a possibility that the reader thread outruns this one
00068     // and waits for m_mgr.m_closed_c again before m_mgr.m_endOfData is set.
00069     m_mgr.SetEndOfData();
00070 }

Here is the call graph for this function:


Member Function Documentation

df_DataBlock * df_MgrWriter::GetFree (  ) 

Definition at line 72 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().

00072                                     {
00073     m_allocated = m_mgr.GetFree();
00074     return m_allocated;
00075 }

Here is the call graph for this function:

Here is the caller graph for this function:

void df_MgrWriter::Flush (  ) 

Definition at line 77 of file df_blockmanager.cpp.

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

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

00077                          {
00078     m_mgr.Flush();
00079     m_allocated = NULL;
00080 }

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 244 of file df.h.

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

00244 { m_mgr.SetWriterError(a_err); };

Here is the caller graph for this function:


Member Data Documentation

Definition at line 244 of file df.h.

Definition at line 249 of file df.h.

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

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 258 of file df.h.

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


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

Generated on Mon Feb 27 19:12:42 2012 for OPENARCHIVE by  doxygen 1.5.6