/* * System.h * * Created on: 23 Oct 2015 * Author: hieu */ #pragma once #include #include #include #include #include #include "FF/FeatureFunctions.h" #include "Weights.h" #include "MemPool.h" #include "Recycler.h" #include "legacy/FactorCollection.h" #include "legacy/Parameter.h" #include "TypeDef.h" #include "legacy/Bitmaps.h" #include "legacy/OutputCollector.h" #include "parameters/AllOptions.h" namespace Moses2 { namespace NSCubePruning { class Stack; } class FeatureFunction; class StatefulFeatureFunction; class PhraseTable; class HypothesisBase; class System { public: const Parameter ¶ms; AllOptions options; FeatureFunctions featureFunctions; Weights weights; std::vector mappings; bool isPb; mutable boost::shared_ptr bestCollector, nbestCollector; // moses.ini params int cpuAffinityOffset; int cpuAffinityOffsetIncr; System(const Parameter ¶msArg); virtual ~System(); MemPool &GetSystemPool() const; MemPool &GetManagerPool() const; FactorCollection &GetVocab() const; Recycler &GetHypoRecycler() const; Batch &GetBatch(MemPool &pool) const; protected: mutable FactorCollection m_vocab; mutable boost::thread_specific_ptr m_managerPool; mutable boost::thread_specific_ptr m_systemPool; mutable boost::thread_specific_ptr > m_hypoRecycler; mutable boost::thread_specific_ptr m_batch; void LoadWeights(); void LoadMappings(); void IsPb(); }; }