Vaucanson 1.4
bmig_functors.hxx
00001 // boost_functors.hxx: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2007, 2008 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 
00018 #ifndef VCSN_AUTOMATON_IMPLEMENTATION_BMIG_BOOST_FUNCTORS_HXX
00019 # define VCSN_AUTOMATON_IMPLEMENTATION_BMIG_BOOST_FUNCTORS_HXX
00020 
00021 # include <vaucanson/automata/implementation/bmig/bmig_functors.hh>
00022 # include <vaucanson/automata/implementation/bmig/initial_value.hh>
00023 
00024 namespace vcsn
00025 {
00026   namespace bmig
00027   {
00028 
00029     /*-------------------------------------------------.
00030     | Functor used to update a label in a multi_index. |
00031     `-------------------------------------------------*/
00032 
00033     template<typename HLabel>
00034     update_hlabel<HLabel>::update_hlabel(const HLabel& i_)
00035       : i(i_)
00036     {}
00037 
00038     template<typename HLabel>
00039     void
00040     update_hlabel<HLabel>::operator()(HLabel &key)
00041     {
00042       key = i;
00043     }
00044 
00045 
00046     template<typename HState, typename Series>
00047     update_label<InitialValue<HState, Series> >::update_label(const Series& i_)
00048       : i(i_)
00049     {
00050     }
00051 
00052     template<typename HState, typename Series>
00053     void
00054     update_label<InitialValue<HState, Series> >::operator()(InitialValue<HState, Series>& elt)
00055     {
00056       elt.second = i;
00057     }
00058 
00059   }
00060 }
00061 
00062 #endif // ! VCSN_AUTOMATON_IMPLEMENTATION_BMIG_BOOST_FUNCTORS_HXX
00063