projects
/
metaproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use yaz_log
[metaproxy-moved-to-github.git]
/
src
/
factory_filter.cpp
diff --git
a/src/factory_filter.cpp
b/src/factory_filter.cpp
index
a446ba2
..
071a7d1
100644
(file)
--- a/
src/factory_filter.cpp
+++ b/
src/factory_filter.cpp
@@
-1,5
+1,5
@@
/* This file is part of Metaproxy.
/* This file is part of Metaproxy.
- Copyright (C) 2005-2011 Index Data
+ Copyright (C) 2005-2013 Index Data
Metaproxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Metaproxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@
-33,7
+33,7
@@
namespace mp = metaproxy_1;
namespace metaproxy_1 {
class FactoryFilter::Rep {
typedef std::map<std::string, CreateFilterCallback> CallbackMap;
namespace metaproxy_1 {
class FactoryFilter::Rep {
typedef std::map<std::string, CreateFilterCallback> CallbackMap;
- typedef std::map<std::string, CreateFilterCallback>::iterator
+ typedef std::map<std::string, CreateFilterCallback>::iterator
CallbackMapIt;
public:
friend class FactoryFilter;
CallbackMapIt;
public:
friend class FactoryFilter;
@@
-66,8
+66,8
@@
mp::FactoryFilter::~FactoryFilter()
}
}
-bool mp::FactoryFilter::add_creator(std::string fi,
- CreateFilterCallback cfc)
+bool mp::FactoryFilter::add_creator(const std::string &fi,
+ CreateFilterCallback cfc)
{
return m_p->m_fcm.insert(Rep::CallbackMap::value_type(fi, cfc)).second;
}
{
return m_p->m_fcm.insert(Rep::CallbackMap::value_type(fi, cfc)).second;
}
@@
-81,7
+81,7
@@
bool mp::FactoryFilter::drop_creator(std::string fi)
bool mp::FactoryFilter::exist(std::string fi)
{
Rep::CallbackMap::const_iterator it = m_p->m_fcm.find(fi);
bool mp::FactoryFilter::exist(std::string fi)
{
Rep::CallbackMap::const_iterator it = m_p->m_fcm.find(fi);
-
+
if (it == m_p->m_fcm.end())
{
return false;
if (it == m_p->m_fcm.end())
{
return false;
@@
-92,7
+92,7
@@
bool mp::FactoryFilter::exist(std::string fi)
mp::filter::Base* mp::FactoryFilter::create(std::string fi)
{
Rep::CallbackMap::const_iterator it = m_p->m_fcm.find(fi);
mp::filter::Base* mp::FactoryFilter::create(std::string fi)
{
Rep::CallbackMap::const_iterator it = m_p->m_fcm.find(fi);
-
+
if (it == m_p->m_fcm.end()){
std::string msg = "filter type '" + fi + "' not found";
throw NotFound(msg);
if (it == m_p->m_fcm.end()){
std::string msg = "filter type '" + fi + "' not found";
throw NotFound(msg);
@@
-124,13
+124,13
@@
bool mp::FactoryFilter::add_creator_dl(const std::string &fi,
if (!dl_handle)
{
const char *dl = dlerror();
if (!dl_handle)
{
const char *dl = dlerror();
- std::cout << "dlopen " << full_path << " failed. dlerror=" << dl <<
+ std::cout << "dlopen " << full_path << " failed. dlerror=" << dl <<
std::endl;
return false;
}
std::string full_name = "metaproxy_1_filter_" + fi;
std::endl;
return false;
}
std::string full_name = "metaproxy_1_filter_" + fi;
-
+
void *dlsym_ptr = dlsym(dl_handle, full_name.c_str());
if (!dlsym_ptr)
{
void *dlsym_ptr = dlsym(dl_handle, full_name.c_str());
if (!dlsym_ptr)
{