std::string type() function taken out of all filter classes again
[metaproxy-moved-to-github.git] / src / filter.hpp
1 /* $Id: filter.hpp,v 1.8 2005-10-31 09:40:18 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         struct Creator {
29             const char* type;
30             yp2::filter::Base* (*creator)();
31         };
32
33         class FilterException : public std::runtime_error {
34         public:
35             FilterException(const std::string message)
36                 : std::runtime_error("FilterException: " + message){
37             };
38         };
39         
40     }
41   
42 }
43
44 #endif
45 /*
46  * Local variables:
47  * c-basic-offset: 4
48  * indent-tabs-mode: nil
49  * c-file-style: "stroustrup"
50  * End:
51  * vim: shiftwidth=4 tabstop=8 expandtab
52  */