00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_DESIGN_PATTERN_STRUCTURE_HXX
00018 # define VCSN_DESIGN_PATTERN_STRUCTURE_HXX
00019
00020 # include <vaucanson/design_pattern/structure.hh>
00021
00022 namespace vcsn {
00023
00024
00025
00026
00027
00028 template <typename S>
00029 template <typename T>
00030 bool
00031 Structure<S>::contains(const Element<S, T>& elt) const
00032 {
00033 return op_contains(self(), elt.value());
00034 }
00035
00036 template <typename S>
00037 template <typename T>
00038 bool
00039 Structure<S>::contains(const T& elt_value) const
00040 {
00041 return op_contains(self(), elt_value);
00042 }
00043
00044 template <typename S>
00045 template <typename OtherS, typename T>
00046 bool
00047 Structure<S>::contains(const Element<OtherS, T>& other) const
00048 {
00049 return false;
00050 }
00051
00052
00053
00054
00055
00056 template <class S>
00057 template <class T>
00058 Element<S, T>
00059 Structure<S>::choose(SELECTOR(T)) const
00060 {
00061 return op_choose(self(), SELECT(T));
00062 }
00063
00064
00065
00066
00067
00068 template <typename S>
00069 S&
00070 Structure<S>::self()
00071 {
00072 return static_cast<self_t&>(*this);
00073 }
00074
00075 template <typename S>
00076 const S&
00077 Structure<S>::self() const
00078 {
00079 return static_cast<const self_t&>(*this);
00080 }
00081
00082
00083
00084
00085
00086
00087 template <typename S>
00088 Structure<S>::Structure()
00089 : misc::unique::unifiable()
00090 {}
00091
00092 template <typename S>
00093 Structure<S>::Structure(const Structure& other)
00094 : misc::unique::unifiable(other)
00095 {}
00096
00097
00098
00099
00100
00101
00102 template<typename S>
00103 bool operator != (const vcsn::Structure<S>& a,
00104 const vcsn::Structure<S>& b)
00105 { return not (a.self() == b.self()); }
00106
00107 }
00108
00109 #endif // ! VCSN_DESIGN_PATTERN_STRUCTURE_HXX