SDL-News: Further reply on data transfer


Subject: SDL-News: Further reply on data transfer
From: Rick Reed TSE (rickreed#tseng.co.uk)
Date: Fri Oct 12 2001 - 11:07:57 GMT


Become an SDL Forum Society member <http://www.sdl-forum.org/Society/members.htm>
The originator of this message is responsible for its content.
-----From Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews -----

Dear Mr Zhang,

Another reply was sent to sdlnews from Giridhar.Nag#ubinetics.co.in, but was
BOUNCED due to filtering (to prevent too much junk mail).

One remark on this reply:

the "!" operator does a field selection, and I do not understand how it can
be converted "->" in C instead, but perhaps this is documented in the Tau
documentation.

Rick Reed

------------------
From: Giridhar.Nag#ubinetics.co.in
Hi Zhang!

If you are looking at passing data from one SDL process to
another (Possibly as parameters of signals) without actually
copying any data, as Rick has indicated, there aren't many
options. But since you say that you are using Telelogic Tau
I think there is a way (I assume a version that is at least
3.4 though I find not many reasons as to why this should not
be supported even earlier),

Tau has abstract data types which allows you to create new
data structures and define operators on them. There also are
provisions for giving directives to the code generators so
as to specify the "way" operators in SDL should be mapped
into C language code. Suppose you have a newtype struct in
SDL, it would be translated into a C structure by the code
generator and the "!" is converted into the "." in C.

If however, you do not want this, say you want a pointer to
structure (i.e. the SDL operator "!" should be translated to
the dereferencing operator in C i.e. "->") then you will then
have to use the directives of ##ADT() so that you can define
your own SDL to C conversion). You will have to define the
yRead_<sort>, yWri_<sort> and similar functions (which would
otherwise have been generated by the code generator) on your
own. Things like malloc can be implemented as operators of the
ADT and constants like NULL etc. can be made literals.

This way, you will not loose the abstraction in SDL (Rick's
concern) and u can still operate on the data just as you do
in SDL but behind the screens, something else is going on.
Variable length can also be achieved.

NOTE that your SDL designs will not be portable to other non
Telelogic SDL tools.

Check out the docs with your product. They'll help you a lot.
Particularly the chapters on structure of generated code and
ADTs.

--
-hth,
Giridhar

Y Giridhar Appaji Nag I hate quotations yganag#yahoo.>com Tell me what you know

--End text from Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews --- For extra SDL Forum Society benefits join at <http://www.sdl-forum.org/Society/members.htm>



This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:49 GMT