Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Support of types with parameters(Does parameterization supported by titan.core code generation ?)
Support of types with parameters [message #1796387] Fri, 12 October 2018 08:41 Go to next message
Viktor Tarasov is currently offline Viktor TarasovFriend
Messages: 8
Registered: August 2018
Junior Member
Hello,

does code can be generated for the types with parameters?

In EtsiTs103097Module ASN1 module there something like this:
EtsiTs103097Data-Signed {ToBeSignedDataContent} ::= EtsiTs103097Data (WITH COMPONENTS  ...

and I do not see the code generated for this type in *.cc and *.hh files.

Am I missing something?

Kind regards,

Re: Support of types with parameters [message #1796391 is a reply to message #1796387] Fri, 12 October 2018 09:48 Go to previous messageGo to next message
Kristof Szabados is currently offline Kristof SzabadosFriend
Messages: 54
Registered: July 2015
Member
Hi Viktor,

You are right, we do not generate code for parameterised types.

Instead we generate code in the place where it is used, and it's parameter is already known.

Best Regards
Kristof
Re: Support of types with parameters [message #1796397 is a reply to message #1796391] Fri, 12 October 2018 10:49 Go to previous messageGo to next message
Kristof Szabados is currently offline Kristof SzabadosFriend
Messages: 54
Registered: July 2015
Member
For example if you have ASN.1 code like this:
My-Parameterized-Sequence {Param} ::= SEQUENCE {
    field1 Param,
    field2 INTEGER,
    field3 INTEGER OPTIONAL
}

SomethingINTEGER ::= My-Parameterized-Sequence{INTEGER}

SomethingREAL::= My-Parameterized-Sequence{REAL}



There will be no code generated directly for My-Parameterized-Sequence.
Instead we will calculate the 2 instantiation of the type, where the parameter is already filled in and the types generated for the Something... types will be typedefs of these instantiated type.

The "Somethings":
typedef _root_Min_My__Parameterized__Sequence_Min_inst1 SomethingINTEGER;
typedef _root_Min_My__Parameterized__Sequence_Min_inst1_template SomethingINTEGER_template;
typedef _root_Min_My__Parameterized__Sequence_Min_inst2 SomethingREAL;
typedef _root_Min_My__Parameterized__Sequence_Min_inst2_template SomethingREAL_template;


And for example the code generated for the first instantiation starts like this:
class _root_Min_My__Parameterized__Sequence_Min_inst1 : public Record_Type {
  INTEGER field_field1;
  INTEGER field_field2;
  OPTIONAL<INTEGER> field_field3;
...

Re: Support of types with parameters [message #1796403 is a reply to message #1796397] Fri, 12 October 2018 12:32 Go to previous message
Viktor Tarasov is currently offline Viktor TarasovFriend
Messages: 8
Registered: August 2018
Junior Member
Ok, I see,
thank You.
Previous Topic:Change value of module parameters during tests execution.
Next Topic:Manual build on Eclipse
Goto Forum:
  


Current Time: Sun Jul 12 14:14:00 GMT 2020

Powered by FUDForum. Page generated in 0.02008 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top