Discussion:
[omniORB] Compare CORBA Object Reference
Lakshmeeshk
2010-01-20 21:03:09 UTC
Permalink
Hi All,



I required the answers to below listed questions, could anyone look into
these and provide me the solution.



1. Is there any method to compare CORBA Object references? Without using
is_equivalent() method.

Also, not doing by object_to_string() and then compare with strcmp() method.



2. This method should be generic and support other CORBA families.



Thanks in advance!



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100120/35613d49/attachment.htm
Edward Lin
2010-01-21 20:15:55 UTC
Permalink
Hi there,

I think the this URL
"http://www4.informatik.uni-erlangen.de/~geier/corba-faq/obj-refs.html"
tells you what you'd like to understand. Simply speaking, using
is_equvalent() is the only portable way to test whether two object
references are equivalent or not.

Thanks,
Edward
Post by Lakshmeeshk
Hi All,
I required the answers to below listed questions, could anyone look into
these and provide me the solution.
1. Is there any method to compare CORBA Object references? Without using
is_equivalent() method.
Also, not doing by object_to_string() and then compare with strcmp() method.
2. This method should be generic and support other CORBA families.
Thanks in advance!
Duncan Grisby
2010-02-04 22:25:25 UTC
Permalink
Post by Lakshmeeshk
I required the answers to below listed questions, could anyone look
into these and provide me the solution.
1. Is there any method to compare CORBA Object references? Without
using is_equivalent() method.
No.

As you may know, _is_equivalent compares CORBA object references. It
does not compare CORBA objects, so two references that compare equal
definitely refer to the same object; two references that are not
equivalent may or may not refer to the same object.
Post by Lakshmeeshk
Also, not doing by object_to_string() and then compare with strcmp() method.
That is not safe. If you call object_to_string() twice with the same
object reference, there is no guarantee that you will get the same
string. And, as with _is_equivalent, you can have two totally different
looking object references that refer to the same object.
Post by Lakshmeeshk
2. This method should be generic and support other CORBA families.
The normal way to support object comparisons is to define your own
comparison operation in a base interface. Then you can ask an object if
it is the same as another one.

Cheers,

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