CAN programming interface environment
Version 3.10
Loading...
Searching...
No Matches
QCanFilterList Class Reference

Detailed Description

A filter list assembles one or multiple CAN frame filters (QCanFilter) into a composite structure that can be assigned to a CAN socket (refer to QCanSocket::setFilterList).

#include <qcan_filter_list.hpp>

Public Member Functions

 QCanFilterList ()
 
QCanFilterListoperator= (const QCanFilterList &clOtherR)
 
int32_t appendFilter (const QCanFilter &clFilterR)
 
void clear (void)
 
bool filter (const QCanFrame &clFrameR) const
 
bool isEmpty (void)
 
bool removeFilter (const int32_t slPositionR)
 

Constructor & Destructor Documentation

◆ QCanFilterList()

QCanFilterList::QCanFilterList ( )

Constructs an empty filter list.

Member Function Documentation

◆ appendFilter()

int32_t QCanFilterList::appendFilter ( const QCanFilter & clFilterR)
Parameters
[in]clFilterRCAN filter to append
Returns
Position of filter inside the list

The function appends a CAN filter of type QCanFilter to the filter list.

◆ clear()

void QCanFilterList::clear ( void )

Clear the filter list (remove all existing filters). An empty filter list does not filter any CAN frame; all CAN frames will pass.

◆ filter()

bool QCanFilterList::filter ( const QCanFrame & clFrameR) const
Parameters
[in]clFrameRCAN frame to process
Returns
TRUE if the frame is filtered (rejected), otherwise FALSE

Process the CAN frame clFrameR against all filters in the list. If the frame passes the filter list the function returns FALSE; if any filter causes rejection the function returns TRUE.

◆ isEmpty()

bool QCanFilterList::isEmpty ( void )

Return true if the filter list is empty (no filters installed).

◆ operator=()

QCanFilterList & QCanFilterList::operator= ( const QCanFilterList & clOtherR)
Parameters
[in]clOtherRReference to filter list to assign
Returns
Reference to this filter list

Assigns clOtherR to this filter list and returns a reference to this filter list.

◆ removeFilter()

bool QCanFilterList::removeFilter ( const int32_t slPositionR)
Parameters
[in]slPositionRIndex of filter to remove (0-based)
Returns
true if the filter at slPositionR existed and was removed, otherwise false

Remove a filter by index from the filter list.