00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_HH
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_HH
00019
00020 # include <vaucanson/algebra/concept/series_base.hh>
00021 # include <vaucanson/algebra/implementation/series/series_rep.hh>
00022 # include <vaucanson/design_pattern/slots.hh>
00023
00024
00025 namespace vcsn
00026 {
00027 namespace algebra
00028 {
00029
00030
00031
00032
00033 struct semiring_slot_tag {};
00034 struct monoid_slot_tag {};
00035
00038 template<typename Semiring, typename Monoid>
00039 struct Series
00040 : SeriesBase<Series<Semiring, Monoid> >,
00041 private SetSlot<Semiring, semiring_slot_tag>,
00042 private SetSlot<Monoid, monoid_slot_tag>
00043 {
00044 typedef SeriesRep<Semiring, Monoid> series_rep_t;
00045 typedef boost::shared_ptr<series_rep_t> shared_series_rep_t;
00046
00047 Series(const Semiring& w, const Monoid& m);
00048 Series(const Semiring& w, const Monoid& m, const series_rep_t& sr);
00049 Series(const Series& other);
00050
00051 const Semiring& semiring() const;
00052
00053 const Monoid& monoid() const;
00054
00055 const shared_series_rep_t representation() const;
00056
00057 bool operator==(const Series<Semiring, Monoid>&) const;
00058
00059 protected:
00060 shared_series_rep_t rep_;
00061 };
00062
00063 template <class W, class M, class NewW, class NewM>
00064 struct mute_series_traits<Series<W, M>, NewW, NewM >
00065 {
00066 typedef Series<NewW, NewM> ret;
00067 };
00068
00069 template <class W, class M, class NewW, class NewM>
00070 typename mute_series_traits<Series<W, M>, NewW, NewM >::ret
00071 mute_series(const Series<W, M>& s, const NewW& w, const NewM& m);
00072
00073 }
00074
00075
00076
00077
00078
00080 template <class W, class M, class T>
00081 struct MetaElement<algebra::Series<W, M>, T> :
00082 public MetaElement<algebra::SeriesBase<algebra::Series<W, M> >, T>
00083 { };
00084
00085
00086
00087
00088
00090 template<typename W, typename M>
00091 struct dynamic_traits<algebra::Series<W, M> >
00092 : dynamic_traits<algebra::SeriesBase<algebra::Series<W, M> > >
00093 {
00094 static const bool ret =
00095 dynamic_traits<W>::ret || dynamic_traits<M>::ret;
00096
00097 };
00098
00099
00100
00101
00102
00104 template<typename W, typename M>
00105 struct virtual_types<algebra::Series<W, M> >
00106 : virtual_types<algebra::SeriesBase<algebra::Series<W, M> > >
00107 {
00108 typedef W semiring_t;
00109 typedef M monoid_t;
00110 };
00111
00112 }
00113
00114
00115 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00116 # include <vaucanson/algebra/implementation/series/series.hxx>
00117 #endif // VCSN_USE_INTERFACE_ONLY
00118
00119
00120 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_HH