vdr  2.7.6
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cSectionSyncer Class Reference

#include <filter.h>

Public Member Functions

 cSectionSyncer (bool Random=false)
 
void Reset (void)
 
bool Check (uchar Version, int SectionNumber)
 
bool Processed (int SectionNumber, int LastSectionNumber, int SegmentLastSectionNumber=-1)
 
bool Complete (void)
 

Private Member Functions

void SetSectionFlag (uchar Section, bool On)
 
bool GetSectionFlag (uchar Section)
 

Private Attributes

int currentVersion
 
int currentSection
 
bool random
 
bool synced
 
bool complete
 
uint32_t segments
 
uchar sections [32]
 

Detailed Description

Definition at line 16 of file filter.h.

Constructor & Destructor Documentation

◆ cSectionSyncer()

cSectionSyncer::cSectionSyncer ( bool  Random = false)

Sets up a new section syncer.

Call Check() to see whether a given section needs processing. Once the section has been processed, call Processed() to mark it as such. If, for any reason, processing is not completed after calling Check(), nothing special needs to be done. Just don't call Processed() and a later call to Check() with the same SectionNumber will return true again. If Random is true, sections can be processed in random order, not necessarily starting with section 0.

Definition at line 15 of file filter.c.

References random, and Reset().

Member Function Documentation

◆ Check()

bool cSectionSyncer::Check ( uchar  Version,
int  SectionNumber 
)

Returns true if Version is not the current version, or the given SectionNumber has not been marked as processed, yet.

Sections are handled in ascending order, starting at 0, unless Random is true in the constructor call.

Definition at line 31 of file filter.c.

References complete, currentSection, currentVersion, GetSectionFlag(), random, Reset(), and synced.

Referenced by cEitTables::Check(), cNitFilter::Process(), cPatFilter::Process(), and cSdtFilter::Process().

◆ Complete()

bool cSectionSyncer::Complete ( void  )
inline

Returns true if all sections have been processed.

Definition at line 48 of file filter.h.

References complete.

◆ GetSectionFlag()

bool cSectionSyncer::GetSectionFlag ( uchar  Section)
inlineprivate

Definition at line 26 of file filter.h.

References sections.

Referenced by Check().

◆ Processed()

bool cSectionSyncer::Processed ( int  SectionNumber,
int  LastSectionNumber,
int  SegmentLastSectionNumber = -1 
)

Marks the given SectionNumber as processed.

LastSectionNumber is used to determine whether all sections have been processed. SegmentLastSectionNumber can be given to handle partially filled segments (like, for instance in the EIT). Returns true if all sections have been processed.

Definition at line 54 of file filter.c.

References complete, currentSection, random, sections, segments, and SetSectionFlag().

Referenced by cNitFilter::Process(), cPatFilter::Process(), and cSdtFilter::Process().

◆ Reset()

void cSectionSyncer::Reset ( void  )

◆ SetSectionFlag()

void cSectionSyncer::SetSectionFlag ( uchar  Section,
bool  On 
)
inlineprivate

Definition at line 25 of file filter.h.

References sections.

Referenced by Processed().

Member Data Documentation

◆ complete

bool cSectionSyncer::complete
private

Definition at line 22 of file filter.h.

Referenced by Check(), Complete(), Processed(), and Reset().

◆ currentSection

int cSectionSyncer::currentSection
private

Definition at line 19 of file filter.h.

Referenced by Check(), Processed(), and Reset().

◆ currentVersion

int cSectionSyncer::currentVersion
private

Definition at line 18 of file filter.h.

Referenced by Check(), and Reset().

◆ random

bool cSectionSyncer::random
private

Definition at line 20 of file filter.h.

Referenced by Check(), cSectionSyncer(), and Processed().

◆ sections

uchar cSectionSyncer::sections[32]
private

Definition at line 24 of file filter.h.

Referenced by GetSectionFlag(), Processed(), Reset(), and SetSectionFlag().

◆ segments

uint32_t cSectionSyncer::segments
private

Definition at line 23 of file filter.h.

Referenced by Processed(), and Reset().

◆ synced

bool cSectionSyncer::synced
private

Definition at line 21 of file filter.h.

Referenced by Check(), and Reset().


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