How to map param with template variable?
The code base I am using uses templates to initialise a component variable used to map a param for a port. Not sure how I can do this in Titan. Example below.
I get "Reference to a value was expected instead of template variable `@MyExample.MTCType.vc_pp' MyExample.ttcn /Test/src line 30"
I understand why this is happening, but need suggestions on how I can achieve this behavior. I can change the variable vc_pp to be non template, but then the error happens when using the template to assign to the non template variable.
`// TTCN-3 version of "Hello, world!" module MyExample {
type record PortParam { charstring ipAddr, integer port_ }
type port PCOType message { map param(PortParam prm); inout charstring; }
type component MTCType { var template PortParam vc_pp; port PCOType MyPCO_PT; }
template PortParam m_params1 := { ipAddr := "local", port_ := 12345 }
testcase tc_HelloW() runs on MTCType system MTCType { vc_pp := m_params1; map(mtc:MyPCO_PT, system:MyPCO_PT) param (vc_pp); MyPCO_PT.send("Hello, world!"); setverdict(pass); }
control { execute(tc_HelloW()); } } `