00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_ALPHABETS_DECORATED_ALPHABET_HH
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_ALPHABETS_DECORATED_ALPHABET_HH
00019
00020 # include <vaucanson/algebra/implementation/alphabets/alphabets.hh>
00021
00022 namespace vcsn {
00023
00024 namespace algebra {
00025
00029
00030
00031
00032
00049 template <class L, class T>
00050 class AlphabetDecorator
00051 {
00052 public:
00053 typedef L letter_t;
00054 typedef T alphabet_impl_t;
00055 typedef typename T::const_iterator const_iterator;
00056 typedef typename T::iterator iterator;
00057
00058 AlphabetDecorator();
00059 AlphabetDecorator(alphabet_impl_t& alphabet);
00060 ~AlphabetDecorator();
00061
00062 letter_t joker() const;
00063 letter_t other() const;
00064 void insert(L);
00065 unsigned size() const;
00066 iterator begin();
00067 iterator end();
00068 const_iterator begin() const;
00069 const_iterator end() const;
00070 alphabet_impl_t& alphabet();
00071 const alphabet_impl_t& alphabet() const;
00072
00073 private:
00074 alphabet_impl_t* alphabet_;
00075 letter_t joker_;
00076 letter_t other_;
00077 bool alphabet_owner_;
00078 };
00079
00080
00081
00082
00083
00084
00086 template<typename L, typename T>
00087 struct alphabet_traits<AlphabetSet<L>, AlphabetDecorator<L, T> >
00088 {
00090 typedef L letter_t;
00091 };
00092
00096 }
00097
00101
00102
00103
00104
00110 template<typename L, typename T>
00111 struct MetaElement<algebra::AlphabetSet<L>, algebra::AlphabetDecorator<L, T> >
00112 : MetaElement<algebra::AlphabetSetBase<algebra::AlphabetSet<L> >,
00113 algebra::AlphabetDecorator<L, T> >
00114 {
00116 static const bool dynamic_value =
00117 MetaElement<algebra::AlphabetSet<L>,T >::dynamic_value;
00118
00120 L joker() const;
00121
00123 L other() const;
00124 };
00125
00129 namespace algebra {
00130
00131 template<typename L, typename T>
00132 bool op_contains(const algebra::AlphabetSet<L>& s,
00133 const algebra::AlphabetDecorator<L, T>& a);
00134
00135 template<typename L, typename T>
00136 bool op_is_finite(const algebra::AlphabetSet<L>& s,
00137 const algebra::AlphabetDecorator<L, T>& a);
00138
00139 template<typename L, typename T>
00140 bool op_contains_e(const algebra::AlphabetSet<L>& s,
00141 const algebra::AlphabetDecorator<L, T>& a,
00142 const L& v);
00143
00144 template <typename T, typename L>
00145 bool op_letter_equality(const algebra::AlphabetSet<L>& s,
00146 const algebra::AlphabetDecorator<L, T>& a,
00147 L lhs,
00148 L rhs);
00149
00150 }
00151
00152 }
00153
00154 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00155 # include <vaucanson/algebra/implementation/alphabets/decorated_alphabet.hxx>
00156 # endif // VCSN_USE_INTERFACE_ONLY
00157
00158 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_ALPHABETS_DECORATED_ALPHABET_HH