00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef VCSN_AUTOMATA_CONCEPT_HANDLERS_HH
00018 # define VCSN_AUTOMATA_CONCEPT_HANDLERS_HH
00019 
00020 # include <iostream>
00021 # include <vaucanson/design_pattern/predecls.hh>
00022 
00023 namespace vcsn {
00024 
00025   struct state_h
00026   {};
00027 
00028   struct transition_h
00029   {};
00030 
00031   template<typename Tag, typename Type>
00032   class handler
00033   {
00034     public:
00035       typedef Tag kind;
00036       typedef handler<Tag, Type> self_t;
00037 
00038       handler();
00039 
00040       explicit handler(const Type& h);
00041 
00042       handler(const self_t& h);
00043 
00044       self_t& operator=(const self_t& h);
00045 
00046       Type value() const;
00047 
00048       operator unsigned() const;
00049 
00050       bool is_valid() const;
00051 
00052     protected:
00053       Type v_;
00054   };
00055 
00056 
00057   template<typename Tag, typename Type>
00058   bool operator==(const handler<Tag, Type>& h1,
00059                   const handler<Tag, Type>& h2);
00060 
00061   template<typename Tag, typename Type>
00062   bool operator!=(const handler<Tag, Type>& h1,
00063                   const handler<Tag, Type>& h2);
00064 
00065   template<typename Tag, typename Type>
00066   bool operator<(const handler<Tag, Type>& h1,
00067                  const handler<Tag, Type>& h2);
00068 
00069   template<typename Tag, typename Type>
00070   bool operator>(const handler<Tag, Type>& h1,
00071                  const handler<Tag, Type>& h2);
00072 
00073   template<typename Tag, typename Type>
00074   bool operator<=(const handler<Tag, Type>& h1,
00075                   const handler<Tag, Type>& h2);
00076 
00077   template<typename Tag, typename Type>
00078   bool operator>=(const handler<Tag, Type>& h1,
00079                   const handler<Tag, Type>& h2);
00080 
00081 } 
00082 
00083 namespace std {
00084 
00085   template <typename Tag, typename Type>
00086   std::ostream&
00087   operator<<(std::ostream& out, const vcsn::handler<Tag, Type>& h);
00088 
00089 } 
00090 
00091 
00092 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00093 # include <vaucanson/automata/concept/handlers.hxx>
00094 #endif // VCSN_USE_INTERFACE_ONLY
00095 
00096 
00097 #endif // ! VCSN_AUTOMATA_CONCEPT_HANDLERS_HH