transition_t Class Reference

Abstract interface of a class representing a transition. More...

#include <transition.hh>

Inheritance diagram for transition_t:

bymoc_transition_t dve_transition_t prob_transition_t dve_prob_transition_t

List of all members.

Public Member Functions

bool can_be_modified () const
 Tells, whether this transition can be modified.
bool can_read () const
 Tells, whether this transition can be modified.
size_int_t get_gid () const
 Returns transition GID of this transition.
size_int_t get_lid () const
 Returns transition LID of this transition.
system_tget_parent_system () const
 Returns a "parent" system of this transition.
virtual void set_parent_system (system_t &system)
 Sets a "parent" system of this transition.
 transition_t (system_t *const system)
 A constructor.
 transition_t ()
 A constructor.
virtual ~transition_t ()
 A destructor.
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)=0
 Reads in the transition from a string representation.
virtual int read (std::istream &istr, size_int_t process_gid=NO_ID)=0
 Reads in the transition from a string representation in stream.
Methods for modifying a transition
These methods are implemented only if can_be_modified() returns true.

virtual void set_gid (const size_int_t gid)
 Sets a GID of this transition.
virtual void set_lid (const size_int_t id)
 Sets a LID of this transition.
Obligatory part of abstact interface
These methods have to implemented in each implementation of transition_t (if transitions are supported by the system).

virtual std::string to_string () const =0
 Returns a string representation of the transition.
virtual void write (std::ostream &ostr) const =0
 Writes a string representation of the transition to stream.

Static Protected Member Functions

static error_vector_tget_error_vector ()
static void set_error_vector (error_vector_t &evect)

Protected Attributes

size_int_t global_id
 Protected data item containing GID.
size_int_t local_id
 Protected data item containing LID.
system_tparent_system
 Protected data item containing "parent" system.

Static Protected Attributes

static error_vector_tptrans_terr = &gerr


Detailed Description

Abstract interface of a class representing a transition.

This class represents a transition. It is a part of the model of a system. The corresponding system is given as a parameter of constructor transition_t(system_t * const system) or by method set_parent_system(). Developer is reponsible for correct setting of this "parent" system (but developer rarely creates new transitions - they are automatically created by system during source file reading).


Constructor & Destructor Documentation

transition_t ( system_t *const   system  )  [inline]

A constructor.

Parameters:
system = "parent" system of this transition


Member Function Documentation

bool can_be_modified (  )  const

Tells, whether this transition can be modified.

This method uses "parent" system given in a constructor or a method set_parent_system(). Therefore "parent" system has to be set before the first call of this method.

References system_t::get_abilities(), parent_system, and system_abilities_t::transition_can_be_modified.

bool can_read (  )  const

Tells, whether this transition can be modified.

This method uses "parent" system given in a constructor or a method set_parent_system(). Therefore "parent" system has to be set before the first call of this method.

References system_t::get_abilities(), parent_system, and system_abilities_t::transition_can_read.

virtual int from_string ( std::string &  trans_str,
const size_int_t  process_gid = NO_ID 
) [pure virtual]

Reads in the transition from a string representation.

Parameters:
trans_str = string containing a source of a transition
process_gid = context of a process (default value NO_ID = global context)
Returns:
... 0 iff no error occurs, non-zero value in a case of error during a reading.

Implemented in bymoc_transition_t, dve_prob_transition_t, and dve_transition_t.

static error_vector_t& get_error_vector (  )  [inline, static, protected]

Protected static method returning , which will be used in case of any error message

size_int_t get_gid (  )  const [inline]

Returns transition GID of this transition.

Note:
This method is not virtual, because it should be really fast

Referenced by prob_system_t::consolidate(), por_t::generate_ample_sets(), por_t::generate_composed_ample_sets(), dve_prob_explicit_system_t::get_succs(), and por_t::init().

size_int_t get_lid (  )  const [inline]

Returns transition LID of this transition.

Note:
This method is not virtual, because it should be really fast

Referenced by por_t::init(), dve_system_trans_t::write(), and dve_prob_process_t::write().

virtual int read ( std::istream &  istr,
size_int_t  process_gid = NO_ID 
) [pure virtual]

Reads in the transition from a string representation in stream.

Parameters:
istr = input stream containing a source of transition
process_gid = context of process (default value NO_ID = global context)
Returns:
... 0 iff no error occurs, non-zero value in a case of error during a reading.

Implemented in bymoc_transition_t, dve_prob_transition_t, and dve_transition_t.

static void set_error_vector ( error_vector_t evect  )  [inline, static, protected]

Protected static method setting , which will be used in case of any error message

virtual void set_gid ( const size_int_t  gid  )  [inline, virtual]

Sets a GID of this transition.

Warning:
See the description of concrete implementation. This method often cannot be used by developer from consistency reasons (even if it is implemented).

Referenced by prob_system_t::consolidate().

virtual void set_lid ( const size_int_t  id  )  [inline, virtual]

Sets a LID of this transition.

Warning:
See the description of concrete implementation. This method often cannot be used by developer from consistency reasons (even if it is implemented).

Referenced by dve_prob_process_t::add_prob_transition(), and dve_process_t::add_transition().

virtual std::string to_string (  )  const [pure virtual]

Returns a string representation of the transition.

If system can work with transitions (according to system_t::can_transitions()), this method is obligatory to implement.

Implemented in bymoc_transition_t, dve_prob_transition_t, and dve_transition_t.

virtual void write ( std::ostream &  ostr  )  const [pure virtual]

Writes a string representation of the transition to stream.

If system can work with transitions (according to system_t::can_transitions()), this method is obligatory to implement.

Implemented in bymoc_transition_t, dve_prob_transition_t, and dve_transition_t.

Referenced by dve_prob_process_t::write().


Member Data Documentation

error_vector_t * ptrans_terr = &gerr [static, protected]

Protected static data item containing , which will be used in case of any error message

Referenced by dve_transition_t::read(), dve_prob_transition_t::read(), and dve_prob_transition_t::write().


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