1 /* $Id: factory_filter.hpp,v 1.7 2007-05-09 21:23:09 adam Exp $
2 Copyright (c) 2005-2007, Index Data.
4 This file is part of Metaproxy.
6 Metaproxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with Metaproxy; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef FACTORY_FILTER_HPP
23 #define FACTORY_FILTER_HPP
30 #include <boost/noncopyable.hpp>
31 #include <boost/scoped_ptr.hpp>
35 namespace metaproxy_1 {
36 class FactoryFilter : public boost::noncopyable
38 typedef metaproxy_1::filter::Base* (*CreateFilterCallback)();
42 /// true if registration ok
47 bool add_creator(std::string fi, CreateFilterCallback cfc);
49 bool drop_creator(std::string fi);
51 metaproxy_1::filter::Base* create(std::string fi);
52 bool exist(std::string fi);
54 bool add_creator_dl(const std::string &fi, const std::string &path);
56 bool have_dl_support();
58 class NotFound : public std::runtime_error {
60 NotFound(const std::string msg);
63 boost::scoped_ptr<Rep> m_p;
71 * indent-tabs-mode: nil
72 * c-file-style: "stroustrup"
74 * vim: shiftwidth=4 tabstop=8 expandtab