diff options
Diffstat (limited to 'decoder/ff_factory.h')
-rw-r--r-- | decoder/ff_factory.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/decoder/ff_factory.h b/decoder/ff_factory.h index bc586567..75911f38 100644 --- a/decoder/ff_factory.h +++ b/decoder/ff_factory.h @@ -17,8 +17,10 @@ class FFRegistry { friend class FFFactoryBase; public: boost::shared_ptr<FeatureFunction> Create(const std::string& ffname, const std::string& param) const; + std::string usage(std::string const& ffname,bool params=true,bool verbose=true) const; void DisplayList() const; void Register(const std::string& ffname, FFFactoryBase* factory); + void Register(FFFactoryBase* factory); private: FFRegistry() {} std::map<std::string, boost::shared_ptr<FFFactoryBase> > reg_; @@ -27,6 +29,7 @@ class FFRegistry { struct FFFactoryBase { virtual ~FFFactoryBase(); virtual boost::shared_ptr<FeatureFunction> Create(const std::string& param) const = 0; + virtual std::string usage(bool params,bool verbose) const = 0; }; template<class FF> @@ -34,6 +37,11 @@ class FFFactory : public FFFactoryBase { boost::shared_ptr<FeatureFunction> Create(const std::string& param) const { return boost::shared_ptr<FeatureFunction>(new FF(param)); } + // called with false,false just gives feature name + virtual std::string usage(bool params,bool verbose) const { + return FF::usage(params,verbose); + } + }; #endif |