21 #ifndef FST_IMPL_TO_FST_H_ 22 #define FST_IMPL_TO_FST_H_ 40 template <
class Impl,
class FST = Fst<
typename Impl::Arc>>
43 using Arc =
typename Impl::Arc;
54 return impl_->NumInputEpsilons(s);
58 return impl_->NumOutputEpsilons(s);
63 uint64_t
Properties(uint64_t mask,
bool test)
const override {
69 impl_->UpdateProperties(testprops, knownprops);
70 return testprops & mask;
72 return impl_->Properties(mask);
76 const std::string &
Type()
const override {
return impl_->Type(); }
79 return impl_->InputSymbols();
83 return impl_->OutputSymbols();
87 explicit ImplToFst(std::shared_ptr<Impl> impl) : impl_(std::move(impl)) {}
95 impl_ = std::make_shared<Impl>(*(fst.impl_));
106 fst.impl_ = std::make_shared<Impl>();
116 impl_ = std::move(
fst.impl_);
117 fst.impl_ = std::make_shared<Impl>();
123 const Impl *
GetImpl()
const {
return impl_.get(); }
130 bool Unique()
const {
return impl_.unique(); }
132 void SetImpl(std::shared_ptr<Impl> impl) { impl_ = std::move(impl); }
135 template <
class IFST,
class OFST>
136 friend void Cast(
const IFST &ifst, OFST *ofst);
138 std::shared_ptr<Impl> impl_;
143 #endif // FST_IMPL_TO_FST_H_ uint64_t TestProperties(const Fst< Arc > &fst, uint64_t mask, uint64_t *known)
const SymbolTable * OutputSymbols() const override
ImplToFst & operator=(const ImplToFst &fst)
std::shared_ptr< Impl > GetSharedImpl() const
typename Arc::Weight Weight
StateId Start() const override
ImplToFst(const ImplToFst &fst)
size_t NumArcs(StateId s) const override
ImplToFst(const ImplToFst &fst, bool safe)
size_t NumInputEpsilons(StateId s) const override
friend void Cast(const IFST &ifst, OFST *ofst)
const std::string & Type() const override
ImplToFst & operator=(ImplToFst &&fst) noexcept
size_t NumOutputEpsilons(StateId s) const override
const SymbolTable * InputSymbols() const override
void SetImpl(std::shared_ptr< Impl > impl)
ImplToFst(ImplToFst &&fst) noexcept
typename internal::DeterminizeFstImplBase< A >::Arc Arc
Weight Final(StateId s) const override
ImplToFst(std::shared_ptr< Impl > impl)
typename Arc::StateId StateId
Impl * GetMutableImpl() const
uint64_t Properties(uint64_t mask, bool test) const override
const Impl * GetImpl() const