2013-07-19 01:54:52 +04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
#include <boost/unordered_map.hpp>
|
|
|
|
|
2013-07-19 16:56:02 +04:00
|
|
|
namespace Moses
|
|
|
|
{
|
2013-07-19 01:54:52 +04:00
|
|
|
|
|
|
|
class FeatureFactory;
|
|
|
|
|
2013-07-19 16:56:02 +04:00
|
|
|
class FeatureRegistry
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FeatureRegistry();
|
2013-07-19 01:54:52 +04:00
|
|
|
|
2013-07-19 16:56:02 +04:00
|
|
|
~FeatureRegistry();
|
2013-07-19 01:54:52 +04:00
|
|
|
|
2013-07-19 16:56:02 +04:00
|
|
|
void Construct(const std::string &name, const std::string &line);
|
2013-11-01 19:16:47 +04:00
|
|
|
void PrintFF() const;
|
2013-07-19 01:54:52 +04:00
|
|
|
|
2013-07-19 16:56:02 +04:00
|
|
|
private:
|
|
|
|
void Add(const std::string &name, FeatureFactory *factory);
|
2013-07-19 01:54:52 +04:00
|
|
|
|
2013-07-19 16:56:02 +04:00
|
|
|
typedef boost::unordered_map<std::string, boost::shared_ptr<FeatureFactory> > Map;
|
2013-07-19 01:54:52 +04:00
|
|
|
|
2013-07-19 16:56:02 +04:00
|
|
|
Map registry_;
|
2013-07-19 01:54:52 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Moses
|