[omniORB] sequence question

James Dempsey jdempsey@sctcorp.com
Fri, 1 Sep 2000 09:27:00 -0400


I think the trick is to use _retn( ), rather than _duplicate( ).



                                                                                                                                  
                    mdavis@rwii.com                                                                                               
                    Sent by:                            To:     James Dempsey <jdempsey@sctcorp.com>                              
                    owner-omniorb-list@uk.resear        cc:     omniorb <omniorb-list@uk.research.att.com>                        
                    ch.att.com                          Subject:     Re: [omniORB] sequence question                              
                                                                                                                                  
                                                                                                                                  
                    09/01/00 08:05 AM                                                                                             
                                                                                                                                  
                                                                                                                                  



> Hi,
>
> I have the following IDL:
>
> typedef sequence<string> List;
>
> interface X {
>
>     List getNames( );
>
> };
>
> I've implemented the operation as follows:
>
> List* getNames( ) {
>
>     List_var list = new List( );
>     list.length( 2 );
>
>     list[0] = "Jim";
>     list[1] = "Mary";
>
>     return List::_duplicate( list );
>
> }
>
>
> The compiler complains that _duplicate( ) is not a member of List.
Is
> there some other way I should be returning the List I create?
>
> Thanks,
> Jim Dempsey
> SCT
> jdempsey@sctcorp.com
>

use list.out().  It takes care of any messing memory management crap
that you
would otherwise have to deal with.



--
Mike Davis           Real World Interface, a division of I.S. Robotics
mdavis@rwii.com      http://www.rwii.com
603-532-6900 x215    fax : 603-532-6901