The MainThread call GetIntData that is a method of DataSupplier and in the
body of this function a message is sent to DataOwnerCapsule.
In this way MainThread don't know the message is sent.

We did it working without RoseRT, in usual multitasking programming
environment.
We had an interface class, for example ToDataTaskInterface. This class had a
method Init(). Method Init did the spawn of a task (DataTask where data was
saved) and created the message queue for IPC. The method GetIntData(int
&IntData) in ToDataTaskInterface send a message using the queue to request
data to DataTask and waited for a message from the same task where IntData
was sent; then control was given back to the task (MainThread in our
example) which had called the GetIntData method. In this way message queues
and the spawn of the task were not seen from the MainThread.
This is a simple example of a MainThread:

main()
{
    ...
    int IntData;
    ToDataInterface Interface;
    ...
    Interface.Init(); // Here the spawn of DataTask and the creation of
message queues are done
    ...
    Interface,GetIntData(IntData); // Here a message is sent to DataTask and
IntData is received
    ...
}

In this way I changed the implementation of the ToDataInterface  where
another task spawn there was or not without changing MainThread, simply
rebuilding it.
This is very useful if you have to work with 2 projects very similar one to
the other but with a different architecture.

Any idea how can I do something similar in RoseRT?

Andrea.


----- Original Message -----
From: Michael Hill <[EMAIL PROTECTED]>
To: Andrea Scaggiante <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, March 22, 2001 1:34 PM
Subject: RE: (ROSE) Capsule hiding


Are you trying to hide it in terms of public and private?

-----Original Message-----
From: Andrea Scaggiante
Sent: Thu 3/22/2001 6:18 AM
To: [EMAIL PROTECTED]
Cc:
Subject: (ROSE) Capsule hiding




Hi everybody.

I'm working with RoseRT.
Suppose I have a thread (call it MainThread) where I need a
data, for
example an integer value, say IntData. This data could be
obtained from a
class (for example class DataSupplier) with method GetIntData,
or I could
receive it from a capsule (call it DataOwnerCapsule), so that I
should send
a message to that capsule and wait to receive the IntData in
another message
from that capsule. I would like to prepare only one MainThread
able to deal
with both situations.
I would like to hide the communications to DataOwnerCapsule in a
different
implementation of DataSupplier:  DataSupplier could become a
capsule too; by
calling the GetIntData method of DataSupplier I could send a
message to
DataCapsule and wait for the answer; then I could return the
value (and the
control) to the MainThread. In MainThread I only call the method
GetIntData.
DataSupplier now would be an interface to another capsule.

This, more or less, is the situation.
The question is:
Is there any way to hide the communication to a capsule (and the
creation of
the capsule too)?

I hope I was able to explain what I need.
Thank you for any help.

Andrea.


************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*

************************************************************************
*





************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages: 
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************

Reply via email to