Ql_type Class Reference

#include <rql_type.hxx>

Inherits node.

Inheritance diagram for Ql_type:

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

Public Member Functions

 Ql_type ()
 Ql_type (Ql_kind k)
 ~Ql_type ()
TypeList * type ()
void type (TypeList *t)
int equals (node *t)
int equals (Ql_type *t)
int is_compatible_col_notU (Ql_type *t)
int is_compatible_notU (Ql_type *t)
int is_compatible_col (Ql_type *t)
int is_compatible (Ql_type *t)
Ql_type * duplicate ()
int contains (Ql_type *t)
int is_smaller_union_type (Ql_type *t)
Ql_type * type_union (Ql_type *t)
Ql_type * simple_type_union (Ql_type *t)
Ql_type * type_intersect (Ql_type *t)
Ql_type * simple_type_intersect (Ql_type *t)

Public Attributes

int ctype_id

Detailed Description

A class representing the type of an operation, i.e. its kind and possibly the type of members (if it is a collection or union type)

Author:
Grigoris Karvounarakis
Version:
1.0


Constructor & Destructor Documentation

Ql_type::Ql_type (  ) 

"Default" constructor

Ql_type::Ql_type ( Ql_kind  k  ) 

Constructor that sets the kind to k

Ql_type::~Ql_type (  ) 

Destructor that also frees the list of types of members, in the case of collections or union types


Member Function Documentation

TypeList * Ql_type::type (  ) 

Returns:
the list of types of members of this collection or NULL

void Ql_type::type ( TypeList *  t  ) 

Set the list of types of members of this collection to t

int Ql_type::equals ( node *  t  )  [virtual]

Returns:
true (1) if both objects have the same kind, false (0) otherwise

Implements node.

int Ql_type::equals ( Ql_type *  t  ) 

Compares t with "this" according to their kind and the types of their members, if complex types or union types. Note that i.e. a bag of resources is considered equal to a class, a bag of classes equal to a metaclass, a bag of thesaurus terms equal to a thesaurus, a binary bag equal to a property, if member types are equal, etc.

int Ql_type::is_compatible_col_notU ( Ql_type *  t  ) 

Function that checks if a collection is compatible with "this".

Returns:
true (1) if both t and "this" are collections of the same arity and with same types (without coercing for union types), false (0) otherwise.

int Ql_type::is_compatible_notU ( Ql_type *  t  ) 

Recursive function that checks if two types are compatible, i.e. have the same kind and same types for their members, if a complex type

Returns:
true (1) if types are compatible, false (0) if any of the types is a union type or types are not compatible

int Ql_type::is_compatible_col ( Ql_type *  t  ) 

Function that checks if a collection is compatible with "this".

Returns:
true (1) if both t and "this" are collections of the same arity and with same types (coercing for union types), false (0) otherwise.

int Ql_type::is_compatible ( Ql_type *  t  ) 

Recursive function that checks if two types are compatible, i.e. have the same kind and same types for their members, if a complex type, or are compatible/coercible union types, if at least one of them is a union type

Returns:
true (1) if types are compatible, false (0) if any of the types is a union type or types are not compatible

Ql_type * Ql_type::duplicate (  ) 

Creates an exact copy of this type object, also copying the list of member types if any

int Ql_type::contains ( Ql_type *  t  ) 

Checks if the given type is the type of a member of "this" type object, if it is a complex type or collection

int Ql_type::is_smaller_union_type ( Ql_type *  t  ) 

Checks if "this" is a smaller union type than the given type, i.e. is a simple type contained in the given union type or is also a union type, whose variants are all contained in the given union type

Ql_type * Ql_type::type_union ( Ql_type *  t  ) 

Recursive function that returns the type created by the union of "this" and the given type, if a complex type. Calls simple_union_type, if at least one of the types is a simple type

See also:
simple_type_union(Ql_type *)

Ql_type * Ql_type::simple_type_union ( Ql_type *  t  ) 

Function that returns the type created by the union of "this" and the given type

See also:
simple_type_union(Ql_type *)

Ql_type * Ql_type::type_intersect ( Ql_type *  t  ) 

Recursive function returning the type of the intersection of "this" with the given type t, if they are complex types. Uses simple_type_intersect for simple types

See also:
simple_type_intersect(Ql_type *)

Ql_type * Ql_type::simple_type_intersect ( Ql_type *  t  ) 

Function that returns the type created by the intersection of "this" and the given type, without creating duplicates. Note that if the intersection of two union types (or one union type with a simple type) results in a union type with only one variant, it can be coerced to that simple type later

See also:
simple_type_union(Ql_type *)

Ql_baseop2::Uset_intersect()


Member Data Documentation

int Ql_type::ctype_id

An identifier for the case that "this" corresponds to a complex type (e.g. sequence or bag) that has been stored in the DB.


The documentation for this class was generated from the following files:
Generated on Thu Oct 26 17:13:05 2006 for rql by  doxygen 1.5.0