Ql_variable_scanop Class Reference

#include <Ql_variable_scanop.hxx>

Inherits Ql_data_scanop.

Inheritance diagram for Ql_variable_scanop:

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

Public Member Functions

 Ql_variable_scanop (int, char *, Ql_operation *, int, Ql_iterop *)
 ~Ql_variable_scanop ()
int evaluate ()
int type_infer (int *)
int union_type_infer (int *)
int scan_open ()
int scan_next ()
void scan_close ()

Detailed Description

Class Ql_variable_scanop is a subclass of Ql_data_scanop, representing scan variables on variable collections, i.e. schema variables (scans) or nested queries. In this case, the domain may be of union type but runtime type inference guarantees that we know the real type of the domain of definition of this scan variable before we open a scan.

Author:
Grigoris Karvounarakis
Version:
1.0


Constructor & Destructor Documentation

Ql_variable_scanop::Ql_variable_scanop ( int  n,
char *  v,
Ql_operation *  dom,
int  pos,
Ql_iterop *  nest 
)

Construction of a variable scan operation. For parameters see Ql_scanop::Ql_scanop()

Ql_variable_scanop::~Ql_variable_scanop (  ) 

Destruction of a variable scan operation


Member Function Documentation

int Ql_variable_scanop::evaluate (  )  [inline, virtual]

Dummy function - the evaluation is performed by scan_next and the result is stored

Implements Ql_scanop.

int Ql_variable_scanop::type_infer ( int *  error_code  )  [virtual]

Checks if the scan variable is defined on a valid collection. Assigns to the type of the variable scan operation, a copy of the type of the elements of the collection, which may include union types. Real types are determined by runtime type inference (see union_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

Implements Ql_data_scanop.

int Ql_variable_scanop::union_type_infer ( int *  error_code  ) 

Runtime type inference for variable scans. Determines the "real" types of the scan from the value of the domain of definition (schema or other variable scan operation). Updates the union types if a new type is encountered.

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_variable_scanop::scan_open (  )  [virtual]

Open a variable scan on the collection specified by the domain of definition of this scan variable. Perform runtime type inference before opening the scan, so that the real type of the scanned collection is determined in advance.

Returns:
OK (0) or error code

Implements Ql_data_scanop.

int Ql_variable_scanop::scan_next (  )  [virtual]

Get the next value of the scanned collection. Stores the value in the result of this scan operation.

Returns:
OK or SCAN_END, if the scan reached the end of the collection

Implements Ql_data_scanop.

void Ql_variable_scanop::scan_close (  )  [virtual]

Close an open static scan

Implements Ql_data_scanop.


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