vdr  2.4.1
Protected Member Functions | Private Attributes | Friends | List of all members
cFilter Class Referenceabstract

#include <filter.h>

Protected Member Functions

 cFilter (void)
 
 cFilter (u_short Pid, u_char Tid, u_char Mask=0xFF)
 
virtual ~cFilter ()
 
virtual void SetStatus (bool On)
 
virtual void Process (u_short Pid, u_char Tid, const u_char *Data, int Length)=0
 
int Source (void)
 
int Transponder (void)
 
const cChannelChannel (void)
 
bool Matches (u_short Pid, u_char Tid)
 
void Set (u_short Pid, u_char Tid, u_char Mask=0xFF)
 
void Add (u_short Pid, u_char Tid, u_char Mask=0xFF, bool Sticky=false)
 
void Del (u_short Pid, u_char Tid, u_char Mask=0xFF)
 

Private Attributes

cSectionHandlersectionHandler
 
cList< cFilterDatadata
 
bool on
 

Friends

class cSectionHandler
 

Additional Inherited Members

- Public Member Functions inherited from cListObject
 cListObject (void)
 
virtual ~cListObject ()
 
virtual int Compare (const cListObject &ListObject) const
 
void Append (cListObject *Object)
 
void Insert (cListObject *Object)
 
void Unlink (void)
 
int Index (void) const
 
cListObjectPrev (void) const
 
cListObjectNext (void) const
 

Detailed Description

Definition at line 49 of file filter.h.

Constructor & Destructor Documentation

◆ cFilter() [1/2]

cFilter::cFilter ( void  )
protected

Definition at line 95 of file filter.c.

References on, and sectionHandler.

◆ cFilter() [2/2]

cFilter::cFilter ( u_short  Pid,
u_char  Tid,
u_char  Mask = 0xFF 
)
protected

Definition at line 101 of file filter.c.

References on, sectionHandler, and Set().

◆ ~cFilter()

cFilter::~cFilter ( )
protectedvirtual

Definition at line 108 of file filter.c.

References cSectionHandler::Detach(), and sectionHandler.

Member Function Documentation

◆ Add()

void cFilter::Add ( u_short  Pid,
u_char  Tid,
u_char  Mask = 0xFF,
bool  Sticky = false 
)
protected

Adds the given filter data to this filter.

If Sticky is true, this will survive a status change, otherwise it will be automatically deleted.

Definition at line 167 of file filter.c.

References cSectionHandler::Add(), cListBase::Add(), data, on, and sectionHandler.

Referenced by cPatFilter::Process(), Set(), and cPatFilter::SwitchToNextPmtPid().

◆ Channel()

const cChannel * cFilter::Channel ( void  )
protected

Returns the channel of the data delivered to this filter.

Definition at line 124 of file filter.c.

References cSectionHandler::Channel(), and sectionHandler.

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

◆ Del()

void cFilter::Del ( u_short  Pid,
u_char  Tid,
u_char  Mask = 0xFF 
)
protected

Deletes the given filter data from this filter.

Definition at line 175 of file filter.c.

References data, cSectionHandler::Del(), cListBase::Del(), cList< T >::First(), cList< T >::Next(), on, and sectionHandler.

Referenced by cPatFilter::Process(), and cPatFilter::SwitchToNextPmtPid().

◆ Matches()

bool cFilter::Matches ( u_short  Pid,
u_char  Tid 
)
protected

Indicates whether this filter wants to receive data from the given Pid/Tid.

Definition at line 151 of file filter.c.

References data, cList< T >::First(), cList< T >::Next(), and on.

◆ Process()

virtual void cFilter::Process ( u_short  Pid,
u_char  Tid,
const u_char *  Data,
int  Length 
)
protectedpure virtual

Processes the data delivered to this filter.

Pid and Tid is one of the combinations added to this filter by a previous call to Add(), Data is a pointer to Length bytes of data. This function will be called from the section handler's thread, so it has to use proper locking mechanisms in case it accesses any global data. It is guaranteed that if several cFilters are attached to the same cSectionHandler, only one of them has its Process() function called at any given time. It is allowed that more than one cFilter are set up to receive the same Pid/Tid. The Process() function must return as soon as possible.

Implemented in cPatFilter, cEitFilter, cSdtFilter, and cNitFilter.

◆ Set()

void cFilter::Set ( u_short  Pid,
u_char  Tid,
u_char  Mask = 0xFF 
)
protected

Sets the given filter data by calling Add() with Sticky = true.

Definition at line 162 of file filter.c.

References Add().

Referenced by cEitFilter::cEitFilter(), cFilter(), cNitFilter::cNitFilter(), cPatFilter::cPatFilter(), and cSdtFilter::cSdtFilter().

◆ SetStatus()

void cFilter::SetStatus ( bool  On)
protectedvirtual

Turns this filter on or off, depending on the value of On.

If the filter is turned off, any filter data that has been added without the Sticky parameter set to 'true' will be automatically deleted. Those parameters that have been added with Sticky set to 'true' will be automatically reused when SetStatus(true) is called.

Reimplemented in cPatFilter, cEitFilter, cSdtFilter, and cNitFilter.

Definition at line 129 of file filter.c.

References cSectionHandler::Add(), data, cSectionHandler::Del(), cListBase::Del(), cList< T >::First(), cListObject::next, cList< T >::Next(), on, sectionHandler, and cFilterData::sticky.

Referenced by cSectionHandler::Attach(), cSectionHandler::Detach(), cNitFilter::SetStatus(), cSdtFilter::SetStatus(), cEitFilter::SetStatus(), and cPatFilter::SetStatus().

◆ Source()

int cFilter::Source ( void  )
protected

Returns the source of the data delivered to this filter.

Definition at line 114 of file filter.c.

References sectionHandler, and cSectionHandler::Source().

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

◆ Transponder()

int cFilter::Transponder ( void  )
protected

Returns the transponder of the data delivered to this filter.

Definition at line 119 of file filter.c.

References sectionHandler, and cSectionHandler::Transponder().

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

Friends And Related Function Documentation

◆ cSectionHandler

friend class cSectionHandler
friend

Definition at line 50 of file filter.h.

Member Data Documentation

◆ data

cList<cFilterData> cFilter::data
private

Definition at line 53 of file filter.h.

Referenced by Add(), Del(), Matches(), and SetStatus().

◆ on

bool cFilter::on
private

Definition at line 54 of file filter.h.

Referenced by Add(), cFilter(), Del(), Matches(), and SetStatus().

◆ sectionHandler

cSectionHandler* cFilter::sectionHandler
private

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