1 /* $Id: filter_factory.hpp,v 1.6 2005-11-10 23:10:42 adam Exp $
2 Copyright (c) 2005, Index Data.
7 #ifndef FILTER_FACTORY_HPP
8 #define FILTER_FACTORY_HPP
15 #include <boost/noncopyable.hpp>
16 #include <boost/scoped_ptr.hpp>
23 class FilterFactoryException : public std::runtime_error {
25 FilterFactoryException(const std::string message);
28 class FilterFactory : public boost::noncopyable
30 typedef yp2::filter::Base* (*CreateFilterCallback)();
31 typedef std::map<std::string, CreateFilterCallback> CallbackMap;
35 /// true if registration ok
40 bool add_creator(std::string fi, CreateFilterCallback cfc);
41 /// true if unregistration ok
43 bool drop_creator(std::string fi);
45 /// factory create method
47 yp2::filter::Base* create(std::string fi);
50 boost::scoped_ptr<Rep> m_p;
58 * indent-tabs-mode: nil
59 * c-file-style: "stroustrup"
61 * vim: shiftwidth=4 tabstop=8 expandtab