filter factory in working shape, see example in test_filer_factory.cpp
[metaproxy-moved-to-github.git] / src / filter.hpp
index 73bf2ca..b71e85f 100644 (file)
@@ -1,8 +1,14 @@
+/* $Id: filter.hpp,v 1.7 2005-10-29 22:23:36 marc Exp $
+   Copyright (c) 2005, Index Data.
+
+%LICENSE%
+ */
 
 #ifndef FILTER_HPP
 #define FILTER_HPP
 
 #include <stdexcept>
+#include <libxml/tree.h>
 
 namespace yp2 {
 
@@ -14,28 +20,12 @@ namespace yp2 {
             virtual ~Base(){};
             
             ///sends Package off to next Filter, returns altered Package
-            virtual  void process(Package & package) const {
-            };
-            virtual  void configure(){};
-            
-            /// get function - right val in assignment
-            std::string name() const {
-                return m_name;
-            }
-            
-            /// set function - left val in assignment
-            std::string & name() {
-                return m_name;
-            }
+            virtual void process(Package & package) const = 0;
+
+            virtual void configure(const xmlNode * ptr = 0) { };
             
-            /// set function - can be chained
-            Base & name(const std::string & name){
-                m_name = name;
-                return *this;
-            }
             
-        private:
-            std::string m_name;
+            virtual const std::string type() const = 0;
         };
     }
     
@@ -54,6 +44,7 @@ namespace yp2 {
  * Local variables:
  * c-basic-offset: 4
  * indent-tabs-mode: nil
+ * c-file-style: "stroustrup"
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab
  */