CompatibleFilterList Class Reference

Simple list class to allow a list of compatible filters to be maintained. More...

#include <filters.h>

Inheritance diagram for CompatibleFilterList:

List CCObject SimpleCCObject List of all members.

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.

Detailed Description

Simple list class to allow a list of compatible filters to be maintained.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/03/94
See also:
CompatibleFilter; Filter; FilterFamily; CompatibleFilterList::AddFilter

Definition at line 976 of file filters.h.


Member Function Documentation

BOOL CompatibleFilterList::AddFilter Filter pFilter,
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.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/03/94
Parameters:
pFilter - the filter to add to the list. [INPUTS] Compatibility - the compatibility rating of the filter.
Returns:
TRUE if the filter was added to the list ok; FALSE if not.

Errors: Out of memory.

See also:
ComaptibleFilterList; CompatibleFilter

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 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:53:03 2007 for Camelot by  doxygen 1.4.4