Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Implementing components in C++
Implementing components in C++ [message #1829406] Thu, 02 July 2020 21:33 Go to next message
Harald Welte is currently offline Harald WelteFriend
Messages: 128
Registered: July 2017
Location: Berlin, Germany
Senior Member

Dear TITAN community,

So far, I have implemente dozens of TTCN3 modules for titan, ranging from dualf-faced portsto to test ports implemented in C++ to translation ports, etc. I've also used native C++functions from TTCN3.

Right now I'm wondering how it would be possible to implement an entire component in C++.

The rationale is, in this case:
* I have an underlying test port to interface some type of hardware (An E1 interface card)
* I have higher-level TTCN3 components and test caess
* I have a C language implementation of the missing layer in the midle (LAPD)

And now I would want to wrap the C-language LAPD implementation into some c++ classes so it can act as a TTCN3 component in titan. It would basically have a test port on the bottom side (towards the E1 test port) and one on the upper side.

Are there any examples around whcih cover this?

Thanks in advance.
Re: Implementing components in C++ [message #1829445 is a reply to message #1829406] Fri, 03 July 2020 15:59 Go to previous message
Kristof Szabados is currently offline Kristof SzabadosFriend
Messages: 57
Registered: July 2015
Member
Hi Harald,

As the code for TTCN-3 components is generated you will not be able to have your own implementation (or if you try to edit the generated code it will be overwritten).

Reading your actual issue it is not clear if you need to have your own component implementation.

If you have a component with those 2 ports you described.
You could start a function on it, that is able receive messages on both ports.
When a message is received on one, you call an external function that invokes your middle functionalities in C/C++ code ... and sends out the result on the other port.

If you need to store some stateful information, you could still use an external function that stores the information in a C/C++ static variable.
Your external functions could read/write that object.
In this case you have to make sure to have functions for initializing/destroying the external storage and call them in the proper order from your code.

Best Regards
Kristof
Previous Topic:Relaxing the C/C++ compiler version check for Titan 7.1.1
Next Topic:Encode FIELDORDER Attribute over b8 type
Goto Forum:
  


Current Time: Mon Jun 14 07:25:03 GMT 2021

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

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

Back to the top