Vaucanson  1.4.1
monoid_rep.hh
1 // monoid_rep.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 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_ALGEBRA_IMPLEMENTATION_MONOID_MONOID_REP_HH
18 # define VCSN_ALGEBRA_IMPLEMENTATION_MONOID_MONOID_REP_HH
19 
20 # include <boost/shared_ptr.hpp>
21 
22 # include <vaucanson/algebra/implementation/monoid/monoid_rep_base.hh>
23 
24 namespace vcsn
25 {
26  namespace algebra
27  {
28  template <typename M>
29  struct MonoidRep : MonoidRepBase<MonoidRep, M>
30  {
31  };
32 
33  template <typename M>
34  bool operator==(boost::shared_ptr<MonoidRep<M> >,
35  boost::shared_ptr<MonoidRep<M> >);
36 
37  template <typename M>
38  struct MonoidRepDefault
39  {
40  // Type helpers.
41  typedef MonoidRep<M> monoid_rep_t;
42  typedef boost::shared_ptr<monoid_rep_t> pointer_t;
43 
44  // Singleton instance getter.
45  static pointer_t get_instance()
46  {
47  static pointer_t p(new monoid_rep_t());
48  return p;
49  }
50  };
51 
52  } // ! algebra
53 
54 } // ! vcsn
55 
56 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
57 # include <vaucanson/algebra/implementation/monoid/monoid_rep.hxx>
58 # endif // VCSN_USE_INTERFACE_ONLY
59 
60 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_MONOID_MONOID_REP_HH