Discussion:
[omniORB] Validity test
Hamilton Temple
2008-08-18 19:23:03 UTC
Permalink
Hello all,

I have defined a complex type SeqSeqStr:

module MyModule{
interface MyClass{
typedef sequence<string> SeqStr;
typedef sequence<SeqStr> SeqSeqStr;
...
};
};

Inside the interface MyClass I defined the
function:

SeqSeqStr * list(const char * locator);

The implementation of list is as follows:

MyModule::MyClass::SeqSeqStr * MyClassImp::list(const char * query){
MyModule::MyClass::SeqSeqStr_var res;

...

return res._retn();
};

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?

Thank you,
Hamilton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080818/ef248ff7/attachment.htm
Lisa Yao
2008-08-18 22:24:58 UTC
Permalink
Hi, Gurus:

After build, I saw lib with lib files, however lib64 is empty, does that mean this on is 32 bit code.

How do I build both 32bit and 64 bit?

Thanks

Lisa

_______________________________________________________

The information in this email or in any file attached
hereto is intended only for the personal and confiden-
tial use of the individual or entity to which it is
addressed and may contain information that is propri-
etary and confidential. If you are not the intended
recipient of this message you are hereby notified that
any review, dissemination, distribution or copying of
this message is strictly prohibited. This communica-
tion is for information purposes only and should not
be regarded as an offer to sell or as a solicitation
of an offer to buy any financial product. Email trans-
mission cannot be guaranteed to be secure or error-
free. P6070214
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080818/23e11ed9/attachment.htm
Lisa Yao
2008-08-18 22:39:06 UTC
Permalink
Sorry typo

Does that mean omniORB-4-1-2 only has 32 bit or only have 64 bit build?

Thanks again.

From: omniorb-list-***@omniorb-support.com [mailto:omniorb-list-***@omniorb-support.com] On Behalf Of Lisa Yao
Sent: Monday, August 18, 2008 11:25 AM
To: omniorb-***@omniorb-support.com
Subject: [omniORB] omniORB-4.1.2 32bit and 64bit

Hi, Gurus:

After build, I saw lib with lib files, however lib64 is empty, does that mean this on is 32 bit code.

How do I build both 32bit and 64 bit?

Thanks

Lisa
________________________________

The information in this email or in any file attached hereto is intended only for the personal and confidential use of the individual or entity to which it is addressed and may contain information that is proprietary and confidential. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product. Email transmission cannot be guaranteed to be secure or error-free. P6070214
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080818/6875c35a/attachment.htm
Clarke Brunt
2008-08-18 23:12:49 UTC
Permalink
Post by Hamilton Temple
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).
Hamilton Temple
2008-08-19 22:15:52 UTC
Permalink
Clarke, thank you for your answer.

I am already applying the solution based on exceptions; I wanted to know
if omniORB offers a function to determine if a returned value points to a
valid (non-null) memory address. Anyway, thank you for your explanation.

Best regards,

Hamilton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080819/f846587f/attachment.htm
Clarke Brunt
2008-08-19 22:35:33 UTC
Permalink
I wanted to know if omniORB offers a function to determine
if a returned value points to a valid (non-null) memory address.
Enough said, probably. I meant to convey (in the original answer) that
barring a bug in the ORB there's no way that a null pointer can get passed
back from server to client, so you don't need to test for it. If the method
implementation tried to return a null pointer, then I'd expect the server
ORB to return an exception to the client instead, which the client ORB would
turn back into a C++ exception for you to catch.
Duncan Grisby
2008-08-20 20:13:50 UTC
Permalink
Post by Lisa Yao
After build, I saw lib with lib files, however lib64 is empty, does that mean
this on is 32 bit code.
How do I build both 32bit and 64 bit?
If you compile omniORB with a 64 bit compiler, it's 64 bit code. The
default configuration installs to the lib directory regardless of the
word size.

You don't mention what platform you're using, but assuming it's Linux,
you can configure for 32 bit binaries by running configure like this:

../configure CXX="g++ -m32" CC="gcc -m32" [other configure options]

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...