cFilter Class Reference

#include <filter.h>

Inheritance diagram for cFilter:

Inheritance graph
[legend]
Collaboration diagram for cFilter:

Collaboration graph
[legend]

List of all members.

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)
 Returns the source of the data delivered to this filter.
int Transponder (void)
 Returns the transponder of the data delivered to this filter.
const cChannelChannel (void)
 Returns the channel of the data delivered to this filter.
bool Matches (u_short Pid, u_char Tid)
 Indicates whether this filter wants to receive data from the given Pid/Tid.
void Set (u_short Pid, u_char Tid, u_char Mask=0xFF)
 Sets the given filter data by calling Add() with Sticky = true.
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)
 Deletes the given filter data from this filter.

Private Attributes

cSectionHandlersectionHandler
cList< cFilterDatadata
bool on

Friends

class cSectionHandler


Detailed Description

Definition at line 41 of file filter.h.


Constructor & Destructor Documentation

cFilter::cFilter ( void   )  [protected]

Definition at line 70 of file filter.c.

References on, and sectionHandler.

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

Definition at line 76 of file filter.c.

References on, sectionHandler, and Set().

Here is the call graph for this function:

cFilter::~cFilter (  )  [protected, virtual]

Definition at line 83 of file filter.c.

References cSectionHandler::Detach(), and sectionHandler.

Here is the call graph for this function:


Member Function Documentation

void cFilter::SetStatus ( bool  On  )  [protected, virtual]

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 cNitFilter, cPatFilter, and cSdtFilter.

Definition at line 104 of file filter.c.

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

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

Here is the call graph for this function:

virtual void cFilter::Process ( u_short  Pid,
u_char  Tid,
const u_char *  Data,
int  Length 
) [protected, pure 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 cEitFilter, cNitFilter, cPatFilter, and cSdtFilter.

int cFilter::Source ( void   )  [protected]

Returns the source of the data delivered to this filter.

Definition at line 89 of file filter.c.

References sectionHandler, and cSectionHandler::Source().

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

Here is the call graph for this function:

int cFilter::Transponder ( void   )  [protected]

Returns the transponder of the data delivered to this filter.

Definition at line 94 of file filter.c.

References sectionHandler, and cSectionHandler::Transponder().

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

Here is the call graph for this function:

const cChannel * cFilter::Channel ( void   )  [protected]

Returns the channel of the data delivered to this filter.

Definition at line 99 of file filter.c.

References cSectionHandler::Channel(), and sectionHandler.

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

Here is the call graph for this function:

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 126 of file filter.c.

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

Here is the call graph for this function:

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 137 of file filter.c.

References Add().

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

Here is the call graph for this function:

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 142 of file filter.c.

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

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

Here is the call graph for this function:

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 150 of file filter.c.

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

Referenced by cPatFilter::Process().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class cSectionHandler [friend]

Definition at line 42 of file filter.h.


Member Data Documentation

cSectionHandler* cFilter::sectionHandler [private]

Definition at line 44 of file filter.h.

Referenced by Add(), cSectionHandler::Attach(), cFilter(), Channel(), Del(), cSectionHandler::Detach(), SetStatus(), Source(), Transponder(), and ~cFilter().

cList<cFilterData> cFilter::data [private]

Definition at line 45 of file filter.h.

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

bool cFilter::on [private]

Definition at line 46 of file filter.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Nov 6 20:12:29 2007 for VDR by  doxygen 1.5.3-20071008