Vaucanson  1.4.1
bmig_functors.hh
1 // bmig_functors.hh: 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_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_FUNCTORS_HH_
19 # define VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_FUNCTORS_HH_
20 
21 # include <functional>
22 # include <vaucanson/automata/implementation/bmig/initial_value.hh>
23 
24 namespace vcsn
25 {
26  namespace bmig
27  {
28  template<typename T>
29  struct update_label;
30 
31  template<typename HState, typename Series>
32  struct update_label<InitialValue<HState, Series> >
33  : public std::unary_function<InitialValue<HState, Series>, void>
34  {
35  update_label(const Series& i_);
36  void operator()(InitialValue<HState, Series>& key);
37 
38  Series i;
39  };
40 
41 
42  // Functor used to update the label of a transition.
43  //
44  // Boost::multi_index only provides const iterators and modifying some data
45  // in such a container is a special operation which may require to reorder
46  // several sets internaly. Thus, a special method is provided, update(), which
47  // uses such functors.
48  //
49  // See implementation in automata/implementation/bmig/boost_functors.hxx.
50  template<typename HLabel>
51  struct update_hlabel : public std::unary_function<HLabel, void>
52  {
53  update_hlabel(const HLabel& i_);
54  void operator()(HLabel &key);
55 
56  HLabel i;
57  };
58 
59  } //bmig
60 } //vcsn
61 
62 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
63 # include <vaucanson/automata/implementation/bmig/bmig_functors.hxx>
64 # endif // !VCSN_USE_INTERFACE_ONLY || VCSN_USE_LIB
65 
66 #endif // !VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_FUNCTORS_HH_
67