IDL questio

IDL questio

Post by Bonio Lope » Wed, 04 Jul 2001 23:31:24



Hi all,
I'm very very new with IDL and Corba. I use omni.
This is my first IDL file and I get a multiple errors. I want to exchange
data of the described struc type between two Pc's.
What is wrong in my IDL descriptio. I get many compilation errors.

#ifndef __My_IDL__
#define __My_IDL__

module MyCom
{

    struct MyArray
    {
    char     name[32];
    long      reserved1[2];
    any      reserved2;
    long      number_of_dims;
    long      reserved3[4];
    union
        {
         struct {
            any  pdata;
            any  pimag_data;
            any  reserved4;
            long    reserved5[3];
                 }   number_array;
         }   data;
   };

    interface MatTransport
    {
    mxArray FromEngine(in MyArray  mesg1);
    mxArray ToEngine(out MyArray  mesg2);
 };

#endif

 
 
 

IDL questio

Post by Duncan Grisb » Thu, 05 Jul 2001 00:57:29




Quote:>I'm very very new with IDL and Corba. I use omni.
>This is my first IDL file and I get a multiple errors. I want to exchange
>data of the described struc type between two Pc's.
>What is wrong in my IDL descriptio. I get many compilation errors.

There are so many things wrong with your IDL that it's difficult to
see what you are trying to achieve. Anyway, here are some comments...

Quote:>module MyCom
>{

>    struct MyArray
>    {
>    char     name[32];

You quite possibly want to be using a string or bounded string here.
It depends what you are trying to do.

Quote:>    long      reserved1[2];
>    any      reserved2;
>    long      number_of_dims;
>    long      reserved3[4];
>    union

A union must be declared with a discriminator type and a name,
something like

  union MyUnion switch (long)

It's not obvious to me what the union is there for. It seems to only
have a single member, which is a struct.

Quote:>        {
>         struct {

Again, the struct must be given a name

  struct MyInnerStruct {

Quote:>            any  pdata;
>            any  pimag_data;
>            any  reserved4;
>            long    reserved5[3];
>                 }   number_array;
>         }   data;
>   };

>    interface MatTransport
>    {
>    mxArray FromEngine(in MyArray  mesg1);
>    mxArray ToEngine(out MyArray  mesg2);

You haven't defined mxArray anywhere. Did you mean MyArray again?

Quote:> };

It looks like you are trying to convert an existing C++ structure
directly into IDL. That is probably not the right approach to take.
You should step back from it and analyse exactly what the requirements
of the application are, rather than how it is currently implemented.

Get hold of a copy of "Advanced CORBA Programming with C++" by Henning
and Vinoski, and read it. That will help a great deal.

Cheers,

Duncan.

--
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --

 
 
 

IDL questio

Post by Bonio Lope » Thu, 05 Jul 2001 18:28:13


Dear Duncan,
thank you for your help, after your corrections it seems to compile.
I am not trying to port a existing C++ application to cobra but start 2 of
this applications on separate computers and establish the communication
between it.
So I must have the same datatypes as application API.
I couldn't find very that book you say in our libruary, but I could get
other one ("object-oriented frameworks using C++and Corba"). It is quite
good, but it has not very much info on IDL.
Thank you once more for your answer .
Bonio
 
 
 

IDL questio

Post by Duncan Grisb » Thu, 05 Jul 2001 20:26:22




Quote:>thank you for your help, after your corrections it seems to compile.
>I am not trying to port a existing C++ application to cobra but start 2 of
>this applications on separate computers and establish the communication
>between it.
>So I must have the same datatypes as application API.

It isn't necessary to use the same datatypes as your existing
application. You are going to have to write some code to deal with
CORBA anyway, so you might as well make your IDL datatypes sensible
from a CORBA point-of-view, rather than making them as similar as
possible to the C++ types. Obviously, you shouldn't totally redesign
your data structures, since that would create unnecessary work, but
minor differences don't matter.

Cheers,

Duncan.

--
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --

 
 
 

1. idl/idl-shell mode has problem with IDL 4.0

Hi, There,

   I am using idl-shell.el version 1.19 that I ftped from
esrg.ucsb.edu.  The behavior is definitely different under IDL 4.0 and
IDL 3.6.  It works very well under IDL 3.6 that I can set breakpoints,
clear break points and when a problem, or break point is reached, the
idl program will stop at the line automatically.  This, however,
doesn't seem to work with IDL 4.0.  I can still set breakpoints, but
IDL always complain about not knowing where the breakpoint is when I
set them, although it stops there anyway.  I cannot clear the
breakpoints by control keys either, have to list the breakpoint and
clear it by breakpoint command.  Is this a common problem, or is it
something I need to set in my .emacs or UNIX environment?  Can someone
familiar with the interface between emacs and idl give me a hand?
BTW, I am using emacs 19.28.1 on an HP 735 running HP-UX 9.01, if it
matters.   Many thanks in advance.

Guan

2. prob. with citrix and lotus notes 5

3. IDL and Emacs: idl.el, idl-shell.el updates

4. Any good reference for RPG/400?

5. Siemens Gigaset questio-Line One and Line Two

6. How can I look at a hard drive?

7. Questios RE Gateway Model P55C-200

8. CORBA newbie question

9. Excel 5.0 VB questio?????

10. Lotus for Windows Questio

11. 3D Video Upgrade Graphics Accelerator Card Questio!!!!!!

12. SET snmp cmu questio

13. Powerbuilder Licensing questio....