All filters declare a yp2_filter_struct - used for both static and
[metaproxy-moved-to-github.git] / src / filter_backend_test.cpp
index 737ffd2..d622530 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: filter_backend_test.cpp,v 1.9 2005-11-03 14:45:16 adam Exp $
+/* $Id: filter_backend_test.cpp,v 1.11 2006-01-04 11:19:04 adam Exp $
    Copyright (c) 2005, Index Data.
 
 %LICENSE%
@@ -9,21 +9,21 @@
 #include "filter.hpp"
 #include "router.hpp"
 #include "package.hpp"
-
-#include <boost/thread/mutex.hpp>
-
 #include "util.hpp"
 #include "filter_backend_test.hpp"
 
+#include <stdexcept>
+#include <list>
+#include <map>
+#include <iostream>
+
+#include <boost/thread/mutex.hpp>
+
 #include <yaz/zgdu.h>
 #include <yaz/log.h>
 #include <yaz/otherinfo.h>
 #include <yaz/diagbib1.h>
 
-#include <list>
-#include <map>
-#include <iostream>
-
 namespace yf = yp2::filter;
 
 namespace yp2 {
@@ -142,6 +142,19 @@ void yf::Backend_test::process(Package &package) const
         m_p->m_sessions.release(package.session());
 }
 
+static yp2::filter::Base* filter_creator()
+{
+    return new yp2::filter::Backend_test;
+}
+
+extern "C" {
+    const struct yp2_filter_struct yp2_filter_backend_test = {
+        0,
+        "backend_test",
+        filter_creator
+    };
+}
+
 
 /*
  * Local variables: