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

AxPipe::Stock::CPipeFindSync Class Reference

Scan a stream for a sync-sequence, skipping until found. More...

#include <CPipeFindSync.h>

Inheritance diagram for AxPipe::Stock::CPipeFindSync:

Inheritance graph
[legend]
Collaboration diagram for AxPipe::Stock::CPipeFindSync:

Collaboration graph
[legend]
List of all members.

Public Member Functions

CPipeFindSyncInit (const void *p, size_t cb, bool fInvert=false, int iSkipTo=1)
 Set the sync sequence to look for.


Protected Member Functions

void Out (AxPipe::CSeg *pSeg)
 Accept pushed data and skip until sync.


Private Member Functions

void PumpBuf (size_t cbBuf)
 Re-generate early parts of the sync sequence.


Private Attributes

int m_iSkipTo
 Number of GUID's to skip + 1.

const unsigned char * m_pPattern
 Ptr to the pattern to search for.

size_t m_cbPattern
 Length of pattern.

size_t m_iNext
 Index of next byte to match in pattern.

int m_iInvert
 Flag set to 1 if we are to bit-flip the pattern.

bool m_fSkipAfterSync
 Determine what happens after we've sync'd-.


Detailed Description

Scan a stream for a sync-sequence, skipping until found.

Find sync and start or stop passing it on from that point. The default is to start passing data after the first sync that is found, but it's possible to specify how many to skip. The actual sync sequence is not passed along, only the data following it. In some cases it may be necessary to bit-flip the pattern before compare, do specify in the call to Init().

Definition at line 48 of file CPipeFindSync.h.


Member Function Documentation

AxPipe::Stock::CPipeFindSync * AxPipe::Stock::CPipeFindSync::Init const void *  p,
size_t  cb,
bool  fInvert = false,
int  iSkipTo = 1
 

Set the sync sequence to look for.

Initialize the pattern to sync with. Note that the we only save a reference to the pattern, so it must not be destructed before this object. Use a negative value of iSkipTo to indicate that you'd like to pass data _until_ the given number of patterns are detected.

Parameters:
p The pattern, do not destruct before this object.
cb The length of the pattern in p
fInvert Set to true if the pattern should be bitflipped before comparison
iSkipTo The number of syncs to find before starting/stopping pass-through
Returns:
A pointer to 'this'

Definition at line 44 of file CPipeFindSync.cpp.

References m_cbPattern, m_fSkipAfterSync, m_iInvert, m_iNext, m_iSkipTo, and m_pPattern.

void AxPipe::Stock::CPipeFindSync::Out AxPipe::CSeg pSeg  )  [protected, virtual]
 

Accept pushed data and skip until sync.

Accepted segements of pushed data, skipping m_iSkipTo number of occurrences of of the pattern represented by m_pPattern and m_cbPattern before starting to to pass segments through.

Parameters:
pSeg The AxPipe::CSeg that contains the next data segment

Implements AxPipe::CPipe.

Definition at line 72 of file CPipeFindSync.cpp.

void AxPipe::Stock::CPipeFindSync::PumpBuf size_t  cbBuf  )  [private]
 

Re-generate early parts of the sync sequence.

Regenerate a partial sync sequence that we've already passed

Parameters:
cbMunched The number of sync sequence bytes to re-generate

Definition at line 57 of file CPipeFindSync.cpp.


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