log4cpp 1.1

TriggeringEventEvaluatorFactory.hh

Go to the documentation of this file.
00001 /*
00002  * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
00003  * Copyright 2002, Bastiaan Bakker. All rights reserved.
00004  *
00005  * See the COPYING file for the terms of usage and distribution.
00006  */
00007 
00008 #if !defined(h_dd233b8b_5c59_4956_9393_6581c95f9779)
00009 #define h_dd233b8b_5c59_4956_9393_6581c95f9779
00010 
00011 #include <string>
00012 #include <map>
00013 #include <memory>
00014 #include "Portability.hh"
00015 #include "TriggeringEventEvaluator.hh"
00016 #include "FactoryParams.hh"
00017 
00018 namespace log4cpp
00019 {
00020    class LOG4CPP_EXPORT TriggeringEventEvaluatorFactory
00021    {
00022       public:
00023          typedef FactoryParams params_t;
00024          typedef std::auto_ptr<TriggeringEventEvaluator> (*create_function_t)(const params_t& params);
00025 
00026          static TriggeringEventEvaluatorFactory& getInstance();
00027          void registerCreator(const std::string& class_name, create_function_t create_function);
00028          std::auto_ptr<TriggeringEventEvaluator> create(const std::string& class_name, const params_t& params);
00029          bool registered(const std::string& class_name) const;
00030 
00031       private:
00032          TriggeringEventEvaluatorFactory(){};
00033 
00034          typedef std::map<std::string, create_function_t> creators_t;
00035          typedef creators_t::const_iterator const_iterator;
00036 
00037          creators_t creators_;
00038    };
00039 }
00040 
00041 #endif // h_dd233b8b_5c59_4956_9393_6581c95f9779
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines