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

UTAP::type_t Class Reference

A reference to a type. More...

#include <symbols.h>

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.
type_t getReturnType ()
 Returns the return-type of a function.
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.
type_t getArraySize () const
 Returns the size of an array.
std::pair< expression_t, expression_tgetRange () const
 Returns the range of an integer type.
std::string toString ()
 Print type to the given output stream.
bool isInteger () const
 Returns true if this is an integer.
bool isValue () const
 Returns true if this is a boolean or integer.
bool isScalar () const
 Returns true if this is a scalar or integer.
bool isClock () const
 Returns true if this is a clock.
bool isRecord () const
 Returns true if this is a record.
bool isDiff () const
 Returns true if this is a clock difference.
bool isVoid () const
 Returns true if this is a void.
bool isInvariant () const
bool isGuard () const
bool isConstraint () const
bool isArray () const

Static Public Member Functions

static type_t createInteger (expression_t, expression_t)
 Creates and returns a new integer type with the given range.
static type_t createScalarSet (expression_t, expression_t)
 Create and returns a new scalar set type of the given size.
static type_t createRecord (frame_t)
 Creates and returns a new record type.
static type_t createFunction (frame_t, type_t)
 Creates and returns a new function type.
static type_t createArray (type_t, type_t)
 Creates and returns a new array type.
static type_t createTypeName (type_t)
 Creates and returns a new named type.
static type_t createTemplate (frame_t)
 Creates and returns a new template type.
static type_t createProcess (frame_t)
 Creates and returns a new process type.
static type_t createBase ()
 Create a new primitive type.

Static Public Attributes

static type_t UNKNOWN
static type_t VOID_TYPE
static type_t CLOCK
static type_t INT
static type_t BOOL
static type_t SCALAR
static type_t LOCATION
static type_t CHANNEL
static type_t TEMPLATE
static type_t INSTANCE
static type_t FUNCTION
static type_t ARRAY
static type_t RECORD
static type_t PROCESS
static type_t NTYPE
static type_t INVARIANT
static type_t INVARIANT_WR
static type_t GUARD
static type_t DIFF
static type_t CONSTRAINT
static type_t COST
static type_t RATE


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

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

Creates and returns a new array type.

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

Create a new primitive type.

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

Creates and returns a new function type.

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

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

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

Creates and returns a new process type.

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

Creates and returns a new record type.

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

Create and returns a new scalar set type of the given size.

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

Creates and returns a new template type.

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

Creates and returns a new named type.

type_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::getReturnType  ) 
 

Returns the return-type of a function.

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::isArray  )  const [inline]
 

bool UTAP::type_t::isClock  )  const [inline]
 

Returns true if this is a clock.

bool UTAP::type_t::isConstraint  )  const [inline]
 

bool UTAP::type_t::isDiff  )  const [inline]
 

Returns true if this is a clock difference.

bool UTAP::type_t::isGuard  )  const [inline]
 

bool UTAP::type_t::isInteger  )  const [inline]
 

Returns true if this is an integer.

bool UTAP::type_t::isInvariant  )  const [inline]
 

bool UTAP::type_t::isRecord  )  const [inline]
 

Returns true if this is a record.

bool UTAP::type_t::isScalar  )  const [inline]
 

Returns true if this is a scalar or integer.

bool UTAP::type_t::isValue  )  const [inline]
 

Returns true if this is a boolean or integer.

bool UTAP::type_t::isVoid  )  const [inline]
 

Returns true if this is a void.

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.

std::string UTAP::type_t::toString  ) 
 

Print type to the given output stream.


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::COST [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::INVARIANT_WR [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::RATE [static]
 

type_t UTAP::type_t::RECORD [static]
 

type_t UTAP::type_t::SCALAR [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 Thu Nov 10 13:16:13 2005 for libutap by  doxygen 1.4.2