Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

util::ariel::BinaryFunction Class Reference

#include <Operator.h>

Inheritance diagram for util::ariel::BinaryFunction:

util::ariel::Operator util::Object util::ariel::Add util::ariel::ArrayIndex util::ariel::Assignment util::ariel::BinaryAnd util::ariel::BinaryOr util::ariel::BinaryXor util::ariel::Comma util::ariel::Different util::ariel::Divide util::ariel::Equal util::ariel::FunctionCall util::ariel::Greater util::ariel::GreaterOrEqual util::ariel::Less util::ariel::LessOrEqual util::ariel::LogicalAnd util::ariel::LogicalOr util::ariel::Modulus util::ariel::Multiply util::ariel::Subtract List of all members.

Detailed Description

BinaryFunction is a base class for operations that have two operands.


Public Types

enum  ExecutionOrder { ORDER_LEFT_TO_RIGHT, ORDER_RIGHT_TO_LEFT }
 An enumeration for two possible execution orders. More...


Public Methods

virtual SmartPtr< Computableoperator() (const Computable &c1, const Computable &c2)=0 throw (ComputationException&)
 All binary functions perform operations on to operands and must override this method.


Public Attributes

ExecutionOrder executionOrder
 The execution order for this function.


Protected Methods

 BinaryFunction (ExecutionOrder order=ORDER_LEFT_TO_RIGHT)
 Create a new binary function that has the specified execution order.


Member Enumeration Documentation

enum util::ariel::BinaryFunction::ExecutionOrder
 

An enumeration for two possible execution orders.

(Note that 'execution order' does not mean 'operator precedence'.) For some operations, the execution order plays no significant role. It makes no difference to evaluate '1+2+3' from either left to right or right to left. However, operators like '-', ',' and '=' depend on a strictly defined execution order. '=' must be evaluated right to left, because otherwise 'a=b=1' would yield no value for 'a'. At the same time, '(a,(b,c),d)' must be evaluated from left to right, because otherwise the result would be '(a,(b,c,d))'. In the most obvious case, '3-2-1' is different from '3-(2-1)'. Possible values for execution order are:

  • ORDER_LEFT_TO_RIGHT
  • ORDER_RIGHT_TO_LEFT


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.