mosesdecoder/moses/FF/Factory.h

32 lines
513 B
C
Raw Normal View History

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);
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