handlers.hh

00001 // handlers.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2001, 2002, 2003, 2004 The Vaucanson Group.
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // The complete GNU General Public Licence Notice can be found as the
00013 // `COPYING' file in the root directory.
00014 //
00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
00016 //
00017 #ifndef VCSN_AUTOMATA_CONCEPT_HANDLERS_HH
00018 # define VCSN_AUTOMATA_CONCEPT_HANDLERS_HH
00019 
00020 # include <iostream>
00021 
00022 namespace vcsn {
00023 
00024   struct state_h
00025   {};
00026 
00027   struct transition_h
00028   {};
00029 
00030   template<typename Tag>
00031   class handler
00032   {
00033     public:
00034       typedef Tag kind;
00035 
00036       handler();
00037 
00038       handler(int h);
00039 
00040       handler(const handler& h);
00041 
00042       handler& operator=(const handler& h);
00043 
00044       handler& operator=(int h);
00045 
00046       int value() const;
00047 
00048       operator int () const;
00049 
00050     protected:
00051       int v_;
00052   };
00053 
00054   typedef handler<state_h> hstate_t;
00055   typedef handler<transition_h> htransition_t;
00056 
00057   template<typename kind>
00058   bool operator==(const handler<kind>& h1,
00059                   const handler<kind>& h2);
00060 
00061   template<typename kind>
00062   bool operator!=(const handler<kind>& h1,
00063                   const handler<kind>& h2);
00064 
00065   template<typename kind>
00066   bool operator<(const handler<kind>& h1,
00067                  const handler<kind>& h2);
00068 
00069   template<typename kind>
00070   bool operator>(const handler<kind>& h1,
00071                  const handler<kind>& h2);
00072 
00073   template<typename kind>
00074   bool operator<=(const handler<kind>& h1,
00075                   const handler<kind>& h2);
00076 
00077   template<typename kind>
00078   bool operator>=(const handler<kind>& h1,
00079                   const handler<kind>& h2);
00080 
00081 } // vcsn
00082 
00083 namespace std {
00084 
00085   template <typename kind>
00086   std::ostream&
00087   operator<<(std::ostream& out, const vcsn::handler<kind>& h);
00088 
00089 } // std
00090 
00091 
00092 #ifndef VCSN_USE_INTERFACE_ONLY
00093 # include <vaucanson/automata/concept/handlers.hxx>
00094 #endif // VCSN_USE_INTERFACE_ONLY
00095 
00096 
00097 #endif // ! VCSN_AUTOMATA_CONCEPT_HANDLERS_HH

Generated on Sat Jul 29 17:13:00 2006 for Vaucanson by  doxygen 1.4.6