Vaucanson  1.4.1
bmig_handlers.hh
1 // bmig_handlers.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, 2009 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 #ifndef VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_HANDLERS_HH
18 # define VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_HANDLERS_HH
19 
20 # include <vaucanson/automata/concept/handlers.hh>
21 # include <boost/multi_index_container.hpp>
22 # include <boost/multi_index/hashed_index.hpp>
23 # include <boost/shared_ptr.hpp>
24 
25 namespace vcsn
26 {
27 
28  template <>
29  class handler<state_h, boost::shared_ptr<std::size_t> >
30  {
31  public:
32  typedef state_h kind;
33  typedef handler<state_h, boost::shared_ptr<std::size_t> > self_t;
34 
35  handler();
36 
37  explicit handler(boost::shared_ptr<std::size_t> h);
38 
39  handler(const self_t& h);
40 
41  self_t& operator=(const self_t& h);
42 
43  boost::shared_ptr<std::size_t> value() const;
44 
45  operator unsigned() const;
46 
47  bool is_valid() const;
48 
49  protected:
50  boost::shared_ptr<std::size_t> v_;
51  };
52 
53  using boost::multi_index::detail::hashed_index_iterator;
54 
55  template<typename T, typename U>
56  bool operator==(const handler<transition_h, hashed_index_iterator<T, U> >& h1,
57  const handler<transition_h, hashed_index_iterator<T, U> >& h2);
58  template<typename T, typename U>
59  bool operator!=(const handler<transition_h, hashed_index_iterator<T, U> >& h1,
60  const handler<transition_h, hashed_index_iterator<T, U> >& h2);
61  template<typename T, typename U>
62  bool operator<(const handler<transition_h, hashed_index_iterator<T, U> >& h1,
63  const handler<transition_h, hashed_index_iterator<T, U> >& h2);
64  template<typename T, typename U>
65  bool operator>(const handler<transition_h, hashed_index_iterator<T, U> >& h1,
66  const handler<transition_h, hashed_index_iterator<T, U> >& h2);
67  template<typename T, typename U>
68  bool operator<=(const handler<transition_h, hashed_index_iterator<T, U> >& h1,
69  const handler<transition_h, hashed_index_iterator<T, U> >& h2);
70  template<typename T, typename U>
71  bool operator>=(const handler<transition_h, hashed_index_iterator<T, U> >& h1,
72  const handler<transition_h, hashed_index_iterator<T, U> >& h2);
73 
74  template<>
75  bool operator==(const handler<state_h, boost::shared_ptr<std::size_t> >& h1,
76  const handler<state_h, boost::shared_ptr<std::size_t> >& h2);
77  template<>
78  bool operator!=(const handler<state_h, boost::shared_ptr<std::size_t> >& h1,
79  const handler<state_h, boost::shared_ptr<std::size_t> >& h2);
80  template<>
81  bool operator<(const handler<state_h, boost::shared_ptr<std::size_t> >& h1,
82  const handler<state_h, boost::shared_ptr<std::size_t> >& h2);
83  template<>
84  bool operator>(const handler<state_h, boost::shared_ptr<std::size_t> >& h1,
85  const handler<state_h, boost::shared_ptr<std::size_t> >& h2);
86  template<>
87  bool operator<=(const handler<state_h, boost::shared_ptr<std::size_t> >& h1,
88  const handler<state_h, boost::shared_ptr<std::size_t> >& h2);
89  template<>
90  bool operator>=(const handler<state_h, boost::shared_ptr<std::size_t> >& h1,
91  const handler<state_h, boost::shared_ptr<std::size_t> >& h2);
92 
93 
94 } // vcsn
95 
96 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
97 # include <vaucanson/automata/implementation/bmig/bmig_handlers.hxx>
98 # include <vaucanson/automata/implementation/bmig/bmig_handlers_op.hxx>
99 #endif // VCSN_USE_INTERFACE_ONLY
100 
101 #endif
102