Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

UTAP::type_t Class Reference

A reference to a type. More...

#include <symbols.hh>

List of all members.

Public Member Functions

 type_t ()
 Default constructor.

 type_t (const type_t &)
 Copy constructor.

 ~type_t ()
 Destructor.

const type_toperator= (const type_t &)
 Assignment operator.

bool operator== (const type_t &) const
 Equality operator.

bool operator!= (const type_t &) const
 Inequality operator.

type_t getBase () const
 Returns the base type of this frame.

frame_t getRecordFields () const
 Returns the fields of a record type.

frame_t getParameters () const
 Returns the parameters of a function or template type.

frame_t getFrame () const
 Polymorphic version of getRecordFields() and getParameters().

type_t getSub ()
 Returns the sub-type of this type.

bool hasPrefix (prefix::prefix_t) const
 Returns the true if this type has the given prefix.

type_t setPrefix (bool set, prefix::prefix_t) const
 Sets or clears a prefix.

expression_t getArraySize () const
 Returns the size of an array.

std::pair< expression_t, expression_tgetRange () const
 Returns the range of an integer type.


Static Public Member Functions

type_t createInteger (expression_t, expression_t)
 Creates and returns a new integer type with the given range.

type_t createRecord (frame_t)
 Creates and returns a new record type.

type_t createFunction (frame_t, type_t)
 Creates and returns a new function type.

type_t createArray (expression_t, type_t)
 Creates and returns a new array type.

type_t createTypeName (type_t)
 Creates and returns a new named type.

type_t createTemplate (frame_t)
 Creates and returns a new template type.

type_t createProcess (frame_t)
 Creates and returns a new process type.

type_t createBase ()
 Create a new primitive type.


Static Public Attributes

type_t UNKNOWN
type_t VOID_TYPE
type_t CLOCK
type_t INT
type_t BOOL
type_t LOCATION
type_t CHANNEL
type_t TEMPLATE
type_t INSTANCE
type_t FUNCTION
type_t ARRAY
type_t RECORD
type_t PROCESS
type_t NTYPE
type_t INVARIANT
type_t GUARD
type_t DIFF
type_t CONSTRAINT


Detailed Description

A reference to a type.

Types are represented as type objects. Type objects cannot be access directly. You need to use an instance of type_t to access a type object. Internally, type objects are reference counted and do not need to be deallocated manually.

Types are either primitive such as clocks or channels, or contructed types such as structs and array. Primitive types are allocated statically and can be accessed via the static member fields of the type_t class. Constructed types are created using one of the static factory methods in the type_t class.

All types have a base type. For primitive types, the base type is the type itself. For constructed types, the base type indicates the type constructor (i.e. if this is an array, record, etc.). In addition, all types can have a number of prefixes, such as URGENT, COMMITTED, CONSTANT, BROADCAST, and REFERENCE.

Constructed types can have other fields: Integers have a range, arrays have a size and a sub-type, records have fields, functions have parameters and a return type (the sub-type), templates have parameters, and named types have a sub-type.


Constructor & Destructor Documentation

UTAP::type_t::type_t  ) 
 

Default constructor.

UTAP::type_t::type_t const type_t  ) 
 

Copy constructor.

UTAP::type_t::~type_t  ) 
 

Destructor.


Member Function Documentation

type_t UTAP::type_t::createArray expression_t  ,
type_t 
[static]
 

Creates and returns a new array type.

type_t UTAP::type_t::createBase  )  [static]
 

Create a new primitive type.

type_t UTAP::type_t::createFunction frame_t  ,
type_t 
[static]
 

Creates and returns a new function type.

type_t UTAP::type_t::createInteger expression_t  ,
expression_t 
[static]
 

Creates and returns a new integer type with the given range.

type_t UTAP::type_t::createProcess frame_t   )  [static]
 

Creates and returns a new process type.

type_t UTAP::type_t::createRecord frame_t   )  [static]
 

Creates and returns a new record type.

type_t UTAP::type_t::createTemplate frame_t   )  [static]
 

Creates and returns a new template type.

type_t UTAP::type_t::createTypeName type_t   )  [static]
 

Creates and returns a new named type.

expression_t UTAP::type_t::getArraySize  )  const
 

Returns the size of an array.

type_t UTAP::type_t::getBase  )  const
 

Returns the base type of this frame.

frame_t UTAP::type_t::getFrame  )  const
 

Polymorphic version of getRecordFields() and getParameters().

frame_t UTAP::type_t::getParameters  )  const
 

Returns the parameters of a function or template type.

std::pair<expression_t, expression_t> UTAP::type_t::getRange  )  const
 

Returns the range of an integer type.

frame_t UTAP::type_t::getRecordFields  )  const
 

Returns the fields of a record type.

type_t UTAP::type_t::getSub  ) 
 

Returns the sub-type of this type.

bool UTAP::type_t::hasPrefix prefix::prefix_t   )  const
 

Returns the true if this type has the given prefix.

bool UTAP::type_t::operator!= const type_t  )  const
 

Inequality operator.

const type_t& UTAP::type_t::operator= const type_t  ) 
 

Assignment operator.

bool UTAP::type_t::operator== const type_t  )  const
 

Equality operator.

type_t UTAP::type_t::setPrefix bool  set,
prefix::prefix_t 
const
 

Sets or clears a prefix.


Member Data Documentation

type_t UTAP::type_t::ARRAY [static]
 

type_t UTAP::type_t::BOOL [static]
 

type_t UTAP::type_t::CHANNEL [static]
 

type_t UTAP::type_t::CLOCK [static]
 

type_t UTAP::type_t::CONSTRAINT [static]
 

type_t UTAP::type_t::DIFF [static]
 

type_t UTAP::type_t::FUNCTION [static]
 

type_t UTAP::type_t::GUARD [static]
 

type_t UTAP::type_t::INSTANCE [static]
 

type_t UTAP::type_t::INT [static]
 

type_t UTAP::type_t::INVARIANT [static]
 

type_t UTAP::type_t::LOCATION [static]
 

type_t UTAP::type_t::NTYPE [static]
 

type_t UTAP::type_t::PROCESS [static]
 

type_t UTAP::type_t::RECORD [static]
 

type_t UTAP::type_t::TEMPLATE [static]
 

type_t UTAP::type_t::UNKNOWN [static]
 

type_t UTAP::type_t::VOID_TYPE [static]
 


The documentation for this class was generated from the following file:
Generated on Sat May 15 12:33:43 2004 for libutap by doxygen 1.3.7