process_t Class Reference

Abstact interface of a class representing a process of a system. More...

#include <process.hh>

Inheritance diagram for process_t:

bymoc_process_t dve_process_t prob_process_t dve_prob_process_t dve_prob_process_t

List of all members.

Public Member Functions

bool can_be_modified () const
 Tells, whether processes can be modified.
bool can_read () const
 Tells, whether process can be read from a string representation.
bool can_transitions () const
 Tells, whether process can work with transitions and contains them.
size_int_t get_gid () const
 Returns a GID of this process.
system_tget_parent_system () const
 Returns a "parent" system of this process.
 process_t (system_t *const system)
 A constructor.
 process_t ()
 A constructor.
virtual void set_parent_system (system_t &system)
 Sets a "parent" system of this process.
virtual ~process_t ()
 A destructor.
Methods modifying a process
These methods are implemented only if can_transitions() returns true.

virtual void add_transition (transition_t *const transition)=0
 Adds new transition to the process.
virtual void remove_transition (const size_int_t transition_gid)=0
 Removes a transition from the process.
virtual void set_gid (const size_int_t new_gid)
 Sets a GID of this process.
Methods for reading a process from a string representation
These methods are implemented only if can_read() returns true.

virtual int from_string (std::string &proc_str)=0
 Reads in the process from the string representation.
virtual int read (std::istream &istr)=0
 Reads in the process from the string representation in stream.
Methods working with transitions of a process
These methods are implemented only if can_transitions() returns true.

virtual size_int_t get_trans_count () const =0
 Returns a count of transitions of this process.
virtual const transition_tget_transition (const size_int_t lid) const =0
 Returns a pointer to the constant transition with LID `lid'.
virtual transition_tget_transition (const size_int_t lid)=0
 Returns a pointer to the transition with LID `lid'.
Obligatory part of abstact interface


virtual std::string to_string () const =0
 Returns a string representation of the process.
virtual void write (std::ostream &ostr) const =0
 Writes a string representation of the process to a 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 gid
 Protected data item storing GID of this process.
system_tparent_system
 Protected data item storing a parent system.

Static Protected Attributes

static error_vector_tpproc_terr = &gerr


Detailed Description

Abstact interface of a class representing a process of a system.

This class represents a process of a system. Its "parent" system is given in a constructor process_t(system_t * const system) or a method set_parent_system().

Note:
Developer is responsible for correct setting of corresponding "parent" system (but he rarely needs to create own processes - they are usually created automatically during reading of a source of the system from a file)

Constructor & Destructor Documentation

process_t ( system_t *const   system  )  [inline]

A constructor.

Parameters:
system = "parent" system of this process

virtual ~process_t (  )  [inline, virtual]

A destructor.

A destructor


Member Function Documentation

virtual void add_transition ( transition_t *const   transition  )  [pure virtual]

Adds new transition to the process.

Parameters:
transition = pointer to the transition to add
This method modifies the added transition because it has to set transition LID and Partial ID.

Implemented in bymoc_process_t, and dve_process_t.

virtual int from_string ( std::string &  proc_str  )  [pure virtual]

Reads in the process from the string representation.

Parameters:
proc_str = string to read from
Returns:
... 0 iff no error occurs, non-zero value in a case of error during a reading.

Implemented in bymoc_process_t, dve_prob_process_t, and dve_process_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

virtual size_int_t get_trans_count (  )  const [pure virtual]

Returns a count of transitions of this process.

Then LID of transitions can be from 0 to (get_trans_count()-1)

Note:
The sum of returned values obtained by calling this method for all processes of the system is equal to the value obtained by method system_t::get_trans_count()

Implemented in bymoc_process_t, and dve_process_t.

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

virtual const transition_t* get_transition ( const size_int_t  lid  )  const [pure virtual]

Returns a pointer to the constant transition with LID `lid'.

LID of transitions can be from 0 to (get_trans_count()-1)

Implemented in bymoc_process_t, and dve_process_t.

virtual transition_t* get_transition ( const size_int_t  lid  )  [pure virtual]

Returns a pointer to the transition with LID `lid'.

LID of transitions can be from 0 to (get_trans_count()-1)

Implemented in bymoc_process_t, and dve_process_t.

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

virtual int read ( std::istream &  istr  )  [pure virtual]

Reads in the process from the string representation in stream.

Parameters:
istr = input stream containing source of the process
Returns:
... 0 iff no error occurs, non-zero value in a case of error during a reading.

Implemented in bymoc_process_t, dve_prob_process_t, and dve_process_t.

virtual void remove_transition ( const size_int_t  transition_gid  )  [pure virtual]

Removes a transition from the process.

Parameters:
transition_gid = GID of removed transition

Implemented in bymoc_process_t, and dve_process_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


Member Data Documentation

error_vector_t * pproc_terr = &gerr [static, protected]

Static protected data item storing an used in case of any error messages

Referenced by dve_prob_process_t::add_prob_transition().


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