filter factory in working shape, see example in test_filer_factory.cpp
[metaproxy-moved-to-github.git] / src / filter.hpp
1 /* $Id: filter.hpp,v 1.7 2005-10-29 22:23:36 marc Exp $
2    Copyright (c) 2005, Index Data.
3
4 %LICENSE%
5  */
6
7 #ifndef FILTER_HPP
8 #define FILTER_HPP
9
10 #include <stdexcept>
11 #include <libxml/tree.h>
12
13 namespace yp2 {
14
15     class Package;
16
17     namespace filter {
18         class Base {
19         public:
20             virtual ~Base(){};
21             
22             ///sends Package off to next Filter, returns altered Package
23             virtual void process(Package & package) const = 0;
24
25             virtual void configure(const xmlNode * ptr = 0) { };
26             
27             
28             virtual const std::string type() const = 0;
29         };
30     }
31     
32     class FilterException : public std::runtime_error {
33     public:
34         FilterException(const std::string message)
35             : std::runtime_error("FilterException: " + message){
36         };
37     };
38
39   
40 }
41
42 #endif
43 /*
44  * Local variables:
45  * c-basic-offset: 4
46  * indent-tabs-mode: nil
47  * c-file-style: "stroustrup"
48  * End:
49  * vim: shiftwidth=4 tabstop=8 expandtab
50  */