state.hh 1.26 KB
 Alexandre Duret-Lutz committed May 26, 2003 1 2 3 ``````#ifndef SPOT_TGBA_STATE_HH # define SPOT_TGBA_STATE_HH `````` Alexandre Duret-Lutz committed May 27, 2003 4 5 ``````#include `````` Alexandre Duret-Lutz committed May 26, 2003 6 7 ``````namespace spot { `````` Alexandre Duret-Lutz committed May 27, 2003 8 9 `````` /// \brief Abstract class for states. `````` Alexandre Duret-Lutz committed May 26, 2003 10 11 12 `````` class state { public: `````` Alexandre Duret-Lutz committed May 27, 2003 13 14 15 16 17 18 19 20 21 22 23 `````` /// \brief Compares two states (that come from the same automaton). /// /// This method returns an integer less than, equal to, or greater /// than zero if \a this is found, respectively, to be less than, equal /// to, or greater than \a other according to some implicit total order. /// /// This method should not be called to compare states from /// different automata. /// /// \sa spot::state_ptr_less_than virtual int compare(const state* other) const = 0; `````` Alexandre Duret-Lutz committed May 27, 2003 24 `````` `````` Alexandre Duret-Lutz committed May 26, 2003 25 26 27 28 `````` virtual ~state() { } }; `````` Alexandre Duret-Lutz committed May 27, 2003 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 `````` /// \brief Strict Weak Ordering for \c state*. /// /// This is meant to be used as a comparison functor for /// STL \c map whose key are of type \c state*. /// /// For instance here is how one could declare /// a map of \c state*. /// \code /// // Remember how many times each state has been visited. /// std::map seen; /// \endcode struct state_ptr_less_than { bool operator()(const state* left, const state *right) { return left->compare(right) < 0; } }; `````` Alexandre Duret-Lutz committed May 26, 2003 50 51 52 ``````} #endif // SPOT_TGBA_STATE_HH``````