scc 2025.09
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
 ~peq ()
 destructor
void notify (TYPE const &entry, const sc_core::sc_time &t)
 non-blocking push.
void notify (TYPE &&entry, const sc_core::sc_time &t)
void notify (TYPE &&entry)
void notify (TYPE const &entry)
 non-blocking push
boost::optional< TYPE > get_next ()
 non-blocking get
TYPE get ()
 blocking get
sc_core::sc_event & event ()
 get the available event
void cancel_all ()
 cancel all events from the event queue
bool has_next ()
 check if value is available at current time
void clear ()
size_t size () const

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.

Member Typedef Documentation

◆ map_type

template<class TYPE>
using scc::peq< TYPE >::map_type = std::map<const sc_core::sc_time, std::deque<TYPE>*>

Definition at line 46 of file peq.h.

◆ pair_type

template<class TYPE>
using scc::peq< TYPE >::pair_type = std::pair<const sc_core::sc_time, TYPE>

Definition at line 45 of file peq.h.

Constructor & Destructor Documentation

◆ peq() [1/2]

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

default constructor creating a unnamed peq

Definition at line 52 of file peq.h.

◆ peq() [2/2]

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

named peq constructor

Parameters
name

Definition at line 60 of file peq.h.

◆ ~peq()

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

destructor

Definition at line 231 of file peq.h.

Member Function Documentation

◆ cancel_all()

template<class TYPE>
void scc::peq< TYPE >::cancel_all ( )
inline

cancel all events from the event queue

Definition at line 159 of file peq.h.

◆ clear()

template<class TYPE>
void scc::peq< TYPE >::clear ( )
inline

Definition at line 171 of file peq.h.

◆ 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 153 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 141 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 124 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 169 of file peq.h.

◆ notify() [1/4]

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

Definition at line 102 of file peq.h.

◆ notify() [2/4]

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

Definition at line 90 of file peq.h.

◆ notify() [3/4]

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 114 of file peq.h.

◆ notify() [4/4]

template<class TYPE>
void scc::peq< TYPE >::notify ( TYPE const & 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.

◆ size()

template<class TYPE>
size_t scc::peq< TYPE >::size ( ) const
inline

Definition at line 180 of file peq.h.


The documentation for this struct was generated from the following file:
  • /home/eyck/Projects/MINRES/SystemC-Components/src/sysc/scc/peq.h