#include <factory_filter.hpp>
Private Attributes |
| boost::scoped_ptr< Rep > | m_p |
Detailed Description
Definition at line 33 of file factory_filter.hpp.
Member Typedef Documentation
| typedef metaproxy_1::filter::Base*(* metaproxy_1::FactoryFilter::CreateFilterCallback)() |
|
private |
Constructor & Destructor Documentation
| metaproxy_1::FactoryFilter::FactoryFilter |
( |
| ) |
|
| metaproxy_1::FactoryFilter::~FactoryFilter |
( |
| ) |
|
Member Function Documentation
| bool metaproxy_1::FactoryFilter::add_creator_dl |
( |
const std::string & |
fi, |
|
|
const std::string & |
path |
|
) |
| |
Definition at line 113 of file factory_filter.cpp.
{
#if HAVE_DLFCN_H
if (
m_p->m_fcm.find(fi) !=
m_p->m_fcm.end())
{
return true;
}
std::string full_path = path + "/metaproxy_filter_" + fi + ".so";
void *dl_handle = dlopen(full_path.c_str(), RTLD_GLOBAL|RTLD_NOW);
if (!dl_handle)
{
const char *dl = dlerror();
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)
{
std::cout << "dlsym " << full_name << " failed\n";
return false;
}
struct metaproxy_1_filter_struct *s = (struct metaproxy_1_filter_struct *) dlsym_ptr;
#else
return false;
#endif
}
| mp::filter::Base * metaproxy_1::FactoryFilter::create |
( |
std::string |
fi | ) |
|
Definition at line 92 of file factory_filter.cpp.
{
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);
}
return (it->second());
}
| bool metaproxy_1::FactoryFilter::drop_creator |
( |
std::string |
fi | ) |
|
| bool metaproxy_1::FactoryFilter::exist |
( |
std::string |
fi | ) |
|
Definition at line 81 of file factory_filter.cpp.
{
Rep::CallbackMap::const_iterator it =
m_p->m_fcm.find(fi);
if (it ==
m_p->m_fcm.end())
{
return false;
}
return true;
}
| bool metaproxy_1::FactoryFilter::have_dl_support |
( |
| ) |
|
Definition at line 104 of file factory_filter.cpp.
{
#if HAVE_DLFCN_H
return true;
#else
return false;
#endif
}
Member Data Documentation
| boost::scoped_ptr<Rep> metaproxy_1::FactoryFilter::m_p |
|
private |
The documentation for this class was generated from the following files: