Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: question of subtypes and attributes

question of subtypes and attributes 11 Dec 2003 11:47 #6605

  • Antti Hyrkk
  • Antti Hyrkk's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 43
  • Karma: 0
Hello

What happens to the attributes when one subtypes a type?

For example, if I subtype the predefined type

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

type iso8859string Mystring;

Does MyString inherit the variant attribute from the parent type, or do I
have to write an own "{ variant "8 bit" };" for MyString, if I want it to be
encoded with the same attributes as its parent has.

Best Regards
Antti Hyrkkanen
The administrator has disabled public write access.

question of subtypes and attributes 11 Dec 2003 13:31 #6606

Hi,
Unfortunately not directly defined by the standard, so I can guess only (means
this is my personal opinion):
- any attribute has effect on the given language element only to which it is
applied; in this case the type definition of "iso8859string" ONLY
- "Mystring" is a type definition on its own (even if uses iso8859string as the
base type), hence attributes are not inherited. If you want "Mystring" also be
encoded as ISO 8859 string, you have to add the "8 bit" attribute to Mystring.
If attributes were inherited you would be in trouble if you wanted to encode
"Mystring" differently than "8 bit"; in this case overwriting rules should be
defined for such cases that would complicate the language unnecessarily;
- because you can easily force attributes to apply to several definitions by
grouping (or isolate them into a separate module etc.):
group ISOstrings {
type universal charstring iso8859string
( char ( 0,0,0,0 ) .. char ( 0,0,0,255) );
type iso8859string Mystring
} with { variant "8 bit" }

Gyorgy

>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.]On Behalf Of Antti Hyrkkanen
> Sent: Thursday, December 11, 2003 12:47 PM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: question of subtypes and attributes
>
>
> Hello
>
> What happens to the attributes when one subtypes a type?
>
> For example, if I subtype the predefined type
>
> type universal charstring iso8859string
> ( char ( 0,0,0,0 ) .. char ( 0,0,0,255) ) with { variant "8 bit"
> };
>
> type iso8859string Mystring;
>
> Does MyString inherit the variant attribute from the parent type, or
> do I have to write an own "{ variant "8 bit" };" for MyString, if I
> want it to be encoded with the same attributes as its parent has.
>
> Best Regards
> Antti Hyrkkanen
>
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin