All filters declare a yp2_filter_struct - used for both static and
[metaproxy-moved-to-github.git] / src / filter_template.cpp
1 /* $Id: filter_template.cpp,v 1.3 2006-01-04 11:19:04 adam Exp $
2    Copyright (c) 2005, Index Data.
3
4 %LICENSE%
5  */
6
7 #include "config.hpp"
8
9 #include "filter.hpp"
10 #include "router.hpp"
11 #include "package.hpp"
12
13 #include <boost/thread/mutex.hpp>
14
15 #include "util.hpp"
16 #include "filter_template.hpp"
17
18 #include <yaz/zgdu.h>
19
20 namespace yf = yp2::filter;
21
22 namespace yp2 {
23     namespace filter {
24         class Template::Rep {
25             friend class Template;
26             int dummy;
27         };
28     }
29 }
30
31 yf::Template::Template() : m_p(new Rep)
32 {
33     m_p->dummy = 1;
34 }
35
36 yf::Template::~Template()
37 {  // must have a destructor because of boost::scoped_ptr
38 }
39
40 void yf::Template::process(Package &package) const
41 {
42     // Z_GDU *gdu = package.request().get();
43     package.move();
44 }
45
46 static yp2::filter::Base* filter_creator()
47 {
48     return new yp2::filter::Template;
49 }
50
51 extern "C" {
52     const struct yp2_filter_struct yp2_filter_template = {
53         0,
54         "template",
55         filter_creator
56     };
57 }
58
59
60 /*
61  * Local variables:
62  * c-basic-offset: 4
63  * indent-tabs-mode: nil
64  * c-file-style: "stroustrup"
65  * End:
66  * vim: shiftwidth=4 tabstop=8 expandtab
67  */