spot  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
spot::state_explicit_string Class Reference

#include <tgba/tgbaexplicit.hh>

Inheritance diagram for spot::state_explicit_string:
Inheritance graph
Collaboration diagram for spot::state_explicit_string:
Collaboration graph

Public Types

typedef std::string label_t
 
typedef string_hash label_hash_t
 
typedef std::list< transition > transitions_t
 

Public Member Functions

 state_explicit_string (const std::string &label)
 
virtual void destroy () const
 Release a state. More...
 
const std::string & label () const
 
bool empty () const
 
virtual int compare (const state *other) const
 Compares two states (that come from the same automaton). More...
 
virtual size_t hash () const
 Hash a state. More...
 
virtual state_explicit
< std::string, string_hash > * 
clone () const
 Duplicate a state. More...
 

Public Attributes

transitions_t successors
 

Static Public Attributes

static const std::string default_val
 

Protected Attributes

std::string label_
 

Detailed Description

States labeled by a string

Member Function Documentation

virtual state_explicit<std::string , string_hash >* spot::state_explicit< std::string , string_hash >::clone ( ) const
inlinevirtualinherited

Duplicate a state.

Implements spot::state.

virtual int spot::state_explicit< std::string , string_hash >::compare ( const state other) const
inlinevirtualinherited

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_explicit< std::string , string_hash >::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 from spot::state.

virtual size_t spot::state_explicit< std::string , string_hash >::hash ( ) const
inlinevirtualinherited

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.


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

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