[omniORB] about examples with sort of sequence
edward_lin
edward_lin@EGPALM.com.tw
Wed, 16 May 2001 15:46:32 +0800
Yes, sort of CORBA sequence is possible,
you can use STL std::sort() to work it out.
#include <algorithm>
T_var myData;
// get data
// ..............
//...............
T* pBuff = &myData[0];
long len = myData->length();
std::sort( pBuff, pBuff + len );
It really work.
Best Regards,
Edward Lin
-----Original Message-----
From: Patrizio Ferlito [mailto:pferlito@yahoo.com]
Sent: Wednesday, May 16, 2001 2:51 PM
To: edward_lin; 'Thomas Amsler'; omniorb-list@uk.research.att.com
Subject: [omniORB] about examples with sort of sequence
Hi,
I thank you for your example but I would ask you a question about the sort
of a sequence.
Do I have to write my sort procedure or the C++ mapping of sequence provides
some usefull features
about the sort of a sequence ?
I thank you in advance.
Kind regards
Patrizio Ferlito
--- edward_lin <edward_lin@EGPALM.com.tw> wrote:
> Howdy,
> Hope the following sample helps you.
>
> IDL:
> interface MyInterface
> {
> typedef sequence<octet> randSeq;
> void getRandSeq( out randSeq tx );
> }
>
> Object Implementation:
> void MyInterface_i::getRandSeq( randSeq_out tx )
> {
> MyInterface::randSeq*& ptx = tx.ptr();
> //....
> CORBA::Octet* p = new CORBA::Octet[ len ];
> //....
> ptx = new MyInterface::randSeq(len,len,p);
> }
>
> Client:
> void hello( MyInterface_ptr e )
> {
> MyInterface::randSeq_var tx;
> e->getRandSeq( tx.out() );
> long len = tx.length();
> for ( i = 0; i < len; i++ )
> {
> cout << tx[i] << endl; // access
> }
> }
>
> Cheers and good luck,
>
> Edward Lin
>
>
> -----Original Message-----
> From: Thomas Amsler [mailto:tpamsler@ucdavis.edu]
> Sent: Tuesday, May 15, 2001 5:05 AM
> To: omniorb-list@uk.research.att.com
> Subject: [omniORB] Sequence examples
>
>
> Are there any examples on how to use sequences with omniORB?
> Thank you.
>
> --
> Thomas Amsler
> tpamsler@ucdavis.edu
> amsler@cs.ucdavis.edu
> http://einstein.dyndns.org
>
> "Imagination is more important than knowledge."
> --Albert Einstein
>
>
>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/