Vaucanson  1.4.1
listg_handlers.hxx
1 // listg_handlers.hxx: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 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_LISTG_LISTG_HANDLERS_HXX
18 # define VCSN_AUTOMATA_IMPLEMENTATION_LISTG_LISTG_HANDLERS_HXX
19 
20 # include <climits>
22 # include <vaucanson/automata/implementation/listg/listg_handlers.hh>
23 
24 namespace vcsn
25 {
26 
27  template<typename Tag>
28  handler<Tag, unsigned>::handler() : v_(UINT_MAX)
29  {}
30 
31  template<typename Tag>
32  handler<Tag, unsigned>::handler(unsigned h) : v_(h)
33  {}
34 
35  template<typename Tag>
36  handler<Tag, unsigned>::handler(const handler<Tag, unsigned>& h) : v_(h.v_)
37  {}
38 
39  template<typename Tag>
40  handler<Tag, unsigned>&
41  handler<Tag, unsigned>::operator=(const handler<Tag, unsigned>& h)
42  {
43  v_ = h.v_;
44  return *this;
45  }
46 
47  template<typename Tag>
48  unsigned handler<Tag, unsigned>::value() const
49  {
50  return v_;
51  }
52 
53  template<typename Tag>
54  handler<Tag, unsigned>::operator unsigned() const
55  {
56  return v_;
57  }
58 
59  template<typename Tag>
60  bool
61  handler<Tag, unsigned>::is_valid() const
62  {
63  return v_ != UINT_MAX;
64  }
65 
66 } // vcsn
67 
68 #endif
69