[omniORB] IDL Linked list

David movling at gmail.com
Fri Apr 11 14:29:09 BST 2008


Hi,

Great, thanks. Maybe I'm not going about solving my problem in the right way
though. I have a C++ scenario which looks something like this:

class A {
  int foo( data_t );
};

typedef struct data_s {
  int val;
  bar_t *bar;
  struct data_s *next;
} data_t;

typedef struct bar_s {
  char *str;
} bar_t;

I need to make A accessible via CORBA. That is, another machine, where the
data_t and bar_t structs reside, should be able to call a.foo(). The data_t
and bar_t arguments need to be sent over the network. I'm not sure how the
bar pointer in data_t will be handled though -- do I need to get rid of it?
I want to minimize the amount of object passing needed.

Note that this is a modification of an existing codebase. I want to
integrate CORBA into this as little as possible, but if CORBA is going to
send the arguments, it needs to know what they look like, right? Would an
alternative be to "serialize" the data_t struct (not necessarily into a
stream/string, but just something that CORBA handles well), send it over the
network to an AProxy object, which would "deserialize" the data_t struct and
call a.foo()?

Am I rambling like a madman? I hope not. Let me know if any of this makes
any sense to you.

/David


On Fri, Apr 11, 2008 at 12:29 PM, Martin Trappel <0xCDCDCDCD at gmx.at> wrote:

> mov . wrote:
>
> > Hi,
> >
> > I've googled a fair amount, and found nothing on the mailing list about
> > this. How would I model a linked list in IDL? Could someone maybe point me
> > to some good IDL documentation for omniORB, if there is any. I've looked at
> > the C++ Language Mapping, Version 1.2 from OMG, but I haven't found anything
> > there either. What I want is something that's equivalent to, and preferably
> > also maps to,
> >
> > typedef struct list_item_s {
> >  int value;
> >  struct list_item_s *next;
> > } list_item_t;
> >
> > Any ideas? Am I missing something obvious? Any help is appreciated.
> >
> > /David
> >
> >
> IDL only defines an Interface, so it may not make sense to define a linked
> list in IDL. Of course, if you really like to model a linked list on the
> interface level, you could write something like:
>
> module Example {
>  interface ListItem;
>
>  interface ListItem {
>    int GetValue();
>    ListItem Next();
>  };
> };
>
> br,
> Martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080411/5a43a6fa/attachment.htm


More information about the omniORB-list mailing list