spot  1.2.1a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fasttgba_state.hh
1 // Copyright (C) 2012 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_FASTTGBA_FASTTGBA_STATE_HH
20 # define SPOT_FASTTGBA_FASTTGBA_STATE_HH
21 
22 #include <boost/shared_ptr.hpp>
23 #include <string>
24 #include "misc/casts.hh"
25 
26 namespace spot
27 {
28 
31  {
32  public:
41  virtual int compare(const fasttgba_state* other) const = 0;
42 
47  virtual size_t hash() const = 0;
48 
50  virtual fasttgba_state* clone() const = 0;
51 
55  virtual void* external_information() const = 0;
56 
60  virtual void destroy() const
61  {
62  delete this;
63  }
64 
65  protected:
70  virtual ~fasttgba_state()
71  {
72  }
73  };
74 
75 
77  public std::binary_function<const fasttgba_state*,
78  const fasttgba_state*, bool>
79  {
80  bool
81  operator()(const fasttgba_state* left, const fasttgba_state* right) const
82  {
83  assert(left);
84  return 0 == left->compare(right);
85  }
86  };
87 
89  public std::unary_function<const fasttgba_state*, size_t>
90  {
91  size_t
92  operator()(const fasttgba_state* that) const
93  {
94  assert(that);
95  return that->hash();
96  }
97  };
98 
99 }
100 
101 #endif // SPOT_FASTTGBA_FASTTGBA_STATE_HH
This class act as an interface for all classes.
Definition: fasttgba_state.hh:30
virtual int compare(const fasttgba_state *other) const =0
Compares two states (that come from the same automaton).
virtual ~fasttgba_state()
Destructor.
Definition: fasttgba_state.hh:70
Definition: fasttgba_state.hh:76
virtual size_t hash() const =0
Hash a state.
virtual void * external_information() const =0
Definition: fasttgba_state.hh:88
virtual fasttgba_state * clone() const =0
Duplicate a state.
virtual void destroy() const
Release a state.
Definition: fasttgba_state.hh:60

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Tue Jan 21 2014 16:52:01 for spot by doxygen 1.8.5