dve_transition_t Class Reference

Class representing a transition. More...

#include <dve_transition.hh>

Inheritance diagram for dve_transition_t:

dve_source_position_t transition_t

List of all members.

Public Member Functions

 dve_transition_t (system_t *const system)
 dve_transition_t ()
 A constructor (no system set - call set_parent_system() after creation).
virtual ~dve_transition_t ()
 A destructor.
DVE system specific methods
These methods are implemented only in DVE system and they cannot be run using an abstract interface of transition_t.

void add_effect (dve_expression_t *const effect)
 Adds an effect to the list of effects contained in a transition.
void alloc_glob_mask (const size_int_t count_of_glob_vars)
size_int_t get_channel_gid () const
 Returns a GID of channel used in a synchronisation of this transition.
dve_expression_tget_effect (size_int_t eff_nbr) const
 Returns an eff_nbr-ith effect.
size_int_t get_effect_count () const
 Returns a count of effects in this transition.
void get_effect_expr_string (size_int_t i, std::string &str) const
 Returns the string representation of i-th effect in the argument str.
const bit_string_tget_glob_mask () const
 Returns a bit mask of assigned variables.
const dve_expression_tget_guard () const
dve_expression_tget_guard ()
 Returns a guard of this transition.
bool get_guard_string (std::string &str) const
 Sets the string represetation of guard or returns false.
size_int_t get_partial_id () const
size_int_t get_process_gid () const
 Returns a process GID of process owning this trantision.
size_int_t get_state1_gid () const
 Returns a GID of first (starting) state of a transition.
size_int_t get_state1_lid () const
 Returns a LID of first (starting) state of a transition.
const char * get_state1_name () const
 Returns the name of the first state.
size_int_t get_state2_gid () const
 Returns a GID of a second (finishing) state of a transition.
size_int_t get_state2_lid () const
 Returns a LID of a second (finishing) state of a transition.
const char * get_state2_name () const
 Returns the name of the second state.
dve_symbol_table_tget_symbol_table () const
 Returns a symbol table corresponding to this transition.
const char * get_sync_channel_name () const
 Returns the name of channel or 0 (see details).
const dve_expression_tget_sync_expr_list_item (const size_int_t i) const
dve_expression_tget_sync_expr_list_item (const size_int_t i)
 Returns the `i'-th expression in a synchronization written after '!' or '?'.
size_int_t get_sync_expr_list_size () const
 Returns a count of expressions written after '!' or '?'.
bool get_sync_expr_string (std::string &str) const
sync_mode_t get_sync_mode () const
 Returns a synchronization mode of this transition.
bool get_valid () const
 Returns, whether this transition is valid or not.
bool is_sync_ask () const
 Returns true iff transition contains synchronisation of type `question'.
bool is_sync_exclaim () const
 Returns true iff transition contains synchronisation of type `exclaim'.
bool is_without_sync () const
 Returns true iff transition contains no synchronisation.
void set_channel_gid (const size_int_t gid_of_channel)
 Sets a GID of channel used in a synchronisation of this transition.
void set_glob_mark (const size_int_t i, const bool mark)
 Turns bit i-th bit in a global variables mask to `mark'.
void set_guard (dve_expression_t *const guard_expr)
 Sets a guard of this transition.
void set_partial_id (const size_int_t partial_id)
 Sets Partial ID of this transition.
void set_process_gid (const size_int_t gid)
 Sets a process GID of process owning this trantision.
void set_state1_gid (const size_int_t state_gid)
 Sets a GID of first (starting) state of a transition.
void set_state2_gid (const size_int_t state_gid)
 Sets a GID of a second (finishing) state of a transition.
void set_sync_expr_list_item (const size_int_t i, dve_expression_t *const synchro_expr)
 Sets the `i'-th expression in a synchronization written after '!' of '?'.
void set_sync_expr_list_size (const size_int_t size)
 Sets a count of expression written after '!' or '?'.
void set_sync_mode (const sync_mode_t synchro_mode)
 Sets a sync_mode mode of this transition.
void set_valid (const bool valid_value)
 Sets the validity of the transition (`true' means valid).
Methods for reading a transition from a string representation
These methods are implemented only if can_read() returns true.

virtual int from_string (std::string &trans_str, const size_int_t process_gid=NO_ID)
 Implements transition_t::from_string() in DVE system.
virtual int read (std::istream &istr, size_int_t process_gid=NO_ID)
 Implements transition_t::read() in DVE system.
Obligatory part of abstact interface


virtual std::string to_string () const
 Implements transition_t::to_string() in DVE system.
virtual void write (std::ostream &ostr) const
 Implements transition_t::write() in DVE system.

Protected Types

typedef array_t
< dve_expression_t * > 
effects_container_t

Protected Attributes

size_int_t channel_gid
effects_container_t effects
bit_string_t glob_mask
dve_expression_tguard
size_int_t part_id
size_int_t process_gid
size_int_t state1_gid
size_int_t state1_lid
size_int_t state2_gid
size_int_t state2_lid
array_t< dve_expression_t * > sync_exprs
sync_mode_t sync_mode
bool valid


Detailed Description

Class representing a transition.

This class implements the abstract interface transition_t.

Notice, there is the set of methods, which are not virtual and they are already present in the class transition_t (e. g. transition_t::get_gid(), transition_t::get_lid(), ...) and there are also virtual methods with default implementation. They are not changed in dve_transition_t (e. g. transition_t::set_gid(), transition_t::set_lid(), ...).

It supports the full set of methods of an abstract interface and adds many DVE specific methods to this class, corresponding to the DVE point of view to transitions of processes.

Very DVE system specific feature: This class also contains a global variables mask that tells which global variables are used in this transition. This mask is maintained by system during its creation or consolidation. Functions for access to this mask are get_glob_mask(), set_glob_mask() and alloc_glob_mask().

There is a list of all transitions in dve_system_t (use functions system_t::get_trans_count() and system_t::get_transition()) and also each process has a list of his own transitions (functions process_t::get_trans_count() and process_t::get_transition()


Constructor & Destructor Documentation

dve_transition_t ( system_t *const   system  )  [inline]

A constructor (transition has to be created in a context of a system

  • especially its symbol table given in a parameter `system')


Member Function Documentation

void alloc_glob_mask ( const size_int_t  count_of_glob_vars  )  [inline]

Prepare bitmask of global variables - allocate as many bits as a count of global variables

size_int_t get_channel_gid (  )  const [inline]

Returns a GID of channel used in a synchronisation of this transition.

Returns a GID of channel used in a synchronisation of this transition. Is has no reasonable meaning, when get_sync_mode()==SYNC_NO_SYNC

Referenced by dve_parser_t::check_restrictions_put_on_property(), dve_explicit_system_t::compute_enabled_stage2(), dve_explicit_system_t::get_async_enabled_trans_succ_without_property(), and por_t::init().

dve_expression_t* get_effect ( size_int_t  eff_nbr  )  const [inline]

Returns an eff_nbr-ith effect.

Parameters:
eff_nbr = number of effect (effects have numbers from 0 to get_effect_count()-1)

Referenced by dve_explicit_system_t::apply_transition_effects(), dve_parser_t::check_restrictions_put_on_property(), por_t::init(), and write().

const bit_string_t& get_glob_mask (  )  const [inline]

Returns a bit mask of assigned variables.

Returns an object of type bit_string_t, which represents the bit mask of assigned variables in effects of this transition

Referenced by dve_explicit_system_t::not_in_glob_conflict().

const dve_expression_t* get_guard (  )  const [inline]

Returns a pointer to the constant expression representing a guard of this transition

In case when there is no guard get_guard() returns 0.

dve_expression_t* get_guard (  )  [inline]

Returns a guard of this transition.

In case when there is no guard get_guard() returns 0.

Referenced by por_t::init(), and dve_explicit_system_t::passed_through().

bool get_guard_string ( std::string &  str  )  const

Sets the string represetation of guard or returns false.

Parameters:
str = variable to which to return the string repr. of guard
Returns:
true iff transition has a guard

References dve_expression_t::to_string().

Referenced by write().

size_int_t get_partial_id (  )  const [inline]

Returns an index into vector of transitions of process with the same `sync_mode'

Together with sync_mode forms an unique identifier of transition inside the process. To gain a single identifier use a function get_id()

dve_symbol_table_t * get_symbol_table (  )  const

Returns a symbol table corresponding to this transition.

In this symbol table there are stored declarations of variables states, processes and channels, which are used in this transition.

References dve_system_t::get_symbol_table(), and transition_t::parent_system.

Referenced by get_state1_name(), get_state2_name(), get_sync_channel_name(), set_state1_gid(), and set_state2_gid().

const char * get_sync_channel_name (  )  const

Returns the name of channel or 0 (see details).

If the transition is synchronised it returns the name of channel used for this synchronisation. Otherwise it returns 0.

References dve_symbol_table_t::get_channel(), dve_symbol_t::get_name(), get_symbol_table(), and SYNC_NO_SYNC.

Referenced by write().

const dve_expression_t* get_sync_expr_list_item ( const size_int_t  i  )  const [inline]

Returns the `i'-th constant expression in a synchronization written after '!' or '?'

Returns the `i'-th constant expression in a synchronization of this transition. In case when there is no synchronization * get_sync_expr() returns 0.

dve_expression_t* get_sync_expr_list_item ( const size_int_t  i  )  [inline]

Returns the `i'-th expression in a synchronization written after '!' or '?'.

Returns the `i'-th expression in a synchronization of this transition. In case when there is no synchronization * get_sync_expr() returns 0.

Referenced by dve_explicit_system_t::get_async_enabled_trans_succ_without_property(), and por_t::init().

bool get_sync_expr_string ( std::string &  str  )  const

Sets the string represetation of expression in a synchronization or returns false

Parameters:
str = variable to which to return the string repr. of expression from synchronisation
Returns:
true iff transition has an expression in a synchronisation

References array_t::size(), and to_string().

Referenced by write().

bool get_valid (  )  const [inline]

Returns, whether this transition is valid or not.

Returns, whether this transition is valid or not. When transition is not valid, it is not used, when we generate the states of system

void set_partial_id ( const size_int_t  partial_id  )  [inline]

Sets Partial ID of this transition.

Warning:
Partial ID should be set only by process_t, when trantition is added to the list of process's transitions

Referenced by dve_process_t::add_transition().

void set_process_gid ( const size_int_t  gid  )  [inline]

Sets a process GID of process owning this trantision.

Warning:
Use this method carefuly. Do not try to cause inconsistencies


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

Reference Manual for Library, 2006 developed in ParaDiSe laboratory, Faculty of Informatics, Masaryk University