Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

AxPipe::CJoin::CTSinkJoin Class Reference

A helper class for the merge, each in stream gets a CSinkJoin like this. More...

Inheritance diagram for AxPipe::CJoin::CTSinkJoin:

Inheritance graph
[legend]
Collaboration diagram for AxPipe::CJoin::CTSinkJoin:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CTSinkJoin ()
 Init of member variables.

CSegGetSeg ()
 Get the current segment pointer.

bool IsEmpty ()
 True if empty. Obviously.

void SinkWorkWait ()
 Wait for this sink make a segment ready via GetSeg().

void SinkWorkEnd ()
 Signal this sink that you've accepted the segment via GetSeg().


Protected Member Functions

void Out (CSeg *pSeg)
 Send the data to the CJoin, along with the index.

bool OutClose ()
 Mark input as empty.

bool OutFlush ()
 Forward a flush request to the CJoin.


Private Attributes

CThreadSync m_Sync
 Synchronize in streams with worker join thread.

CSegm_pNextSeg
 Communicates the next segment to In().

bool m_fEmpty
 Set when a NULL is output, to indicate that it's empty.


Detailed Description

A helper class for the merge, each in stream gets a CSinkJoin like this.

The Out() method is overriden to communicate CJoin::In() via thread sync. CJoin::In() calls CSinkJoin::m_ppInSinks[i].GetSeg(), which waits for a new segment to arrive from the indexed source, and then provides it.

Definition at line 538 of file AxPipe.h.


Member Function Documentation

CSeg * AxPipe::CJoin::CTSinkJoin::GetSeg  ) 
 

Get the current segment pointer.

Called by the In() of the CJoin to get the next segment from this input stream, after returning from SinkWorkWait().

Returns:
A CSeg * to a segment.

Definition at line 94 of file CJoin.cpp.

References m_fEmpty, and m_pNextSeg.

Referenced by AxPipe::CJoin::StreamSeg().

bool AxPipe::CJoin::CTSinkJoin::IsEmpty  ) 
 

True if empty. Obviously.

Check for empty condition

Returns:
true if this input stream is marked as empty.

Definition at line 86 of file CJoin.cpp.

References m_fEmpty.

Referenced by AxPipe::CJoin::StreamEmpty(), and AxPipe::CJoin::StreamSeg().

void AxPipe::CJoin::CTSinkJoin::Out CSeg pSeg  )  [protected, virtual]
 

Send the data to the CJoin, along with the index.

Parameters:
pSeg The segment of data from the input stream to pass along.

Implements AxPipe::CSink.

Definition at line 41 of file CJoin.cpp.

References _T, AxPipe::ERROR_CODE_GENERIC, m_fEmpty, m_pNextSeg, m_Sync, AxPipe::CSeg::Release(), AxPipe::CError::SetError(), AxPipe::CThreadSync::WorkSignal(), and AxPipe::CThreadSync::WorkStart().

Referenced by OutClose(), and OutFlush().

bool AxPipe::CJoin::CTSinkJoin::OutClose void   )  [protected, virtual]
 

Mark input as empty.

Pass a NULL as filter conventions dictate so the CJoin reader can detect it, and not ask for more.

Returns:
false - never propagate from a sink.

Reimplemented from AxPipe::CSink.

Definition at line 61 of file CJoin.cpp.

References _T, and Out().

bool AxPipe::CJoin::CTSinkJoin::OutFlush  )  [protected, virtual]
 

Forward a flush request to the CJoin.

Use filter conventions to signal the CJoin, so zero-len segment is sent.

Reimplemented from AxPipe::CSink.

Definition at line 71 of file CJoin.cpp.

References _T, and Out().

void AxPipe::CJoin::CTSinkJoin::SinkWorkEnd  ) 
 

Signal this sink that you've accepted the segment via GetSeg().

Called by the worker CJoin thread to signal that it's done with it's work and potentially ready for more.

Definition at line 110 of file CJoin.cpp.

References m_Sync, and AxPipe::CThreadSync::WorkEnd().

void AxPipe::CJoin::CTSinkJoin::SinkWorkWait  ) 
 

Wait for this sink make a segment ready via GetSeg().

Called by the worker CJoin thread to wait for the arrival of more. CJoin expects to block waiting for more, or NULL if the end of stream is deteced.

Definition at line 103 of file CJoin.cpp.

References m_Sync, and AxPipe::CThreadSync::WorkWait().

Referenced by AxPipe::CJoin::StreamSeg().


The documentation for this class was generated from the following files:
Generated on Mon Feb 2 13:19:27 2004 for AxPipe by doxygen 1.3.5