spot  0.9.1
Classes | Public Types | Public Member Functions | Public Attributes | Protected Attributes
spot::state_explicit< Label, label_hash > Class Template Reference

#include <tgba/tgbaexplicit.hh>

Inheritance diagram for spot::state_explicit< Label, label_hash >:
Inheritance graph
[legend]
Collaboration diagram for spot::state_explicit< Label, label_hash >:
Collaboration graph
[legend]

List of all members.

Classes

struct  transition

Public Types

typedef Label label_t
typedef label_hash label_hash_t
typedef std::list< transitiontransitions_t

Public Member Functions

 state_explicit ()
 state_explicit (const Label &l)
virtual ~state_explicit ()
virtual void destroy () const
 Release a state.
const Label & label () const
bool empty () const
virtual int compare (const state *other) const
 Compares two states (that come from the same automaton).
virtual size_t hash () const
 Hash a state.
virtual state_explicit< Label,
label_hash > * 
clone () const
 Duplicate a state.

Public Attributes

transitions_t successors

Protected Attributes

Label label_

Detailed Description

template<typename Label, typename label_hash>
class spot::state_explicit< Label, label_hash >

States used by spot::explicit_graph implementation


Member Typedef Documentation

template<typename Label, typename label_hash>
typedef label_hash spot::state_explicit< Label, label_hash >::label_hash_t
template<typename Label, typename label_hash>
typedef Label spot::state_explicit< Label, label_hash >::label_t
template<typename Label, typename label_hash>
typedef std::list<transition> spot::state_explicit< Label, label_hash >::transitions_t

Constructor & Destructor Documentation

template<typename Label, typename label_hash>
spot::state_explicit< Label, label_hash >::state_explicit ( ) [inline]
template<typename Label, typename label_hash>
spot::state_explicit< Label, label_hash >::state_explicit ( const Label &  l) [inline]
template<typename Label, typename label_hash>
virtual spot::state_explicit< Label, label_hash >::~state_explicit ( ) [inline, virtual]

Member Function Documentation

template<typename Label, typename label_hash>
virtual state_explicit<Label, label_hash>* spot::state_explicit< Label, label_hash >::clone ( ) const [inline, virtual]

Duplicate a state.

Implements spot::state.

template<typename Label, typename label_hash>
virtual int spot::state_explicit< Label, label_hash >::compare ( const state other) const [inline, virtual]

Compares two states (that come from the same automaton).

This method returns an integer less than, equal to, or greater than zero if this is found, respectively, to be less than, equal to, or greater than other according to some implicit total order.

This method should not be called to compare states from different automata.

See also:
spot::state_ptr_less_than

Implements spot::state.

template<typename Label, typename label_hash>
virtual void spot::state_explicit< Label, label_hash >::destroy ( ) const [inline, virtual]

Release a state.

Methods from the tgba or tgba_succ_iterator always return a new state that you should deallocate with this function. Before Spot 0.7, you had to "delete" your state directly. Starting with Spot 0.7, you update your code to this function instead (which simply calls "delete"). In a future version, some subclasses will redefine destroy() to allow better memory management (e.g. no memory allocation for explicit automata).

Reimplemented from spot::state.

template<typename Label, typename label_hash>
bool spot::state_explicit< Label, label_hash >::empty ( ) const [inline]
template<typename Label, typename label_hash>
virtual size_t spot::state_explicit< Label, label_hash >::hash ( ) const [inline, virtual]

Hash a state.

This method returns an integer that can be used as a hash value for this state.

Note that the hash value is guaranteed to be unique for all equal states (in compare()'s sense) for only has long has one of these states exists. So it's OK to use a spot::state as a key in a hash_map because the mere use of the state as a key in the hash will ensure the state continues to exist.

However if you create the state, get its hash key, delete the state, recreate the same state, and get its hash key, you may obtain two different hash keys if the same state were not already used elsewhere. In practice this weird situation can occur only when the state is BDD-encoded, because BDD numbers (used to build the hash value) can be reused for other formulas. That probably doesn't matter, since the hash value is meant to be used in a hash_map, but it had to be noted.

Implements spot::state.

template<typename Label, typename label_hash>
const Label& spot::state_explicit< Label, label_hash >::label ( ) const [inline]

Member Data Documentation

template<typename Label, typename label_hash>
Label spot::state_explicit< Label, label_hash >::label_ [protected]
template<typename Label, typename label_hash>
transitions_t spot::state_explicit< Label, label_hash >::successors

The documentation for this class was generated from the following file:

Please comment this page and report errors about it on the RefDocComments page.
Generated on Wed May 23 2012 12:06:46 for spot by doxygen 1.7.6.1