#include <AxPipe.h>
Inheritance diagram for AxPipe::CJoin:
Public Member Functions | |
CJoin () | |
Construct the CJoin, but Init() must also be called. | |
virtual | ~CJoin () |
Also destruct all the CTSinkJoin sink-objects. | |
void | OutPlug () |
Handle Plug() of the stream, checking all input streams for errors too. | |
CSink & | GetSink (int ix) |
CJoin * | Init (int nMaxStreams=2) |
Define how many streams you want here. | |
CSeg * | StreamSeg (int ix) |
Wait for data from the in-stream, get it and indicate when done. | |
int | StreamIx (int ix) |
Set and return the current input stream index. | |
int | StreamNum () |
Get the number of streams. | |
bool | StreamEmpty (int ix) |
Tell if an indexed stream is marked as empty. | |
Private Attributes | |
CTSinkJoin ** | m_ppInSinks |
The array of in-stream control objects. | |
int | m_nMaxStreams |
The max number of streams we're prepared for with Init(). |
Build any number of streams, with CSource's at the start and any number of CPipe sections, but do not terminate them with a CSink.
Call Init(int) specifying how many streams you wish to attach to the join.
Get a CSink to terminate them with by calling the GetSink(int) member, with a sink index as argument. This attaches the stream to the CJoin. If a stream is started from a separate CSource, use CThreadSource<> to setup a thread in which to run it.
Override the In() member function to peform custom merging of many streams into one. They are indexed 0 to n-1. Use StreamSeg(int) to call the appropriate stream fiber context. StreamIx(int) to ensure an index is valid. StreamNum() to get the maximum number of streams and StreamEmpty(int) to check if an input stream is marked as empty.
The class supports merging of any number of streams.
Definition at line 532 of file AxPipe.h.
|
Get a CSink that can be used to terminate an input stream, passing the data to the CJoin. A reference is returned, do not take the address of it and use as a pointer. This object must be destructed by the CJoin code, not the pipe it gets CPipe::Append()'ed to.
Definition at line 165 of file CJoin.cpp. References _T, ASSCHK, m_nMaxStreams, and m_ppInSinks. |
|
Define how many streams you want here.
Definition at line 150 of file CJoin.cpp. References m_nMaxStreams, and m_ppInSinks. |
|
Tell if an indexed stream is marked as empty.
Definition at line 206 of file CJoin.cpp. References AxPipe::CJoin::CTSinkJoin::IsEmpty(), and m_ppInSinks. Referenced by CJoinInterleave::In(). |
|
Set and return the current input stream index.
Definition at line 191 of file CJoin.cpp. References m_nMaxStreams. Referenced by CJoinInterleave::In(). |
|
Get the number of streams.
Definition at line 198 of file CJoin.cpp. References m_nMaxStreams. |
|
Wait for data from the in-stream, get it and indicate when done.
Definition at line 176 of file CJoin.cpp. References _T, ASSCHK, AxPipe::CJoin::CTSinkJoin::GetSeg(), AxPipe::CJoin::CTSinkJoin::IsEmpty(), m_nMaxStreams, m_ppInSinks, and AxPipe::CJoin::CTSinkJoin::SinkWorkWait(). Referenced by CJoinInterleave::In(). |