Privacy and Security Notice

Archived Messages for CDEV@cebaf.gov: Re: Return value of cdev calls ?

Re: Return value of cdev calls ?

Miroslaw Dach (dach@psi.ch)
Tue, 24 Mar 1998 14:47:34 +0100 (CET)

Hi Chip,

Meanwhile when I am waiting for some suggestion about cdevGateway
I started to think about Java client program. I created one but I can not
test it so I am waiting. By the way could you tell me how to port the
calls which I was using in c++ programs (with cdev libraries) into Java.

I did as following:

1.c++ (that works):

.....
....
mydev.send("get VAL",NULL,result);
result.get("value",&dResult);
.....
.....
2. in Java i wrote (but i did not test it) :

.....
.....
myDevice.send("get VAL",null, result);
dResult=result.doubleValue("VALUE");
.....
....

I do not also know If I can use in one ddl file 2 serveices ie. ca
(channel access) and Gateway serveice. The ddl file that I have is
sent in an attachment in that e-mail.
Could you please tell me if it looks ok?

Mirek

=============================================================================
Miroslaw Dach (Miroslaw.Dach@psi.ch) - SLS/Control Group
PSI - Paul Scherrer Institut CH-5232 Villigen
=============================================================================

On Tue, 24 Mar 1998, Chip WATSON wrote:

> Steve,
>
> cdevRequestObject.attachPtr does not return null.
> This was done to make it consistent with attachRef,
> which cannot return null.
>
> Instead, each of these returns a pointer (reference)
> to a special object which will return CDEV_INVALIDOBJ
> on all send operations and will generate an error
> message at the same time.
>
> Admittedly, returning null might have been cleaner
> for the attachPtr call (I think that was the original
> implementation), but then the application programmer
> had better check for null. This way, an error message
> comes out instead of a core dump.
>
> Chip
>
>
>