00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef VCSN_DESIGN_PATTERN_ELEMENT_HH
00018 # define VCSN_DESIGN_PATTERN_ELEMENT_HH
00019 
00027 # include <vaucanson/design_pattern/predecls.hh>
00028 # include <vaucanson/design_pattern/meta_element_root.hh>
00029 # include <vaucanson/design_pattern/element_ops.hh>
00030 # include <vaucanson/design_pattern/default_ops.hh>
00031 # include <vaucanson/design_pattern/slots.hh>
00032 
00033 namespace vcsn {
00034 
00037   
00038 
00039 
00040 
00060   template<typename S, typename T>
00061   class Element : public MetaElement<S, T>, private SetSlot<S>
00062   {
00063   public:
00065     typedef S         set_t;
00066 
00068     typedef T         value_t;
00069 
00071     static const bool dynamic    = dynamic_traits<S>::ret
00072                                    || MetaElement<S, T>::dynamic_value;
00073 
00074     
00075 
00076 
00077 
00088     Element();
00089 
00090     
00091 
00092 
00093 
00095     Element(const Element& other);
00096 
00098     template<typename U>
00099     Element(const Element<S, U>& other);
00100 
00107     template<typename OtherS, typename U>
00108     Element(const Element<OtherS, U>& other);
00109 
00110     
00111 
00112 
00113 
00115 
00121     Element(const T& other);
00122 
00123     template<typename U>
00124     Element(const U& other);
00126 
00127     
00128 
00129 
00130 
00137     explicit Element(const S& structure);
00138 
00140     Element(const S& structure, const T& other);
00141 
00143     template<typename U> Element(const S& structure, const U& other);
00144 
00146     template<typename OtherS, typename U>
00147     Element(const S& structure, const Element<OtherS, U>& other);
00148 
00149     
00150 
00151 
00152 
00154     Element& operator=(const Element& other);
00155 
00157     template<typename U>
00158     Element& operator=(const Element<S, U>& other);
00159 
00161     template<typename OtherS, typename U>
00162     Element& operator=(const Element<OtherS, U>& other);
00163 
00165     template<typename U>
00166     Element& operator=(const U& other);
00167 
00168     
00169 
00170 
00171 
00173     const S&    structure() const;
00174 
00176     void        attach(const S& structure);
00177 
00179 
00180     T&          value();
00181     const T&    value() const;
00183 
00184   private :
00185     T                   value_;
00186   };
00187 
00190 } 
00191 
00192 
00193 # ifndef VCSN_USE_INTERFACE_ONLY
00194 #  include <vaucanson/design_pattern/element.hxx>
00195 # endif // VCSN_USE_INTERFACE_ONLY
00196 
00197 #endif // ! VCSN_DESIGN_PATTERN_ELEMENT_HH