#include <filters.h>
Inheritance diagram for CompatibleFilterList:
Public Member Functions | |
BOOL | AddFilter (Filter *, INT32 Compatibility) |
Add a new item to the compatible filter list, which points to the given filter, and stores the given compatibility rating in the list entry. The list is kept in sorted order, i.e. the list item is added to the list according to its compatibility rating; the higher the rating, the closer it is to the head of the list. |
Definition at line 976 of file filters.h.
|
Add a new item to the compatible filter list, which points to the given filter, and stores the given compatibility rating in the list entry. The list is kept in sorted order, i.e. the list item is added to the list according to its compatibility rating; the higher the rating, the closer it is to the head of the list.
Definition at line 4594 of file filters.cpp. 04595 { 04596 // Make a new list item for this filter. 04597 CompatibleFilter *pNewItem = new CompatibleFilter(pFilter, Compatibility); 04598 if (pNewItem == NULL) 04599 return FALSE; 04600 04601 // Search for the correct place in the list 04602 CompatibleFilter *pItem = (CompatibleFilter *) GetHead(); 04603 04604 while ((pItem != NULL) && (pItem->Compatibility > Compatibility)) 04605 pItem = (CompatibleFilter *) GetNext(pItem); 04606 04607 // If come to the end of the list, add it to the end, otherwise add before the 04608 // current item 04609 if (pItem == NULL) 04610 AddTail(pNewItem); 04611 else 04612 InsertBefore(pItem, pNewItem); 04613 04614 // All ok 04615 return TRUE; 04616 }
|