Vaucanson  1.4.1
bmig_functors.hxx
1 // boost_functors.hxx: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2007, 2008 The Vaucanson Group.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // The complete GNU General Public Licence Notice can be found as the
13 // `COPYING' file in the root directory.
14 //
15 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
16 //
17 
18 #ifndef VCSN_AUTOMATON_IMPLEMENTATION_BMIG_BOOST_FUNCTORS_HXX
19 # define VCSN_AUTOMATON_IMPLEMENTATION_BMIG_BOOST_FUNCTORS_HXX
20 
21 # include <vaucanson/automata/implementation/bmig/bmig_functors.hh>
22 # include <vaucanson/automata/implementation/bmig/initial_value.hh>
23 
24 namespace vcsn
25 {
26  namespace bmig
27  {
28 
29  /*-------------------------------------------------.
30  | Functor used to update a label in a multi_index. |
31  `-------------------------------------------------*/
32 
33  template<typename HLabel>
34  update_hlabel<HLabel>::update_hlabel(const HLabel& i_)
35  : i(i_)
36  {}
37 
38  template<typename HLabel>
39  void
40  update_hlabel<HLabel>::operator()(HLabel &key)
41  {
42  key = i;
43  }
44 
45 
46  template<typename HState, typename Series>
47  update_label<InitialValue<HState, Series> >::update_label(const Series& i_)
48  : i(i_)
49  {
50  }
51 
52  template<typename HState, typename Series>
53  void
54  update_label<InitialValue<HState, Series> >::operator()(InitialValue<HState, Series>& elt)
55  {
56  elt.second = i;
57  }
58 
59  }
60 }
61 
62 #endif // ! VCSN_AUTOMATON_IMPLEMENTATION_BMIG_BOOST_FUNCTORS_HXX
63