OpenTTCN/Knowledge base/IDL to TTCN-3 mapping explained/UsefulTypes.ttcn

From OpenTTCN

Jump to: navigation, search
/**
 *
 * ETSI ES 201 873-1 V3.2.1 (2007-02)
 *
 * Annex D (informative): Library of Useful Types
 *
 * D.1 Limitations
 *
 * Names of types added to this library should be unique within the whole
 * language and within the library (i.e. should not be one of the names
 * defined in annex C. Names defined in this library should not be used by
 * TTCN-3 users as identifiers of other definitions than given in this annex.
 * NOTE: Therefore type definitions given in this annex may be repeated in
 * TTCN-3 modules but no type distinct from the one specified in this annex
 * can be defined with one of the identifiers used in this annex.
 */

module UsefulTypes {

// D.2 Useful TTCN-3 types

// D.2.1 Useful simple basic types

// D.2.1.0 Signed and unsigned single byte integers

type integer byte (-128 .. 127) with { variant "8 bit" };
type integer unsignedbyte (0 .. 255) with { variant "unsigned 8 bit" };


// D.2.1.1 Signed and unsigned short integers

type integer short (-32768 .. 32767) with { variant "16 bit" };
type integer unsignedshort (0 .. 65535) with { variant "unsigned 16 bit" };


// D.2.1.2 Signed and unsigned long integers

type integer long (-2147483648 .. 2147483647) with { variant "32 bit" };
type integer unsignedlong (0 .. 4294967295) with { variant "unsigned 32 bit" };


// D.2.1.3 Signed and unsigned longlong integers

type integer longlong (-9223372036854775808 .. 9223372036854775807) with { variant "64 bit" };

type integer unsignedlonglong (0 .. infinity)
/* (0 .. 18446744073709551615) */ with { variant "unsigned 64 bit" };


// D.2.1.4 IEEE 754 floats

type float IEEE754float with { variant "IEEE754 float" };
type float IEEE754double with { variant "IEEE754 double" };
type float IEEE754extfloat with { variant "IEEE754 extended float" };
type float IEEE754extdouble with { variant "IEEE754 extended double" };


// D.2.2 Useful character string types

// D.2.2.0 UTF-8 character string "utf8string"

type universal charstring utf8string with { variant "UTF-8" };


// D.2.2.1 BMP character string "bmpstring"

type universal charstring bmpstring ( char ( 0,0,0,0 ) .. char ( 0,0,255,255) )
with { variant "UCS-2" };


// D.2.2.2 UTF-16 character string "utf16string"

type universal charstring utf16string ( char ( 0,0,0,0 ) .. char ( 0,16,255,255) )
with { variant "UTF-16" };


// D.2.2.3 ISO/IEC 8859 character string "iso8859string"

type universal charstring iso8859string ( char ( 0,0,0,0 ) .. char ( 0,0,0,255) )
with { variant "8 bit" };


// D.2.3 Useful structured types

// D.2.3.0 Fixed-point decimal literal

type record IDLfixed {

    unsignedshort digits,
    short scale,
    charstring value_
}
with { variant "IDL:fixed FORMAL/01-12-01 v.2.6" };


// D.2.4 Useful atomic string types

// D.2.4.1 Single ISO 646 character type

// buitin in ETSI ES 201 873-1 Ed. 2
// type charstring char length (1);


// D.2.4.2 Single universal character type

type universal charstring uchar length (1);


// D.2.4.3 Single bit type

type bitstring bit length (1);


// D.2.4.4 Single hex type

type hexstring hex length (1);


// D.2.4.5 Single octet type

type octetstring octet length (1);

}
Views
Personal tools