Yes, I think we need that. In practice ‘==’ would work most of the cases but 
it’s not 100% portable solution.

-Petri


From: ext Bill Fischofer [mailto:[email protected]]
Sent: Friday, December 12, 2014 2:13 PM
To: Taras Kondratiuk
Cc: [email protected]; [email protected]
Subject: Re: ODP handles comparison

We discussed having xxx_is_equal() type calls in the past and there didn't seem 
to be a lot of interest at the time.  I agree this can be useful and because 
ODP types are abstract such comparisons SHOULD be via explicit comparator 
functions.  Using == in C++ is fine since operators can be overridden in that 
language, but it's not a good idea in C.

Perhaps an opportunity to discuss these again as well as how to make explicitly 
inline/macro based APIs available since these sort of calls are a natural for 
this.

On Fri, Dec 12, 2014 at 4:16 AM, Taras Kondratiuk 
<[email protected]<mailto:[email protected]>> wrote:
Hi

It seems to be useful to be able to compare two ODP handles. For example
compare odp_packet_pool() return value with previously created
pool to check that packet is from that pool.

ODP types are opaques handles, so comparing them directly with == may
give a wrong results. For example handles that point to the same object
(queue, pool, etc) can have generation number in it, so direct
comparison will return false.

Do we need to add corresponding comparison API for each handle type? Or
we just say that any two handles of the same ODP object should be equal
and == is enough?

--
Taras Kondratiuk
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to