spot  1.0
sabastate.hh
Go to the documentation of this file.
1 // Copyright (C) 2009 Laboratoire de Recherche et Développement
2 // de l'Epita (LRDE).
3 //
4 // This file is part of Spot, a model checking library.
5 //
6 // Spot is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // Spot is distributed in the hope that it will be useful, but WITHOUT
12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 #ifndef SPOT_SABA_SABASTATE_HH
20 # define SPOT_SABA_SABASTATE_HH
21 
22 #include <bdd.h>
23 #include <functional>
24 #include <boost/shared_ptr.hpp>
25 
26 namespace spot
27 {
28 
31  class saba_state
32  {
33  public:
44  virtual int compare(const saba_state* other) const = 0;
45 
65  virtual size_t hash() const = 0;
66 
68  virtual saba_state* clone() const = 0;
69 
74  virtual bdd acceptance_conditions() const = 0;
75 
76  virtual ~saba_state()
77  {
78  }
79  };
80 
94  public std::binary_function<const saba_state*, const saba_state*, bool>
95  {
96  bool
97  operator()(const saba_state* left, const saba_state* right) const
98  {
99  assert(left);
100  return left->compare(right) < 0;
101  }
102  };
103 
118  public std::binary_function<const saba_state*, const saba_state*, bool>
119  {
120  bool
121  operator()(const saba_state* left, const saba_state* right) const
122  {
123  assert(left);
124  return 0 == left->compare(right);
125  }
126  };
127 
143  public std::unary_function<const saba_state*, size_t>
144  {
145  size_t
146  operator()(const saba_state* that) const
147  {
148  assert(that);
149  return that->hash();
150  }
151  };
152 
153  // Functions related to shared_ptr.
155 
156  typedef boost::shared_ptr<const saba_state> shared_saba_state;
157 
173  public std::binary_function<shared_saba_state,
174  shared_saba_state, bool>
175  {
176  bool
178  shared_saba_state right) const
179  {
180  assert(left);
181  return left->compare(right.get()) < 0;
182  }
183  };
184 
201  public std::binary_function<shared_saba_state,
202  shared_saba_state, bool>
203  {
204  bool
206  shared_saba_state right) const
207  {
208  assert(left);
209  return 0 == left->compare(right.get());
210  }
211  };
212 
231  public std::unary_function<shared_saba_state, size_t>
232  {
233  size_t
235  {
236  assert(that);
237  return that->hash();
238  }
239  };
240 
241 }
242 
243 #endif // SPOT_SABA_SABASTATE_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Sat Oct 27 2012 09:34:32 for spot by doxygen 1.8.1.2