renamed true PIMPL implementation SRUtoZ3950::Rep to SRUtoZ3950::Impl
updated true PIMPL Template::Impl
-/* $Id: filter.hpp,v 1.17 2006-06-10 14:29:12 adam Exp $
+/* $Id: filter.hpp,v 1.18 2006-09-29 09:48:35 marc Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
///sends Package off to next Filter, returns altered Package
virtual void process(Package & package) const = 0;
///sends Package off to next Filter, returns altered Package
virtual void process(Package & package) const = 0;
+ /// configuration during filter load
virtual void configure(const xmlNode * ptr);
};
virtual void configure(const xmlNode * ptr);
};
-/* $Id: filter_sru_to_z3950.cpp,v 1.15 2006-09-29 08:42:47 marc Exp $
+/* $Id: filter_sru_to_z3950.cpp,v 1.16 2006-09-29 09:48:36 marc Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
namespace metaproxy_1 {
namespace filter {
namespace metaproxy_1 {
namespace filter {
- class SRUtoZ3950::Rep {
- private:
- union SRW_query {char * cql; char * xcql; char * pqf;};
- typedef const int& SRW_query_type;
+ class SRUtoZ3950::Impl {
public:
void configure(const xmlNode *xmlnode);
void process(metaproxy_1::Package &package) const;
private:
public:
void configure(const xmlNode *xmlnode);
void process(metaproxy_1::Package &package) const;
private:
+ union SRW_query {char * cql; char * xcql; char * pqf;};
+ typedef const int& SRW_query_type;
+ private:
std::string sru_protocol(const Z_HTTP_Request &http_req) const;
std::string debug_http(const Z_HTTP_Request &http_req) const;
void http_response(mp::Package &package,
std::string sru_protocol(const Z_HTTP_Request &http_req) const;
std::string debug_http(const Z_HTTP_Request &http_req) const;
void http_response(mp::Package &package,
Z_SRW_PDU *sru_pdu_res,
Z_SRW_scanRequest
const *sr_req) const;
Z_SRW_PDU *sru_pdu_res,
Z_SRW_scanRequest
const *sr_req) const;
- Z_ElementSetNames * build_esn_from_schema(mp::odr &odr_en, const char *schema) const;
- int z3950_to_srw_diag(mp::odr &odr_en, Z_SRW_searchRetrieveResponse *srw_res,
+ Z_ElementSetNames * build_esn_from_schema(mp::odr &odr_en,
+ const char *schema)
+ const;
+ int z3950_to_srw_diag(mp::odr &odr_en,
+ Z_SRW_searchRetrieveResponse *srw_res,
Z_DefaultDiagFormat *ddf) const;
};
}
}
Z_DefaultDiagFormat *ddf) const;
};
}
}
-yf::SRUtoZ3950::SRUtoZ3950() : m_p(new Rep)
+yf::SRUtoZ3950::SRUtoZ3950() : m_p(new Impl)
-void yf::SRUtoZ3950::Rep::configure(const xmlNode *xmlnode)
+void yf::SRUtoZ3950::Impl::configure(const xmlNode *xmlnode)
-void yf::SRUtoZ3950::Rep::process(mp::Package &package) const
+void yf::SRUtoZ3950::Impl::process(mp::Package &package) const
{
Z_GDU *zgdu_req = package.request().get();
{
Z_GDU *zgdu_req = package.request().get();
-bool yf::SRUtoZ3950::Rep::build_simple_explain(mp::Package &package,
+bool yf::SRUtoZ3950::Impl::build_simple_explain(mp::Package &package,
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
Z_SRW_explainRequest
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
Z_SRW_explainRequest
-bool yf::SRUtoZ3950::Rep::build_sru_debug_package(mp::Package &package) const
+bool yf::SRUtoZ3950::Impl::build_sru_debug_package(mp::Package &package) const
{
Z_GDU *zgdu_req = package.request().get();
if (zgdu_req && zgdu_req->which == Z_GDU_HTTP_Request)
{
Z_GDU *zgdu_req = package.request().get();
if (zgdu_req && zgdu_req->which == Z_GDU_HTTP_Request)
-bool yf::SRUtoZ3950::Rep::build_sru_response(mp::Package &package,
+bool yf::SRUtoZ3950::Impl::build_sru_response(mp::Package &package,
mp::odr &odr_en,
Z_SOAP *soap,
const Z_SRW_PDU *sru_pdu_res,
mp::odr &odr_en,
Z_SOAP *soap,
const Z_SRW_PDU *sru_pdu_res,
- Z_SRW_PDU * yf::SRUtoZ3950::Rep::decode_sru_request(mp::Package &package,
+ Z_SRW_PDU * yf::SRUtoZ3950::Impl::decode_sru_request(mp::Package &package,
mp::odr &odr_de,
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
mp::odr &odr_de,
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
-yf::SRUtoZ3950::Rep::check_sru_query_exists(mp::Package &package,
+yf::SRUtoZ3950::Impl::check_sru_query_exists(mp::Package &package,
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
Z_SRW_searchRetrieveRequest
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
Z_SRW_searchRetrieveRequest
-yf::SRUtoZ3950::Rep::z3950_init_request(mp::Package &package,
+yf::SRUtoZ3950::Impl::z3950_init_request(mp::Package &package,
const std::string &database) const
{
// prepare Z3950 package
const std::string &database) const
{
// prepare Z3950 package
-yf::SRUtoZ3950::Rep::z3950_close_request(mp::Package &package) const
+yf::SRUtoZ3950::Impl::z3950_close_request(mp::Package &package) const
{
// close SRU package
package.session().close();
{
// close SRU package
package.session().close();
-yf::SRUtoZ3950::Rep::z3950_search_request(mp::Package &package,
+yf::SRUtoZ3950::Impl::z3950_search_request(mp::Package &package,
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
Z_SRW_searchRetrieveRequest
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
Z_SRW_searchRetrieveRequest
-yf::SRUtoZ3950::Rep::z3950_present_request(mp::Package &package,
+yf::SRUtoZ3950::Impl::z3950_present_request(mp::Package &package,
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
Z_SRW_searchRetrieveRequest
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
Z_SRW_searchRetrieveRequest
-yf::SRUtoZ3950::Rep::z3950_scan_request(mp::Package &package,
+yf::SRUtoZ3950::Impl::z3950_scan_request(mp::Package &package,
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
Z_SRW_scanRequest const *sr_req) const
mp::odr &odr_en,
Z_SRW_PDU *sru_pdu_res,
Z_SRW_scanRequest const *sr_req) const
-bool yf::SRUtoZ3950::Rep::z3950_build_query(mp::odr &odr_en, Z_Query *z_query,
+bool yf::SRUtoZ3950::Impl::z3950_build_query(mp::odr &odr_en, Z_Query *z_query,
const SRW_query &query,
SRW_query_type query_type) const
{
const SRW_query &query,
SRW_query_type query_type) const
{
-yf::SRUtoZ3950::Rep::sru_protocol(const Z_HTTP_Request &http_req) const
+yf::SRUtoZ3950::Impl::sru_protocol(const Z_HTTP_Request &http_req) const
{
const std::string mime_urlencoded("application/x-www-form-urlencoded");
const std::string mime_text_xml("text/xml");
{
const std::string mime_urlencoded("application/x-www-form-urlencoded");
const std::string mime_text_xml("text/xml");
-yf::SRUtoZ3950::Rep::debug_http(const Z_HTTP_Request &http_req) const
+yf::SRUtoZ3950::Impl::debug_http(const Z_HTTP_Request &http_req) const
{
std::string message("<html>\n<body>\n<h1>"
"Metaproxy SRUtoZ3950 filter"
{
std::string message("<html>\n<body>\n<h1>"
"Metaproxy SRUtoZ3950 filter"
-void yf::SRUtoZ3950::Rep::http_response(metaproxy_1::Package &package,
+void yf::SRUtoZ3950::Impl::http_response(metaproxy_1::Package &package,
const std::string &content,
int http_code) const
{
const std::string &content,
int http_code) const
{
-yf::SRUtoZ3950::Rep::build_esn_from_schema(mp::odr &odr_en,
+yf::SRUtoZ3950::Impl::build_esn_from_schema(mp::odr &odr_en,
const char *schema) const
{
if (!schema)
const char *schema) const
{
if (!schema)
-yf::SRUtoZ3950::Rep::z3950_to_srw_diag(mp::odr &odr_en,
+yf::SRUtoZ3950::Impl::z3950_to_srw_diag(mp::odr &odr_en,
Z_SRW_searchRetrieveResponse *sru_res,
Z_DefaultDiagFormat *ddf) const
{
Z_SRW_searchRetrieveResponse *sru_res,
Z_DefaultDiagFormat *ddf) const
{
-/* $Id: filter_sru_to_z3950.hpp,v 1.2 2006-09-13 21:49:34 marc Exp $
+/* $Id: filter_sru_to_z3950.hpp,v 1.3 2006-09-29 09:48:36 marc Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
namespace metaproxy_1 {
namespace filter {
class SRUtoZ3950 : public Base {
namespace metaproxy_1 {
namespace filter {
class SRUtoZ3950 : public Base {
- class Rep;
- boost::scoped_ptr<Rep> m_p;
+ class Impl;
+ boost::scoped_ptr<Impl> m_p;
public:
SRUtoZ3950();
~SRUtoZ3950();
public:
SRUtoZ3950();
~SRUtoZ3950();
-/* $Id: filter_template.cpp,v 1.8 2006-06-10 14:29:12 adam Exp $
+/* $Id: filter_template.cpp,v 1.9 2006-09-29 09:48:36 marc Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
*/
#include "config.hpp"
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
*/
#include "config.hpp"
+#include "filter_template.hpp"
#include <boost/thread/mutex.hpp>
#include <boost/thread/mutex.hpp>
-#include "util.hpp"
-#include "filter_template.hpp"
-
#include <yaz/zgdu.h>
namespace mp = metaproxy_1;
#include <yaz/zgdu.h>
namespace mp = metaproxy_1;
namespace metaproxy_1 {
namespace filter {
namespace metaproxy_1 {
namespace filter {
- class Template::Rep {
- friend class Template;
- int dummy;
+ class Template::Impl {
+ public:
+ Impl();
+ ~Impl();
+ void process(metaproxy_1::Package & package) const;
+ void configure(const xmlNode * ptr);
+ private:
+ int m_dummy;
-yf::Template::Template() : m_p(new Rep)
+// define Pimpl wrapper forwarding to Impl
+
+yf::Template::Template() : m_p(new Impl)
}
yf::Template::~Template()
{ // must have a destructor because of boost::scoped_ptr
}
}
yf::Template::~Template()
{ // must have a destructor because of boost::scoped_ptr
}
+void yf::Template::configure(const xmlNode *xmlnode)
+{
+ m_p->configure(xmlnode);
+}
+
void yf::Template::process(mp::Package &package) const
{
void yf::Template::process(mp::Package &package) const
{
+ m_p->process(package);
+}
+
+
+// define Implementation stuff
+
+
+
+yf::Template::Impl::Impl()
+{
+ m_dummy = 1;
+}
+
+yf::Template::Impl::~Impl()
+{
+}
+
+void yf::Template::Impl::configure(const xmlNode *xmlnode)
+{
+}
+
+void yf::Template::Impl::process(mp::Package &package) const
+{
// Z_GDU *gdu = package.request().get();
package.move();
}
// Z_GDU *gdu = package.request().get();
package.move();
}
static mp::filter::Base* filter_creator()
{
return new mp::filter::Template;
static mp::filter::Base* filter_creator()
{
return new mp::filter::Template;
-/* $Id: filter_template.hpp,v 1.6 2006-06-10 14:29:12 adam Exp $
+/* $Id: filter_template.hpp,v 1.7 2006-09-29 09:48:36 marc Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
namespace metaproxy_1 {
namespace filter {
class Template : public Base {
namespace metaproxy_1 {
namespace filter {
class Template : public Base {
- class Rep;
- boost::scoped_ptr<Rep> m_p;
+ class Impl;
+ boost::scoped_ptr<Impl> m_p;
public:
Template();
~Template();
void process(metaproxy_1::Package & package) const;
public:
Template();
~Template();
void process(metaproxy_1::Package & package) const;
+ void configure(const xmlNode * ptr);