Vaucanson  1.4.1
krat_exp_proxy.hh
1 // krat_exp_proxy.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 
18 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_PROXY_HH
19 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_PROXY_HH
20 # include <vaucanson/design_pattern/design_pattern.hh>
21 
22 namespace vcsn {
23 
24  namespace algebra {
25 
34  {
35  virtual semiring_virtual& operator=(semiring_virtual& sem) = 0;
36  virtual ~semiring_virtual() {}
37  };
38 
45  {
46  /* Virtual fonctions used in the parser */
47  virtual krat_exp_virtual& operator=(krat_exp_virtual& exp) = 0;
48  virtual krat_exp_virtual* operator+(krat_exp_virtual* exp) = 0;
49  virtual krat_exp_virtual* operator*(krat_exp_virtual* exp) = 0;
50  virtual void star() = 0;
51  virtual void left_weight(semiring_virtual* sem) = 0;
52  virtual void right_weight(semiring_virtual* sem) = 0;
53  virtual ~krat_exp_virtual() {}
54  };
55 
60  template <class S, class T>
62  {
63  typedef typename Element<S, T>::monoid_elt_t monoid_elt_t;
64 
65  // Constructors && Destructor
67  ~krat_exp_proxy() {}
68 
69  krat_exp_virtual& operator=(krat_exp_virtual& exp);
70  krat_exp_virtual* operator+(krat_exp_virtual* exp);
71  krat_exp_virtual* operator*(krat_exp_virtual* exp);
72  void star();
73  void left_weight(semiring_virtual* sem);
74  void right_weight(semiring_virtual* sem);
75 
76  // Attibutes
77  Element<S, T> self;
78  };
79 
84  template <class S, class T>
86  {
87  typedef typename Element<S, T>::semiring_elt_t semiring_elt_t;
88 
89  //Constructor && Destructor
90  semiring_proxy(semiring_elt_t& sem);
91  ~semiring_proxy() {}
92 
93  semiring_virtual& operator=(semiring_virtual& sem);
94 
95  // Attibutes
96  semiring_elt_t self;
97  };
98 
101  } // algebra
102 
103 } // vcsn
104 
105 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
106 # include <vaucanson/algebra/implementation/series/krat_exp_proxy.hxx>
107 # endif // VCSN_USE_INTERFACE_ONLY
108 
109 #endif // !VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_PROXY_HH //