Year 2007.
[metaproxy-moved-to-github.git] / src / filter_template.cpp
1 /* $Id: filter_template.cpp,v 1.10 2007-01-25 14:05:54 adam Exp $
2    Copyright (c) 2005-2007, Index Data.
3
4    See the LICENSE file for details
5  */
6
7 #include "config.hpp"
8 #include "filter.hpp"
9 #include "filter_template.hpp"
10 #include "package.hpp"
11 #include "util.hpp"
12
13 #include <boost/thread/mutex.hpp>
14
15 #include <yaz/zgdu.h>
16
17 namespace mp = metaproxy_1;
18 namespace yf = mp::filter;
19
20 namespace metaproxy_1 {
21     namespace filter {
22         class Template::Impl {
23         public:
24             Impl();
25             ~Impl();
26             void process(metaproxy_1::Package & package) const;
27             void configure(const xmlNode * ptr);
28         private:
29             int m_dummy;
30         };
31     }
32 }
33
34 // define Pimpl wrapper forwarding to Impl
35  
36 yf::Template::Template() : m_p(new Impl)
37 {
38 }
39
40 yf::Template::~Template()
41 {  // must have a destructor because of boost::scoped_ptr
42 }
43
44 void yf::Template::configure(const xmlNode *xmlnode)
45 {
46     m_p->configure(xmlnode);
47 }
48
49 void yf::Template::process(mp::Package &package) const
50 {
51     m_p->process(package);
52 }
53
54
55 // define Implementation stuff
56
57
58
59 yf::Template::Impl::Impl()
60 {
61     m_dummy = 1;
62 }
63
64 yf::Template::Impl::~Impl()
65
66 }
67
68 void yf::Template::Impl::configure(const xmlNode *xmlnode)
69 {
70 }
71
72 void yf::Template::Impl::process(mp::Package &package) const
73 {
74     // Z_GDU *gdu = package.request().get();
75     package.move();
76 }
77
78
79 static mp::filter::Base* filter_creator()
80 {
81     return new mp::filter::Template;
82 }
83
84 extern "C" {
85     struct metaproxy_1_filter_struct metaproxy_1_filter_template = {
86         0,
87         "template",
88         filter_creator
89     };
90 }
91
92
93 /*
94  * Local variables:
95  * c-basic-offset: 4
96  * indent-tabs-mode: nil
97  * c-file-style: "stroustrup"
98  * End:
99  * vim: shiftwidth=4 tabstop=8 expandtab
100  */