Vaucanson 1.4
hash_visitor.hh
00001 // hash_visitor.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, 2005, 2006 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_ALGEBRA_IMPLEMENTATION_SERIES_RAT_HASH_VISITOR_HH
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_HASH_VISITOR_HH
00019 
00020 # include <ostream>
00021 # include <string>
00022 # include <set>
00023 
00024 # include <vaucanson/algebra/implementation/series/rat/exp.hh>
00025 
00026 namespace vcsn
00027 {
00028 
00029   namespace rat
00030   {
00031 
00032     template <class Word, class Weight>
00033     class HashVisitor : public ConstNodeVisitor<Word, Weight>
00034     {
00035     public:
00036 
00037       typedef Word                      monoid_elt_value_t;
00038       typedef Weight                    semiring_elt_value_t;
00039       typedef Node<Word, Weight>        node_t;
00040 
00041     public:
00042 
00043       HashVisitor();
00044       virtual ~HashVisitor();
00045 
00046       virtual void product(const node_t* lhs, const node_t* rhs);
00047       virtual void sum(const node_t* lhs, const node_t* rhs);
00048       virtual void star(const node_t* node);
00049       virtual void left_weight(const semiring_elt_value_t& w, const node_t* node);
00050       virtual void right_weight(const semiring_elt_value_t& w, const node_t* node);
00051       virtual void constant(const monoid_elt_value_t& m);
00052       virtual void zero();
00053       virtual void one();
00054 
00055       std::size_t hash_value();
00056 
00057     protected:
00058       std::size_t       seed_;
00059     };
00060   } // End of namespace rat.
00061 
00062 } // End of namespace vcsn.
00063 
00064 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00065 #  include <vaucanson/algebra/implementation/series/rat/hash_visitor.hxx>
00066 # endif // VCSN_USE_INTERFACE_ONLY
00067 
00068 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_DUMP_VISITOR_HH