[omniORB] Validity test

Clarke Brunt clarke.brunt at trafficmaster.co.uk
Mon Aug 18 19:12:47 BST 2008


>The invocation is
>
> MyModule::MyClass::SeqSeqStr_var listv;
>  ...     
> listv=manager->list(query_);
>
> I know that omniORB does not use
> null pointers to represent nil references.
> How could I check the validity of listv?
> Can be _is_nil(CORBA::Object *) applied
> in this case?

Writing a bit 'off the top of my head', I wonder in what sense you mean
'validity'? Don't think you can use _is_nil, since it isn't a CORBA::Object.
If you wanted to test whether the _var contained a non-NULL pointer, then
I've been known to use e.g. if (listv.operator->())... but I've only ever
used this when I have a _var that I've declared, but may or may not have
assigned anything to yet. In your case, you've definitely filled it in (with
the result of the 'list' call). So I think you must just assume that it is
'valid'. If (say) your implementation had tried to return a NULL pointer,
rather than a pointer to a created sequence, then I would have expected to
get an exception propagated back to the client, so no need to test the _var
(catch the exception instead). The sequences may well be of zero length, as
may the strings, but there's nothing 'invalid' about that (if it was what
you intended).




More information about the omniORB-list mailing list