Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Support for anytype
Support for anytype [message #1721708] Fri, 29 January 2016 11:22 Go to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi,

I'm getting the following error:
error: Reference to non-existent field `RESET_PDU' in union template for type `@RLC_wk37.anytype'


for the following template:
template RLC_TR_TestDataInd car_ResetInd(template SS_RB_Identity p_RB_Id, template RESET_PDU p_Reset) := 
    {
        cellId := tsc_CellDedicated,
        rB_Id := p_RB_Id,
        data := {RESET_PDU := p_Reset}
    }
    with
    {
        optional "implicit omit"
    }


The definition of the type RLC_TR_TestDataInd and other types are:
    type anytype PDU;

        type record RESET_PDU
    {
        DC_Field dC_Field optional,
        CtrlPDU_Type type_ optional,
        RSN rsn optional,
        bitstring reserved length (3) optional,
        HFNI hfni optional,
        Padding padding optional
    }

    type record RLC_TR_TestDataInd
    {
        integer cellId optional,
        SS_RB_Identity rB_Id optional,
        PDU data optional
    }


The TTCN-3 spec says,
Quote:
The special type anytype is defined as a shorthand for the union of all known data types and the address type in a
TTCN-3 module.


So this should not give error, right?
Is the data type `anytype` not supported by Titan or is there something wrong with the ttcn script?

Thanks
Murli

[Updated on: Fri, 29 January 2016 11:23]

Report message to a moderator

Re: Support for anytype [message #1721710 is a reply to message #1721708] Fri, 29 January 2016 11:37 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,

anytype is supported but with a slightly different syntax, see ch 4.3 of the reference guide:

"For performance reasons, Titan only generates this code if a variable of anytype is declared or used, and does not create fields in the anytype for all data types. Instead, the user has to specify which types are needed as anytype fields with an extension attribute at module scope."

See also the example in the reference guide and also the attached example.

Essential is that the types we want to see in anytype have to be listed at the end of the module:

module something {
:
:
}

with {
extension "anytype integer, charstring" // adds two fields
extension "anytype MyRec" // adds a third field
extension "anytype money" // adds the local money type
extension "anytype greeting" // adds the imported type
}






I hope this helps


Best regards

Elemer
Re: Support for anytype [message #1726642 is a reply to message #1721710] Tue, 15 March 2016 10:44 Go to previous messageGo to next message
Naum Spaseski is currently offline Naum SpaseskiFriend
Messages: 81
Registered: February 2016
Location: Sophia Antipolis
Member

Hello Elemer,

I have a quick question regarding the "anytype" problem: Does TITAN has plans to overcome this change in the syntax (or support it as alternative) and to conform to the TTCN-3 specs anytime soon?

Thanks in advance.

Best regards,
Naum.
Re: Support for anytype [message #1726649 is a reply to message #1726642] Tue, 15 March 2016 11:04 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Naum,

we have no such plan; run-time processing of an all-comprehensive anytype (versus the solution proposed by us)
takes too much toll on resources and slows down execution to a degree we thought unacceptable.
One usage of Titan we always had in mind while adding features was that of a load generator; it may not be apparent, but
the most important application area of Titan today within our company is performance testing.

Best regards

Elemer

Previous Topic:TTCN-3 and JSON encoding part 1
Next Topic:Order of members of type in a template
Goto Forum:
  


Current Time: Fri Apr 26 07:23:04 GMT 2024

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

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

Back to the top