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

AxPipe::CSplit Class Reference

A forward Y-split, divides a stream into two. More...

#include <AxPipe.h>

Inheritance diagram for AxPipe::CSplit:

Inheritance graph
[legend]
Collaboration diagram for AxPipe::CSplit:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CSplit ()
 Construct and initialize the member variables.

void AppendSink (CSink *pSink, bool fAutoDelete)
 Do not append a section, it's an error here.

void Sync ()
 Ensure that all threads downstream are idle.

CSplitInit (CPipe *pLeft, CPipe *pRight)
 Initialize split with left and right pointers to pipes.

void Out (CSeg *pSeg)
 Send the same segment downstream to both parts of the split.

void OutSpecial (CSeg *pSeg)
 Send the same special segment downstream to both parts of the split.

bool OutFlush ()
 Send a flush signal downstream to both parts of the split.

bool OutClose ()
 Send a close signal downstream to both parts of the split.

bool OutOpen ()
 Send an open signal downstream to both parts of the split.


Private Member Functions

void DestructSink ()
 Always delete the left and right upon deletion of this part.

void PumpSplit (CSeg *pSeg)
 Send the same segment down both left and right legs of the split.


Private Attributes

CPipem_pLeft
 The start of the 'left' side of the split.

CPipem_pRight
 The start of the 'right' side of the split.


Detailed Description

A forward Y-split, divides a stream into two.

It does nothing more to the data, except pass each segment onwards, but twice, to each of the streams given ('left' and 'right')

See also:
CPipe

Definition at line 326 of file AxPipe.h.


Member Function Documentation

void AxPipe::CSplit::AppendSink CSink pSink,
bool  fAutoDeleteSink
[virtual]
 

Do not append a section, it's an error here.

Normally append a sink, but not valid for CSplit

Parameters:
pSink Pointer to an instance of a CSink derived object.
fAutoDeleteSink true if the object should be delete'd when the member upstream is delete'd.

Reimplemented from AxPipe::CPipe.

Definition at line 75 of file CSplit.cpp.

References _T, AxPipe::ERROR_CODE_GENERIC, and AxPipe::CError::SetError().

void AxPipe::CSplit::DestructSink  )  [private, virtual]
 

Always delete the left and right upon deletion of this part.

This is called by the base class destructor. Destruct the chain, waiting for parts of it to finish and skipping parts that should not be auto-destructed. It will call delete for those sections that are marked for auto-destruction. We need to override the the base class definition, since we're not using m_pSink to point to the rest of the chain.

Reimplemented from AxPipe::CPipe.

Definition at line 43 of file CSplit.cpp.

References m_pLeft, m_pRight, and AxPipe::CNoThread::WorkExitWait().

CSplit * AxPipe::CSplit::Init CPipe pLeft,
CPipe pRight
 

Initialize split with left and right pointers to pipes.

The provided pointers to CPipe are always auto delete'd. Errors occurring in either of the two splits are aggregated backwards to the original CSource.

Parameters:
pLeft Pointer to left pipe, does not start with a CPipe, but ends with a CSink
pRight Pointer to right pipe, does not start with a CPipe, but ends with a CSink
Returns:
A pointer to 'this' CSplit.

Definition at line 96 of file CSplit.cpp.

References m_pLeft, and m_pRight.

void AxPipe::CSplit::Out CSeg pSeg  )  [virtual]
 

Send the same segment downstream to both parts of the split.

See also:
CPipe::Out()

Implements AxPipe::CPipe.

Definition at line 104 of file CSplit.cpp.

References PumpSplit().

bool AxPipe::CSplit::OutClose void   )  [virtual]
 

Send a close signal downstream to both parts of the split.

Never indicate propagation, as this object in many ways is a sink.

See also:
CPipe::OutClose()

Reimplemented from AxPipe::CPipe.

Definition at line 130 of file CSplit.cpp.

References AxPipe::eSegTypeClose, and PumpSplit().

bool AxPipe::CSplit::OutFlush  )  [virtual]
 

Send a flush signal downstream to both parts of the split.

Never indicate propagation, as this object in many ways is a sink.

See also:
CPipe::OutFlush()

Reimplemented from AxPipe::CSink.

Definition at line 120 of file CSplit.cpp.

References AxPipe::eSegTypeFlush, and PumpSplit().

bool AxPipe::CSplit::OutOpen  )  [virtual]
 

Send an open signal downstream to both parts of the split.

Never indicate propagation, as this object in many ways is a sink.

See also:
CPipe::OutOpen()

Reimplemented from AxPipe::CPipe.

Definition at line 140 of file CSplit.cpp.

References AxPipe::eSegTypeOpen, and PumpSplit().

void AxPipe::CSplit::OutSpecial CSeg pSeg  )  [virtual]
 

Send the same special segment downstream to both parts of the split.

See also:
CPipe::OutSpecial()

Reimplemented from AxPipe::CPipe.

Definition at line 111 of file CSplit.cpp.

References PumpSplit().

void AxPipe::CSplit::PumpSplit CSeg pSeg  )  [private]
 

Send the same segment down both left and right legs of the split.

Parameters:
pSeg Pointer to a segment to send

Definition at line 59 of file CSplit.cpp.

References AxPipe::CSeg::AddRef(), m_pLeft, m_pRight, and AxPipe::CSink::OutPump().

Referenced by Out(), OutClose(), OutFlush(), OutOpen(), and OutSpecial().

void AxPipe::CSplit::Sync  )  [virtual]
 

Ensure that all threads downstream are idle.

Synchronize all work downstream, ensuring that there is no work in progress.

Reimplemented from AxPipe::CPipe.

Definition at line 82 of file CSplit.cpp.

References m_pLeft, m_pRight, AxPipe::CPipe::Sync(), and AxPipe::CNoThread::WaitForIdle().


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