00001 /* 00002 * Copyright (c) 2004 CSIRO ICT Centre 00003 * 00004 * $Id: Filter.h 587 2004-12-03 15:06:33Z nch $ 00005 */ 00006 00007 /* 00008 * Filter is the interface that every filter implementation must instantiate. 00009 * 00010 * A filter is created with a matcher - this defines the logic for 00011 * efficiently processing candidates identified by the filter. 00012 * 00013 * Each filter subclass implements a standard filter method. This 00014 * is the generic algorithm that the matcher must support. However, 00015 * the matcher may have an optimised filter operation. This can be 00016 * called using the matchFilter method. Note - this "fast" matcher 00017 * provided filter will thus bypass the Filter subclass means of 00018 * idenifying candidates for refinement. For example, if the "fast" 00019 * cross match filter is used with the nested loop filter, then 00020 * it isn' 00021 * 00022 * The matcher is owned by this class and is deleted by the destructor. 00023 */ 00024 00025 #ifndef FILTER_DEFINED 00026 #define FILTER_DEFINED 00027 00028 #include "String.h" 00029 00030 class Matcher; 00031 00032 00033 class Filter 00034 { 00035 public: 00036 Filter(Matcher * matcher); 00037 00038 virtual ~Filter(); 00039 virtual String const & getName(); 00040 virtual void filter(); 00041 00042 protected: 00043 Matcher * matcher; 00044 00045 virtual void preFilter(); 00046 virtual void postFilter(); 00047 00048 private: 00049 static String s_name; 00050 00051 Filter(Filter const &); 00052 Filter & operator=(Filter const &); 00053 }; 00054 00055 00056 #endif // ifndef FILTER_DEFINED