Ql_baseop2 Class Reference

#include <Ql_baseop2.hxx>

Inherits Ql_otherops.

Inheritance diagram for Ql_baseop2:

[legend]
Collaboration diagram for Ql_baseop2:
[legend]
List of all members.

Public Member Functions

 Ql_baseop2 (int, Ql_operation *, Ql_operation *)
 ~Ql_baseop2 ()
Ql_operation * parameter1 ()
Ql_operation * parameter2 ()
int is_equiv (Ql_operation *, Ql_renaming *, Ql_iterop *)
void update_nesting_links ()
int type_infer (int *)
int union_type_infer (int *)
int set_to_true ()
int evaluate ()
int(Ql_baseop2::* exec_function ())()
int insert_one_class_instance ()
int delete_one_class_instance ()

Public Attributes

char * SQLcond

Detailed Description

Class Ql_baseop2 concerns the base operations of arity 2 (e.g. comparisons, set operations). They are characterized by their 2 parameters and their evaluation code.

Author:
Grigoris Karvounarakis
Version:
1.0


Constructor & Destructor Documentation

Ql_baseop2::Ql_baseop2 ( int  n,
Ql_operation *  p1,
Ql_operation *  p2 
)

Construction of a baseop2 operation

Ql_baseop2::~Ql_baseop2 (  ) 

Destruction of a baseop2


Member Function Documentation

Ql_operation* Ql_baseop2::parameter1 (  )  [inline]

Returns:
the first parameter of this operation

Ql_operation* Ql_baseop2::parameter2 (  )  [inline]

Returns:
the second parameter of this operation

int Ql_baseop2::is_equiv ( Ql_operation *  op,
Ql_renaming *  renaming,
Ql_iterop *  circle 
) [virtual]

Used when testing the equivalence of two iterators. (see Ql_algiterop::is_equiv(Ql_operation *, Ql_renaming *, Ql_iterop *) Checks the equivalence of two operations inside the main query (circle=NULL) or inside an iterator (circle<>NULL) according to a variable renaming. The rule says that outside the circle the operations must be strictly equal and that inside they must be equivalent (variables renaming).

Parameters:
op the operation to check equivalence with
renaming a variable renaming
circle the iterator in which we check the equivalence
Returns:
true (1) if they are equivalent, false (0) otherwise

Implements Ql_operation.

void Ql_baseop2::update_nesting_links (  ) 

Update of the dependency links. A binary operation is nested in the most embedded iterator its parameters are nested in and depends on the variables belonging to this iterator and on which its parameters depend

int Ql_baseop2::type_infer ( int *  error_code  ) 

Infers the type and assigns the code of a binary operation. Code assignment is done by auxiliary member functions. When kind<>bool, type assignment is done by the auxiliary function, otherwise it is done by type_infer

Parameters:
error_code a placeholder, where an error code is put, in case of error
Returns:
KO (1) if an error occured, OK (1) otherwise

int Ql_baseop2::union_type_infer ( int *  error_code  ) 

Special type inference function for the case that at least one of the parameters is of union type. Infers the type and assigns the code of a binary operation. Note that the evaluation code for an operation is different if none, one or both its parameter have union type (so that the evaluation code is as minimal as possible). Code assignment is done by auxiliary member functions. When kind<>bool, type assignment is done by the auxiliary function, otherwise it is done by type_infer

Parameters:
error_code a placeholder, where an error code is put, in case of error
Returns:
KO (1) if an error occured, OK (1) otherwise

Cut out for now ... enable later <GPK> case ith_n: Requires constant index for seq !!! if(v_parameter1->kind() == QL_SEQ && v_parameter2->kind() == QL_INT){ int ind = v_parameter2->result()->res.intvalue; Ql_type *tmp2 = v_parameter1->type()->elementAt(ind);

kind(tmp2->kind()); if(tmp2->type() != 0){ type(tmp2->type()->duplicate()); } v_code = &Ql_baseop2::ith; } </GPK>

int Ql_baseop2::set_to_true (  )  [inline]

Sets the evaluation code for this operation to a function returning always true. Used to avoid the evaluation of operations which are pushed to the underlying database.

int Ql_baseop2::evaluate (  )  [virtual]

Check if the stored result is outdated. If yes, execute the proper evaluation function.

Returns:
KO (1) if there was a runtime error, OK otherwise

Implements Ql_operation.

int(Ql_baseop2::* Ql_baseop2::exec_function (  )  [inline]

Returns:
a pointer to the evaluation function of this operation (private field Ql_baseop2::v_code)

int Ql_baseop2::insert_one_class_instance (  ) 

The following description applies for all the insert_*resource* functions: Insert a resource (second parameter) as an instance of a class (first parameter).

Precondition:
- the resource should not be an instance of the class
Postcondition:
- each resource is unique for each class
The precondition results to an extra condition in the insertion query The postcondition results to a side effect: the deletion of the resource from the superclasses of the current class

int Ql_baseop2::delete_one_class_instance (  ) 

The following description applies for all DELETE resource methods: Remove a resource (second parameter) from a class (first parameter)

Precondition:
- The resource should be an instance of the class
Postcondition:
- the resource should, now, be an instance of all superclasses of the class, but not of the class itself.

- all properties with this resource as domain or range are removed if they are not applicable anymore.

The precondition results to an extra condition in the insertion query The first postcondition results to a side effect: the resource is inserted to all the superclasses of this class. The second postcondition results to another side effect: all properties


Member Data Documentation

char* Ql_baseop2::SQLcond

In case this operation can be pushed to the underlying database, this field contains the equivalent query string which is appended to the appropriate scan query


The documentation for this class was generated from the following files:
Generated on Thu Oct 26 16:42:07 2006 for rul by  doxygen 1.5.0