spot  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
sabastate.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2009, 2013 Laboratoire de Recherche et Développement
3 // de l'Epita (LRDE).
4 //
5 // This file is part of Spot, a model checking library.
6 //
7 // Spot is free software; you can redistribute it and/or modify it
8 // under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // Spot is distributed in the hope that it will be useful, but WITHOUT
13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 
20 #ifndef SPOT_SABA_SABASTATE_HH
21 # define SPOT_SABA_SABASTATE_HH
22 
23 #include "misc/common.hh"
24 #include <bdd.h>
25 #include <functional>
26 #include <boost/shared_ptr.hpp>
27 
28 namespace spot
29 {
30 
33  class SPOT_API saba_state
34  {
35  public:
46  virtual int compare(const saba_state* other) const = 0;
47 
67  virtual size_t hash() const = 0;
68 
70  virtual saba_state* clone() const = 0;
71 
76  virtual bdd acceptance_conditions() const = 0;
77 
78  virtual ~saba_state()
79  {
80  }
81  };
82 
96  public std::binary_function<const saba_state*, const saba_state*, bool>
97  {
98  bool
99  operator()(const saba_state* left, const saba_state* right) const
100  {
101  assert(left);
102  return left->compare(right) < 0;
103  }
104  };
105 
120  public std::binary_function<const saba_state*, const saba_state*, bool>
121  {
122  bool
123  operator()(const saba_state* left, const saba_state* right) const
124  {
125  assert(left);
126  return 0 == left->compare(right);
127  }
128  };
129 
145  public std::unary_function<const saba_state*, size_t>
146  {
147  size_t
148  operator()(const saba_state* that) const
149  {
150  assert(that);
151  return that->hash();
152  }
153  };
154 
155  // Functions related to shared_ptr.
157 
158  typedef boost::shared_ptr<const saba_state> shared_saba_state;
159 
175  public std::binary_function<shared_saba_state,
176  shared_saba_state, bool>
177  {
178  bool
179  operator()(shared_saba_state left,
180  shared_saba_state right) const
181  {
182  assert(left);
183  return left->compare(right.get()) < 0;
184  }
185  };
186 
203  public std::binary_function<shared_saba_state,
204  shared_saba_state, bool>
205  {
206  bool
207  operator()(shared_saba_state left,
208  shared_saba_state right) const
209  {
210  assert(left);
211  return 0 == left->compare(right.get());
212  }
213  };
214 
233  public std::unary_function<shared_saba_state, size_t>
234  {
235  size_t
236  operator()(shared_saba_state that) const
237  {
238  assert(that);
239  return that->hash();
240  }
241  };
242 
243 }
244 
245 #endif // SPOT_SABA_SABASTATE_HH

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Sat Dec 6 2014 12:28:44 for spot by doxygen 1.8.4