Update of /cvsroot/mahogany/M/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29690/include

Modified Files:
        SpamFilter.h 
Log Message:
added spam filter cost and use the cheapest filters first

Index: SpamFilter.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/SpamFilter.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- SpamFilter.h        10 Jul 2004 20:26:45 -0000      1.2
+++ SpamFilter.h        10 Jul 2004 20:55:38 -0000      1.3
@@ -171,4 +171,14 @@
    virtual const wxChar *GetName() const = 0;
 
+   /**
+      Return the computational/speed cost of using this filter.
+
+      Cheaper filters are applied first, i.e. those which run the fastest are
+      applied before the slower ones.
+
+      This method is implemented by DECLARE_SPAM_FILTER() macro below.
+    */
+   virtual unsigned int GetCost() const = 0;
+
    //@}
 
@@ -208,10 +218,15 @@
   This macro must be used in SpamFilter-derived class declaration.
 
-  It defines GetName() which returns the parameter of the macro.
+  It defines GetName() and GetCost() methods.
 
   There should be no semicolon after this macro.
+
+  @param name short name of the filter
+  @param cost performance cost of using this filter, from 0 to +infinity
+              (cheaper filters are applied first)
  */
-#define DECLARE_SPAM_FILTER(name)                                             \
+#define DECLARE_SPAM_FILTER(name, cost)                                       \
    public:                                                                    \
+      virtual unsigned int GetCost() const { return cost; }                   \
       virtual const wxChar *GetName() const { return _T(name); }
 
@@ -224,5 +239,5 @@
   @param cpyright the module author/copyright string
  */
-#define IMPLEMENT_SPAM_FILTER(cname, desc, cpyright)                          \
+#define IMPLEMENT_SPAM_FILTER(cname, cost, desc, cpyright)                    \
    class cname##Factory : public SpamFilterFactory                            \
    {                                                                          \



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to