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