Agreed. All is clear.
John A
From:
Bishnupriya Bhattacharya <bpriya@cadence.com>
To:
"Philipp A. Hartmann" <philipp.hartmann@offis.de>,
"john.aynsley@doulos.com" <john.aynsley@doulos.com>
Cc:
"jerome.cornet@st.com" <jerome.cornet@st.com>,
"systemc-p1666-technical@eda.org" <systemc-p1666-technical@eda.org>
Date:
24/03/2010 14:28
Subject:
RE: Proposal for sc_process_handle: AGREE
Philip, John,
Philip is right. My original code is correct and the text had the typo. It
should say
"the corner case of two invalid handles where the handles never did
point to any process objects need also be covered, and such handles
should be equivalent, and should not be equal (i.e. they should be
unequal)".
My apologies for the confusion.
John, are we on the same page now?
Thanks,
-Bishnupriya
-----Original Message-----
From: Philipp A. Hartmann [mailto:philipp.hartmann@offis.de]
Sent: Wednesday, March 24, 2010 5:57 PM
To: john.aynsley@doulos.com
Cc: Bishnupriya Bhattacharya; jerome.cornet@st.com;
systemc-p1666-technical@eda.org
Subject: Re: Proposal for sc_process_handle: AGREE
John, Bishnupriya,
a straight-forward implementation (e.g. based on unique ids with a "magic
id" 0 for empty handles) would lead to equivalent empty handles.
See below.
On 24/03/10 12:37, john.aynsley@doulos.com wrote:
> Bishnupriya,
>
> You wrote
>
> I agree that using an unique integer id for each process object will
> allow an invalidating implementation to implement operator <
> correctly, as laid down below in Philip's 3 bullet points. Note that
> the corner case of two invalid handles where the handles never did
> point to any process objects need also be covered, and such handles
> should not be equivalent, and should not be equal (i.e. they should be
unequal)
> sc_process_handle a,b;
> sc_assert(!(a<b) && !(b<a));
> sc_assert(a!=b);
This original code is what I would have expected: empty handles are
unequal (as per current standard), but equivalent (neither is "less than"
the other).
> I think you meant:
>
> sc_process_handle a,b;
> sc_assert( (a<b) || (b<a) );
In this case, you could fill up a map with empty handles indefinitely (and
never find empty handles in such a container):
std::map< sc_process_handle, int > m;
sc_process_handle no_proc;
for( int i=0; i<10; ++i )
// always adds a new entry to the map :(
m[ no_proc ]++;
So I think, the original code example of Bishnupriya has been correct, and
the explaining text contained a typo. Am I right?
Greetings from Oldenburg,
Philipp
[snip]
-- Philipp A. Hartmann Hardware/Software Design Methodology Group OFFIS R&D Division Transportation | FuE-Bereich Verkehr Escherweg 2 * 26121 Oldenburg * Germany Phone/Fax: +49-441-9722-420/282 * PGP: 0x9161A5C0 * http://www.offis.de/ -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed Mar 24 07:31:46 2010
This archive was generated by hypermail 2.1.8 : Wed Mar 24 2010 - 07:31:46 PDT