Updated copyright headers. Omit CVS ID.
[metaproxy-moved-to-github.git] / src / filter_template.cpp
1 /* This file is part of Metaproxy.
2    Copyright (C) 2005-2008 Index Data
3
4 Metaproxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17 */
18 /* $Id: filter_template.cpp,v 1.12 2008-02-20 15:07:52 adam Exp $
19    Copyright (c) 2005-2007, Index Data.
20
21    See the LICENSE file for details
22  */
23
24 #include "config.hpp"
25 #include "filter.hpp"
26 #include "filter_template.hpp"
27 #include "package.hpp"
28 #include "util.hpp"
29
30 #include <boost/thread/mutex.hpp>
31
32 #include <yaz/zgdu.h>
33
34 namespace mp = metaproxy_1;
35 namespace yf = mp::filter;
36
37 namespace metaproxy_1 {
38     namespace filter {
39         class Template::Impl {
40         public:
41             Impl();
42             ~Impl();
43             void process(metaproxy_1::Package & package) const;
44             void configure(const xmlNode * ptr);
45         private:
46             int m_dummy;
47         };
48     }
49 }
50
51 // define Pimpl wrapper forwarding to Impl
52  
53 yf::Template::Template() : m_p(new Impl)
54 {
55 }
56
57 yf::Template::~Template()
58 {  // must have a destructor because of boost::scoped_ptr
59 }
60
61 void yf::Template::configure(const xmlNode *xmlnode, bool test_only)
62 {
63     m_p->configure(xmlnode);
64 }
65
66 void yf::Template::process(mp::Package &package) const
67 {
68     m_p->process(package);
69 }
70
71
72 // define Implementation stuff
73
74
75
76 yf::Template::Impl::Impl()
77 {
78     m_dummy = 1;
79 }
80
81 yf::Template::Impl::~Impl()
82
83 }
84
85 void yf::Template::Impl::configure(const xmlNode *xmlnode)
86 {
87 }
88
89 void yf::Template::Impl::process(mp::Package &package) const
90 {
91     // Z_GDU *gdu = package.request().get();
92     package.move();
93 }
94
95
96 static mp::filter::Base* filter_creator()
97 {
98     return new mp::filter::Template;
99 }
100
101 extern "C" {
102     struct metaproxy_1_filter_struct metaproxy_1_filter_template = {
103         0,
104         "template",
105         filter_creator
106     };
107 }
108
109
110 /*
111  * Local variables:
112  * c-basic-offset: 4
113  * indent-tabs-mode: nil
114  * c-file-style: "stroustrup"
115  * End:
116  * vim: shiftwidth=4 tabstop=8 expandtab
117  */