expression_t Class Reference

Abstact interface of a class representing an expression. More...

#include <expression.hh>

Inheritance diagram for expression_t:

bymoc_expression_t dve_expression_t

List of all members.

Public Member Functions

virtual void assign (const expression_t &expr)
 Copies the contents of `expr' into this expression (time O(n)).
 expression_t (const expression_t &second)
 A copy constructor.
 expression_t (system_t *const system)
 A constructor.
 expression_t ()
 A constructor.
virtual int from_string (std::string &expr_str, const size_int_t process_gid=NO_ID)=0
 Reads in the expression from a string representation.
system_tget_parent_system () const
 Returns a "parent" system of this expression.
expression_toperator= (const expression_t &second)
 The assignment operator for expressions.
virtual int read (std::istream &istr, size_int_t process_gid=NO_ID)=0
 Reads in the expression from a string representation in stream.
virtual void set_parent_system (system_t &system)
 Sets a "parent" system of this expression.
virtual void swap (expression_t &expr)
 Swaps the content of `expr' and this expression (time O(1)).
virtual std::string to_string () const =0
 Returns string representation of the expression.
virtual void write (std::ostream &ostr) const =0
 Writes a string representation of the expression to stream.
virtual ~expression_t ()
 A destructor.

Protected Attributes

system_tparent_system


Detailed Description

Abstact interface of a class representing an expression.

Class expression_t represents expressions interpretable in a system given in a constructor expression_t(system_t * const system) of in a method set_parent_system(system_t & system)

Note:
Developer is responsible for correct setting of "parent" system (but expressions created during reading of the system from a file have the "parent" system set correctly).

Constructor & Destructor Documentation

expression_t ( system_t *const   system  )  [inline]

A constructor.

Parameters:
system = "parent" system of this expression


Member Function Documentation

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

Reads in the expression from a string representation.

Parameters:
expr_str = string containing source of an expression
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_expression_t, and dve_expression_t.

expression_t& operator= ( const expression_t second  )  [inline]

The assignment operator for expressions.

It copies the content of second (the right argument of an operator) to the left argument of an operator.

It is implemented simply by assign() method and you can also write left_argument.assign(right_argument) instead of left_argument = right_argument.

Returns:
The reference to this object (left argument of an operator after an assignment)

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

Reads in the expression from a string representation in stream.

Parameters:
istr = input stream containing source of expression
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_expression_t, and dve_expression_t.

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

Returns string representation of the expression.

Implementation issue: This function is slower than write(), because it does a copying of potentially long string

Implemented in bymoc_expression_t, and dve_expression_t.


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

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