/*****************************************************************************
The following code is derived, directly or indirectly, from the SystemC
source code Copyright (c) 1996-2004 by all Contributors.
The contents of this file are subject to the restrictions and limitations
set forth in the SystemC Open Source License Version 2.4 (the "License");
You may not use this file except in compliance with such restrictions and
limitations. You may obtain instructions on how to receive a copy of the
License at http://www.systemc.org/. Software distributed by Contributors
under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
*****************************************************************************/
#ifndef TLM_FIFO_PEEK_HEADER
#define TLM_FIFO_PEEK_HEADER
#include "tlm_core/tlm_fifo/tlm_fifo.h"
tlm_fifo
<T
>::peek( tlm_tag
<T
> * ) const {
// this const cast is only needed because sc_prim_channel::wait(.) is
// for some unknown reason, not const
const_cast< tlm_fifo
<T
> * >( this )->wait( m_data_written_event
);
return buffer
->read_data();
tlm_fifo
<T
>::nb_peek( T
&t
) const {
t
= buffer
->peek_data( 0 );
tlm_fifo
<T
>::nb_peek( T
&t
, int n
) const {
if( n
>= used() || n
< -1 ) {
t
= buffer
->peek_data( n
);
tlm_fifo
<T
>::nb_can_peek( tlm_tag
<T
> * ) const
tlm_fifo
<T
>::nb_poke( const T
&t
, int n
) {
if( n
>= used() || n
< 0 ) {
buffer
->poke_data( n
) = t
;