[omniORB] sequence<interface>

David Riddoch djr@orl.co.uk
Fri, 18 Dec 1998 13:01:23 +0000 (GMT)


That sounds roughly correct, but I'm not sure what you mean by
seq_of_A::duplicate().

Here's an outline of how I think it should be coded ...

Server side:
============
seq_of_A* B::getAseq()
{
  seq_of_A* s = new seq_of_A;
  seq_of_A& seq = *s;

  seq.length(2);

  A_impl* a = new A_impl(whatever ...);
  a->_obj_is_ready(boa);
  seq[0] = a->_this();

  a = new A_impl(another one ...);
  a->_obj_is_ready(boa);
  seq[1] = a->_this();

  return s;
}

Client side:
============
void f(B_ptr b)
{
  seq_of_A* s = b->getAseq();
  seq_of_A& seq = *s;

  s[0]->do_something();

  ...

  delete s;
}



On Fri, 18 Dec 1998 oleg_machulski@geocities.com wrote:

> Maybe this quetion is not omniORB2 specific, but I'll ask:
> 
> Suppose we have an interface A  with some methods and attributes.
> There exists typedef sequence<A> seq_of_A; Is it possible to declare
> and use method B::getAseq() whose return type is seq_of_A?
> 
> Let A_impl is an implementation of interface A (and of course it is
> inherited from _sk_A). As I understand, we have to create an empty
> sequence if A_Impl objects and then use seq_of_A::duplicate() method
> to fill created sequence with references to implementations. Then,
> this array is transferred to client and all the references to _Impl
> objects are transformed by ORB into references to proxy objects.
> 
> so, the question is the following: If we're wrong, please provide us
> with the HelloWorld-like example of client-side and client-side code,
> which illustrates how to transfer sequences of objects(interfaces)
> through the ORB.
> 
> Thank You.
> ---
> Oleg Machulski
> http://www.geocities.com/SiliconValley/Network/7671/
> mailto:oleg_machulski@geocities.com
> mailto:olegmachulski@usa.net
> 
> 
> 
>