DiaDes  0.1
DIAgnosisofDiscrete-EventSystem
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
Diades::Altarica::Type Class Reference

#include <Type.hh>

Public Types

enum  Template {
  NullTemplate, BoolType, IntType, IdentType,
  StructType, ArrayType
}
 
typedef Utils::Exception< TypeException
 
typedef reference_wrapper< TypeReference
 
typedef reference_wrapper< Type const > ConstReference
 
typedef vector< ConstReferenceArrayFields
 
typedef map< Identifier, ConstReferenceStructureFields
 

Public Member Functions

 Type (TypeFactory &factory)
 
 ~Type ()
 
bool operator== (const Type &type) const
 
bool operator!= (const Type &type) const
 
bool operator< (const Type &type) const
 
bool isNull () const
 
const string & label () const
 
bool isComposed () const
 
bool isBasic () const
 
bool isInteger () const
 
bool isBoolean () const
 
bool isIdentifier () const
 
bool isArray () const
 
bool isStructure () const
 
Template typeTemplate () const
 
const AltaricaModelowner () const
 

Static Public Member Functions

static string typeName ()
 

Private Member Functions

 Type (const string &label, unsigned code, TypeFactory &factory)
 
 Type (const string &label, const ArrayFields &fields, unsigned code, TypeFactory &factory)
 
 Type (const string &label, const StructureFields &fields, unsigned code, TypeFactory &factory)
 

Private Attributes

Template _template
 
string _internalLabel
 
unsigned _code
 
TypeFactory_factory
 
ArrayFields _array
 
StructureFields _structure
 

Static Private Attributes

static string notAltaricaType
 

Friends

class TypeFactory
 
ostream & operator<< (ostream &os, const Type &type)
 

Detailed Description

Type of a Value in the Altarica Model

Definition at line 47 of file Type.hh.

Member Typedef Documentation

◆ ArrayFields

Definition at line 63 of file Type.hh.

◆ ConstReference

typedef reference_wrapper<Type const> Diades::Altarica::Type::ConstReference

Definition at line 62 of file Type.hh.

◆ Exception

Definition at line 60 of file Type.hh.

◆ Reference

typedef reference_wrapper<Type> Diades::Altarica::Type::Reference

Definition at line 61 of file Type.hh.

◆ StructureFields

Definition at line 64 of file Type.hh.

Member Enumeration Documentation

◆ Template

Enumerator
NullTemplate 
BoolType 
IntType 
IdentType 
StructType 
ArrayType 

Definition at line 57 of file Type.hh.

Constructor & Destructor Documentation

◆ Type() [1/4]

Diades::Altarica::Type::Type ( const string &  label,
unsigned  code,
TypeFactory factory 
)
private

◆ Type() [2/4]

Diades::Altarica::Type::Type ( const string &  label,
const ArrayFields fields,
unsigned  code,
TypeFactory factory 
)
private

◆ Type() [3/4]

Diades::Altarica::Type::Type ( const string &  label,
const StructureFields fields,
unsigned  code,
TypeFactory factory 
)
private

◆ Type() [4/4]

Diades::Altarica::Type::Type ( TypeFactory factory)
inline

Default constructor

Definition at line 84 of file Type.hh.

◆ ~Type()

Diades::Altarica::Type::~Type ( )
inline

Destructor

Definition at line 90 of file Type.hh.

Member Function Documentation

◆ isArray()

bool Diades::Altarica::Type::isArray ( ) const
inline
Returns
true if the type is an array

Definition at line 180 of file Type.hh.

References always_require.

Referenced by BOOST_AUTO_TEST_CASE(), and Diades::Altarica::VariableDecl::isArray().

◆ isBasic()

bool Diades::Altarica::Type::isBasic ( ) const
inline
Returns
true if the type is basic (either a boolean, an integer or a identifier)

Definition at line 142 of file Type.hh.

References always_require.

Referenced by BOOST_AUTO_TEST_CASE(), and Diades::Altarica::VariableDecl::isSimple().

◆ isBoolean()

bool Diades::Altarica::Type::isBoolean ( ) const
inline
Returns
true if the type is a boolean

Definition at line 162 of file Type.hh.

References always_require.

Referenced by BOOST_AUTO_TEST_CASE(), and Diades::Altarica::BooleanDomain::find().

◆ isComposed()

bool Diades::Altarica::Type::isComposed ( ) const
inline
Returns
true if the type is composed (either a structure or an array)

Definition at line 132 of file Type.hh.

References always_require.

Referenced by BOOST_AUTO_TEST_CASE().

◆ isIdentifier()

bool Diades::Altarica::Type::isIdentifier ( ) const
inline
Returns
true if the type is an identifier

Definition at line 171 of file Type.hh.

References always_require.

Referenced by BOOST_AUTO_TEST_CASE().

◆ isInteger()

bool Diades::Altarica::Type::isInteger ( ) const
inline
Returns
true if the type is an integer

Definition at line 152 of file Type.hh.

References always_require.

Referenced by BOOST_AUTO_TEST_CASE(), Diades::Altarica::RangeDomain::find(), and Diades::Altarica::IntegerDomain::find().

◆ isNull()

bool Diades::Altarica::Type::isNull ( ) const

◆ isStructure()

bool Diades::Altarica::Type::isStructure ( ) const
inline
Returns
true if the type is a structure

Definition at line 189 of file Type.hh.

References always_require.

Referenced by BOOST_AUTO_TEST_CASE(), and Diades::Altarica::VariableDecl::isStructure().

◆ label()

const string& Diades::Altarica::Type::label ( ) const
inline
Returns
the label of the type

Definition at line 124 of file Type.hh.

References always_require.

Referenced by BOOST_AUTO_TEST_CASE().

◆ operator!=()

bool Diades::Altarica::Type::operator!= ( const Type type) const
inline

Difference operator

Parameters
typeto compare with
Returns
true if both types are the same

Definition at line 105 of file Type.hh.

◆ operator<()

bool Diades::Altarica::Type::operator< ( const Type type) const

Comparision operator

Parameters
typeto compare with
Returns
true the current type is smaller than type. The defined order is machine independent but has no semantics.

◆ operator==()

bool Diades::Altarica::Type::operator== ( const Type type) const
inline

Equality operator (reference)

Parameters
typeto compare with
Returns
true if both types are the same

Definition at line 97 of file Type.hh.

◆ owner()

const AltaricaModel& Diades::Altarica::Type::owner ( ) const
Todo:
test

◆ typeName()

static string Diades::Altarica::Type::typeName ( )
inlinestatic

Definition at line 59 of file Type.hh.

◆ typeTemplate()

Template Diades::Altarica::Type::typeTemplate ( ) const
inline
Returns
the template of the type

Definition at line 199 of file Type.hh.

References always_require.

Referenced by BOOST_AUTO_TEST_CASE().

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  os,
const Type type 
)
friend

Definition at line 204 of file Type.hh.

◆ TypeFactory

friend class TypeFactory
friend

Definition at line 80 of file Type.hh.

Member Data Documentation

◆ _array

ArrayFields Diades::Altarica::Type::_array
private

Definition at line 72 of file Type.hh.

◆ _code

unsigned Diades::Altarica::Type::_code
private

Definition at line 70 of file Type.hh.

◆ _factory

TypeFactory& Diades::Altarica::Type::_factory
private

Definition at line 71 of file Type.hh.

◆ _internalLabel

string Diades::Altarica::Type::_internalLabel
private

Definition at line 69 of file Type.hh.

◆ _structure

StructureFields Diades::Altarica::Type::_structure
private

Definition at line 73 of file Type.hh.

◆ _template

Template Diades::Altarica::Type::_template
private

Definition at line 68 of file Type.hh.

◆ notAltaricaType

string Diades::Altarica::Type::notAltaricaType
staticprivate

Definition at line 67 of file Type.hh.


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