[omniORB] Allocation of memory for sequence "vars"
Mark Zimmerman
markzimm at frii.com
Tue Sep 21 12:03:12 BST 2004
On Tue, Sep 21, 2004 at 07:42:05AM -0700, Green, Wallace J wrote:
> I am in the process of converting from a previous ORB to the omni ORB on
> a Linux system (PC).
>
> I have a very simple sequence that I am allocating and would like to
> check that the allocation was successful.
>
> The IDL is :
>
> interface SEQ {
>
> enum ABC { want, more };
> typedef sequence<ABC> ABCseq;
> };
>
> And the code (C++) I wish to convert is:
>
> SEQ::ABCseq_var me = new SEQ::ABCseq();
> if(me == NULL) printf("ERROR\n");
>
> When I compile this, using OMNI, I get an error on the "me == NULL" test
> to the effect that no such comparison is available.
>
> So, under OMNI, what is the appropraite way to verify that the
> allocation via the "new" was successful?
>
Check the value returned from 'new SEQ::ABCseq()' before handing it
off to SEQ::ABCseq_var.
-- Mark
More information about the omniORB-list
mailing list