Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
Realm::PriorityQueue< T, LT > Class Template Reference

#include <pri_queue.h>

Collaboration diagram for Realm::PriorityQueue< T, LT >:
[legend]

Classes

class  NotificationCallback

Public Types

typedef T ITEMTYPE
typedef int priority_t

Public Member Functions

 PriorityQueue (void)
 ~PriorityQueue (void)
void put (T item, priority_t priority, bool add_to_back=true)
T get (priority_t *item_priority, priority_t higher_than=PRI_NEG_INF)
T peek (priority_t *item_priority, priority_t higher_than=PRI_NEG_INF) const
bool empty (priority_t higher_than=PRI_NEG_INF) const
void add_subscription (NotificationCallback *callback, priority_t higher_than=PRI_NEG_INF)
void remove_subscription (NotificationCallback *callback)
void set_gauge (ProfilingGauges::AbsoluteRangeGauge< int > *new_gauge)

Static Public Attributes

static const priority_t PRI_MAX_FINITE = INT_MAX - 1
static const priority_t PRI_MIN_FINITE = -(INT_MAX - 1)
static const priority_t PRI_POS_INF = PRI_MAX_FINITE + 1
static const priority_t PRI_NEG_INF = PRI_MIN_FINITE - 1

Protected Member Functions

bool perform_notifications (T item, priority_t item_priority)

Protected Attributes

priority_t highest_priority
LT lock
std::map< priority_t, std::deque< T > > queue
std::map< NotificationCallback *, priority_t > subscriptions
ProfilingGauges::AbsoluteRangeGauge< int > * entries_in_queue

Friends

template<typename T2, typename LT2>
std::ostream & operator<< (std::ostream &os, const PriorityQueue< T2, LT2 > &pq)

Member Typedef Documentation

◆ ITEMTYPE

template<typename T, typename LT>
typedef T Realm::PriorityQueue< T, LT >::ITEMTYPE

◆ priority_t

template<typename T, typename LT>
typedef int Realm::PriorityQueue< T, LT >::priority_t

Constructor & Destructor Documentation

◆ PriorityQueue()

template<typename T, typename LT>
Realm::PriorityQueue< T, LT >::PriorityQueue ( void )

◆ ~PriorityQueue()

template<typename T, typename LT>
Realm::PriorityQueue< T, LT >::~PriorityQueue ( void )

Member Function Documentation

◆ add_subscription()

template<typename T, typename LT>
void Realm::PriorityQueue< T, LT >::add_subscription ( NotificationCallback * callback,
priority_t higher_than = PRI_NEG_INF )

◆ empty()

template<typename T, typename LT>
bool Realm::PriorityQueue< T, LT >::empty ( priority_t higher_than = PRI_NEG_INF) const

◆ get()

template<typename T, typename LT>
T Realm::PriorityQueue< T, LT >::get ( priority_t * item_priority,
priority_t higher_than = PRI_NEG_INF )

◆ peek()

template<typename T, typename LT>
T Realm::PriorityQueue< T, LT >::peek ( priority_t * item_priority,
priority_t higher_than = PRI_NEG_INF ) const

◆ perform_notifications()

template<typename T, typename LT>
bool Realm::PriorityQueue< T, LT >::perform_notifications ( T item,
priority_t item_priority )
protected

◆ put()

template<typename T, typename LT>
void Realm::PriorityQueue< T, LT >::put ( T item,
priority_t priority,
bool add_to_back = true )

◆ remove_subscription()

template<typename T, typename LT>
void Realm::PriorityQueue< T, LT >::remove_subscription ( NotificationCallback * callback)

◆ set_gauge()

template<typename T, typename LT>
void Realm::PriorityQueue< T, LT >::set_gauge ( ProfilingGauges::AbsoluteRangeGauge< int > * new_gauge)

◆ operator<<

template<typename T, typename LT>
template<typename T2, typename LT2>
std::ostream & operator<< ( std::ostream & os,
const PriorityQueue< T2, LT2 > & pq )
friend

Member Data Documentation

◆ entries_in_queue

template<typename T, typename LT>
ProfilingGauges::AbsoluteRangeGauge<int>* Realm::PriorityQueue< T, LT >::entries_in_queue
protected

◆ highest_priority

template<typename T, typename LT>
priority_t Realm::PriorityQueue< T, LT >::highest_priority
protected

◆ lock

template<typename T, typename LT>
LT Realm::PriorityQueue< T, LT >::lock
mutableprotected

◆ PRI_MAX_FINITE

template<typename T, typename LT>
const priority_t Realm::PriorityQueue< T, LT >::PRI_MAX_FINITE = INT_MAX - 1
static

◆ PRI_MIN_FINITE

template<typename T, typename LT>
const priority_t Realm::PriorityQueue< T, LT >::PRI_MIN_FINITE = -(INT_MAX - 1)
static

◆ PRI_NEG_INF

template<typename T, typename LT>
const priority_t Realm::PriorityQueue< T, LT >::PRI_NEG_INF = PRI_MIN_FINITE - 1
static

◆ PRI_POS_INF

template<typename T, typename LT>
const priority_t Realm::PriorityQueue< T, LT >::PRI_POS_INF = PRI_MAX_FINITE + 1
static

◆ queue

template<typename T, typename LT>
std::map<priority_t, std::deque<T> > Realm::PriorityQueue< T, LT >::queue
protected

◆ subscriptions

template<typename T, typename LT>
std::map<NotificationCallback *, priority_t> Realm::PriorityQueue< T, LT >::subscriptions
protected

The documentation for this class was generated from the following file:
  • /home/runner/work/realm/realm/realm-src/src/realm/pri_queue.h