scc  2022.4.0
SystemC components library
scc::peq< TYPE > Struct Template Reference

priority event queue More...

#include <peq.h>

Inheritance diagram for scc::peq< TYPE >:
Collaboration diagram for scc::peq< TYPE >:

Public Types

using pair_type = std::pair< const sc_core::sc_time, TYPE >
 
using map_type = std::map< const sc_core::sc_time, std::deque< TYPE > * >
 

Public Member Functions

 peq ()
 default constructor creating a unnamed peq
 
 peq (const char *name)
 named peq constructor More...
 
 ~peq ()
 destructor
 
void notify (const TYPE &entry, const sc_core::sc_time &t)
 non-blocking push. More...
 
void notify (TYPE &&entry)
 
void notify (TYPE const &entry)
 non-blocking push More...
 
boost::optional< TYPE > get_next ()
 non-blocking get More...
 
TYPE get ()
 blocking get More...
 
sc_core::sc_event & event ()
 get the available event More...
 
void cancel_all ()
 cancel all events from the event queue
 
bool has_next ()
 check if value is available at current time More...
 
void clear ()
 

Detailed Description

template<class TYPE>
struct scc::peq< TYPE >

priority event queue

A simple priority event queue with a copy of the original value

Template Parameters
TYPEthe type name of the object to keep in th equeue

Definition at line 41 of file peq.h.

Constructor & Destructor Documentation

◆ peq()

template<class TYPE >
scc::peq< TYPE >::peq ( const char *  name)
inlineexplicit

named peq constructor

Parameters
name

Definition at line 60 of file peq.h.

Member Function Documentation

◆ event()

template<class TYPE >
sc_core::sc_event & scc::peq< TYPE >::event ( )
inline

get the available event

Returns
reference to the event

Definition at line 140 of file peq.h.

◆ get()

template<class TYPE >
TYPE scc::peq< TYPE >::get ( )
inline

blocking get

Returns
copy of the next entry.

Definition at line 128 of file peq.h.

◆ get_next()

template<class TYPE >
boost::optional< TYPE > scc::peq< TYPE >::get_next ( )
inline

non-blocking get

Returns
optional copy of the head element

Definition at line 111 of file peq.h.

◆ has_next()

template<class TYPE >
bool scc::peq< TYPE >::has_next ( )
inline

check if value is available at current time

Returns
true if data is available for get()

Definition at line 156 of file peq.h.

◆ notify() [1/2]

template<class TYPE >
void scc::peq< TYPE >::notify ( const TYPE &  entry,
const sc_core::sc_time &  t 
)
inline

non-blocking push.

Inserts entry into the queue with time based notification

Parameters
entrythe value to insert
tthe delay for calling get

Definition at line 77 of file peq.h.

◆ notify() [2/2]

template<class TYPE >
void scc::peq< TYPE >::notify ( TYPE const &  entry)
inline

non-blocking push

Inserts entry into the queue with immediate notification

Parameters
entrythe value to insert

Definition at line 101 of file peq.h.


The documentation for this struct was generated from the following file: