RE: nb_peek

From: Stuart Swan <stuart@cadence.com>
Date: Mon Mar 29 2010 - 11:29:42 PDT

John-

I think that is some hack that Adam Rose probably put in - I don't think it should be included
in the LRM since the same functionality can be achieved using other (and cleaner) TLM fifo apis.

Thanks
Stuart

From: owner-systemc-p1666-technical@eda.org [mailto:owner-systemc-p1666-technical@eda.org] On Behalf Of john.aynsley@doulos.com
Sent: Monday, March 29, 2010 9:29 AM
To: systemc-p1666-technical@eda.org
Subject: nb_peek

The usual behavior of method

tlm_fifo<T>::nb_peek( T &t , int n ) const

is to return a reference to the item at location n, where 0 <= n < size()-1

However, the code includes a hack to accept n == -1, and have it equivalent to n == size()-1, i.e. peek the oldest item in the FIFO.
Strangely, nb_poke does not have the equivalent special case.

Do we want to document this special case of nb_peek in the LRM, in which case, should we add the same special case n == -1 to nb_poke?

John A

--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Mar 29 11:29:58 2010

This archive was generated by hypermail 2.1.8 : Mon Mar 29 2010 - 11:29:58 PDT