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