IDL compiler front-end library
Public Types | Public Member Functions | List of all members
AST::Type Class Reference

An IDL type. More...

#include <Type.h>

Inheritance diagram for AST::Type:
AST::Array AST::Constant AST::Member AST::Operation AST::Sequence AST::TypeDef AST::ValueBox AST::Attribute AST::Parameter AST::StateMember AST::UnionElement

Public Types

enum class  Kind {
  VOID , BASIC_TYPE , NAMED_TYPE , STRING ,
  WSTRING , FIXED , SEQUENCE , ARRAY
}
 The kind of type. More...
 

Public Member Functions

Kind tkind () const noexcept
 
BasicType basic_type () const noexcept
 
const NamedItemnamed_type () const noexcept
 
Dim string_bound () const noexcept
 
Dim string_size () const noexcept
 Obsolete. Use Type::string_bound () instead.
 
const Sequencesequence () const noexcept
 
const Arrayarray () const noexcept
 
uint16_t fixed_digits () const noexcept
 
uint16_t fixed_scale () const noexcept
 
const Typedereference_type () const noexcept
 
 ~Type ()
 Destructor.
 
 Type ()
 Default constructor.
 
 Type (const Type &src)
 Copy constructor.
 
 Type (Type &&src) noexcept
 Move constructor.
 
Typeoperator= (const Type &src)
 Copy assignment.
 
Typeoperator= (Type &&src) noexcept
 Move assignment.
 
bool operator== (const Type &rhs) const noexcept
 Check types for equality.
 

Detailed Description

An IDL type.

Examples
Printer.cpp.

Definition at line 46 of file Type.h.

Member Enumeration Documentation

◆ Kind

enum AST::Type::Kind
strong

The kind of type.

Enumerator
VOID 

void

BASIC_TYPE 

Type::basic_type ();

NAMED_TYPE 

named_type ()

STRING 

string_bound ()

WSTRING 

string_bound ()

FIXED 

fixed_digits (), fixed_scale ()

SEQUENCE 

sequence ()

ARRAY 

array ()

Definition at line 50 of file Type.h.

Member Function Documentation

◆ tkind()

Kind AST::Type::tkind ( ) const
inlinenoexcept
Returns
The kind of type.

Definition at line 63 of file Type.h.

◆ basic_type()

BasicType AST::Type::basic_type ( ) const
inlinenoexcept
Returns
The BasicType.
Invariant
Type::tkind () == Kind::BASIC_TYPE.

Definition at line 70 of file Type.h.

◆ named_type()

const NamedItem& AST::Type::named_type ( ) const
inlinenoexcept
Returns
Reference to a named type.
Invariant
tkind () == Kind::NAMED_TYPE.

Definition at line 78 of file Type.h.

◆ string_bound()

Dim AST::Type::string_bound ( ) const
inlinenoexcept
Returns
The string size bound if string has limited size. If size is not limited, returns 0.
Invariant
tkind () == Kind::STRING || tkind () == Kind::WSTRING

Definition at line 87 of file Type.h.

◆ sequence()

const Sequence& AST::Type::sequence ( ) const
inlinenoexcept
Returns
The sequence descriptor.
Invariant
tkind () == Kind::SEQUENCE

Definition at line 101 of file Type.h.

◆ array()

const Array& AST::Type::array ( ) const
inlinenoexcept
Returns
The array descriptor.
Invariant
tkind () == Kind::ARRAY

Definition at line 109 of file Type.h.

◆ fixed_digits()

uint16_t AST::Type::fixed_digits ( ) const
inlinenoexcept
Returns
Number of digits for fixed type. If type is a part of constant definition, returns 0.
Invariant
tkind () == Kind::FIXED

Definition at line 120 of file Type.h.

◆ fixed_scale()

uint16_t AST::Type::fixed_scale ( ) const
inlinenoexcept
Returns
Scale for fixed type. If type is a part of constant definition, returns 0.
Invariant
tkind () == Kind::FIXED

Definition at line 129 of file Type.h.

◆ dereference_type()

const Type& AST::Type::dereference_type ( ) const
noexcept
Returns
The referenced type.

The documentation for this class was generated from the following file: