TriggeringEventEvaluatorFactory.hh 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. #if !defined(h_dd233b8b_5c59_4956_9393_6581c95f9779)
  2. #define h_dd233b8b_5c59_4956_9393_6581c95f9779
  3. #include <string>
  4. #include <map>
  5. #include <memory>
  6. #include "Portability.hh"
  7. #include "TriggeringEventEvaluator.hh"
  8. #include "FactoryParams.hh"
  9. LOG4CPP_NS_BEGIN
  10. class LOG4CPP_EXPORT TriggeringEventEvaluatorFactory
  11. {
  12. public:
  13. typedef FactoryParams params_t;
  14. typedef std::auto_ptr<TriggeringEventEvaluator>(*create_function_t)(const params_t& params);
  15. static TriggeringEventEvaluatorFactory& getInstance();
  16. void registerCreator(const std::string& class_name, create_function_t create_function);
  17. std::auto_ptr<TriggeringEventEvaluator> create(const std::string& class_name, const params_t& params);
  18. bool registered(const std::string& class_name) const;
  19. private:
  20. TriggeringEventEvaluatorFactory(){};
  21. typedef std::map<std::string, create_function_t> creators_t;
  22. typedef creators_t::const_iterator const_iterator;
  23. creators_t creators_;
  24. };
  25. LOG4CPP_NS_END
  26. #endif // h_dd233b8b_5c59_4956_9393_6581c95f9779