spot  1.0.2
Public Member Functions | Private Attributes | List of all members
spot::state_set Class Reference

Set of states deriving from spot::state. More...

#include <tgba/taatgba.hh>

Inheritance diagram for spot::state_set:
Inheritance graph
Collaboration diagram for spot::state_set:
Collaboration graph

Public Member Functions

 state_set (const taa_tgba::state_set *s, bool delete_me=false)
virtual int compare (const spot::state *) const
 Compares two states (that come from the same automaton).
virtual size_t hash () const
 Hash a state.
virtual state_setclone () const
 Duplicate a state.
virtual ~state_set ()
const taa_tgba::state_setget_state () const
virtual void destroy () const
 Release a state.

Private Attributes

const taa_tgba::state_sets_
bool delete_me_

Detailed Description

Set of states deriving from spot::state.

Constructor & Destructor Documentation

spot::state_set::state_set ( const taa_tgba::state_set s,
bool  delete_me = false 
)
inline
virtual spot::state_set::~state_set ( )
inlinevirtual

References delete_me_, and s_.

Member Function Documentation

virtual state_set* spot::state_set::clone ( ) const
virtual

Duplicate a state.

Implements spot::state.

virtual int spot::state_set::compare ( const spot::state other) const
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.

virtual void spot::state::destroy ( ) const
inlinevirtualinherited

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 should update your code to use this function instead. destroy() usually call delete, except in subclasses that destroy() to allow better memory management (e.g., no memory allocation for explicit automata).

Reimplemented in spot::state_ta_explicit, spot::state_explicit< Label, label_hash >, spot::state_explicit< const ltl::formula *, ltl::formula_ptr_hash >, spot::state_explicit< int, identity_hash< int > >, spot::state_explicit< std::string, string_hash >, and spot::state_product.

Referenced by spot::power_map::canonicalize(), spot::shared_state_deleter(), and spot::power_map::~power_map().

const taa_tgba::state_set* spot::state_set::get_state ( ) const
virtual size_t spot::state_set::hash ( ) const
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.

Member Data Documentation

bool spot::state_set::delete_me_
private

Referenced by ~state_set().

const taa_tgba::state_set* spot::state_set::s_
private

Referenced by ~state_set().


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 Mar 6 2013 09:25:16 for spot by doxygen 1.8.1.2