Vaucanson  1.4.1
bmig_handlers.hxx
1 // bmig_handlers.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 #ifndef VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_HANDLERS_HXX
18 # define VCSN_AUTOMATA_IMPLEMENTATION_BMIG_BMIG_HANDLERS_HXX
19 
21 # include <vaucanson/automata/concept/handlers.hh>
22 # include <vaucanson/automata/implementation/bmig/bmig_handlers.hh>
23 
24 namespace vcsn
25 {
26 
27  inline
28  handler<state_h, boost::shared_ptr<std::size_t> >::handler()
29  {
30  static boost::shared_ptr<std::size_t> uint_max(new std::size_t(UINT_MAX));
31  v_ = uint_max;
32  }
33 
34  inline
35  handler<state_h, boost::shared_ptr<std::size_t> >::handler(boost::shared_ptr<std::size_t> h) : v_(h)
36  {}
37 
38  inline
39  handler<state_h, boost::shared_ptr<std::size_t> >::handler(const handler<state_h, boost::shared_ptr<std::size_t> >& h) : v_(h.v_)
40  {}
41 
42  inline
43  handler<state_h, boost::shared_ptr<std::size_t> >&
44  handler<state_h, boost::shared_ptr<std::size_t> >::operator=(const handler<state_h, boost::shared_ptr<std::size_t> >& h)
45  {
46  v_ = h.v_;
47  return *this;
48  }
49 
50  inline
51  boost::shared_ptr<std::size_t>
52  handler<state_h, boost::shared_ptr<std::size_t> >::value() const
53  {
54  return v_;
55  }
56 
57  inline
58  handler<state_h, boost::shared_ptr<std::size_t> >::operator unsigned() const
59  {
60  return *v_;
61  }
62 
63  inline
64  bool
65  handler<state_h, boost::shared_ptr<std::size_t> >::is_valid() const
66  {
67  return *v_ != UINT_MAX;
68  }
69 
70 } // vcsn
71 #endif
72