/* This file is part of Metaproxy.
- Copyright (C) 2005-2008 Index Data
+ Copyright (C) 2005-2012 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
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;
}
-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;
}
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;
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 (!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;
-
+
void *dlsym_ptr = dlsym(dl_handle, full_name.c_str());
if (!dlsym_ptr)
{
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
- * c-file-style: "stroustrup"
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
+