GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
em_pqueue< T, Key > Class Template Reference

#include <empq.h>

Public Member Functions

 em_pqueue (long pq_sz, long buf_sz, unsigned short nb_buf, unsigned int buf_ar)
 
 em_pqueue ()
 
 em_pqueue (long N UNUSED)
 
 em_pqueue (MinMaxHeap< T > *im, AMI_STREAM< T > *amis)
 
 em_pqueue (const em_pqueue &ep)
 
 ~em_pqueue ()
 
unsigned long size ()
 
bool is_empty ()
 
bool is_full ()
 
bool min (T &elt)
 
bool extract_min (T &elt)
 
bool extract_all_min (T &elt)
 
bool insert (const T &elt)
 
long maxlen (unsigned short i)
 
long maxlen ()
 
void clear ()
 
void print_range ()
 
void print ()
 
void print_size ()
 

Protected Member Functions

int active_streams ()
 
bool empty_buff_0 ()
 
void empty_buff (unsigned short i)
 
AMI_err merge_buffer (em_buffer< T, Key > *buf, ExtendedMergeStream *outstr, long K)
 
AMI_err merge_streams (ExtendedMergeStream **instr, unsigned short arity, ExtendedMergeStream *outstr, long K)
 
void delete_str_elt (unsigned short buf_id, unsigned int stream_id)
 
void merge_bufs2pq (ExtendedMergeStream *minstream)
 
void cleanup ()
 
bool fillpq ()
 
void print_stream_sizes ()
 

Friends

ostream & operator<< (ostream &s, const em_pqueue &empq)
 

Detailed Description

template<class T, class Key>
class em_pqueue< T, Key >

Definition at line 124 of file empq.h.

Constructor & Destructor Documentation

◆ em_pqueue() [1/5]

template<class T , class Key >
em_pqueue< T, Key >::em_pqueue ( long  pq_sz,
long  buf_sz,
unsigned short  nb_buf,
unsigned int  buf_ar 
)

Definition at line 136 of file empq_impl.h.

References assert, getAvailableMemory(), MEMORY_LOG(), and NULL.

◆ em_pqueue() [2/5]

template<class T , class Key >
em_pqueue< T, Key >::em_pqueue

Definition at line 224 of file empq_impl.h.

References getAvailableMemory(), and MY_LOG_DEBUG_ID.

◆ em_pqueue() [3/5]

template<class T , class Key >
em_pqueue< T, Key >::em_pqueue ( long N  UNUSED)
inline

Definition at line 164 of file empq.h.

References em_pqueue< T, Key >::em_pqueue().

Referenced by em_pqueue< T, Key >::em_pqueue().

◆ em_pqueue() [4/5]

◆ em_pqueue() [5/5]

template<class T , class Key >
em_pqueue< T, Key >::em_pqueue ( const em_pqueue< T, Key > &  ep)

◆ ~em_pqueue()

template<class T , class Key >
em_pqueue< T, Key >::~em_pqueue

Definition at line 490 of file empq_impl.h.

References NULL.

Member Function Documentation

◆ active_streams()

template<class T , class Key >
int em_pqueue< T, Key >::active_streams ( )
inlineprotected

Definition at line 237 of file empq.h.

References em_buffer< T, Key >::get_nbstreams().

◆ cleanup()

template<class T , class Key >
void em_pqueue< T, Key >::cleanup
protected

Definition at line 968 of file empq_impl.h.

References MY_LOG_DEBUG_ID.

◆ clear()

template<class T , class Key >
void em_pqueue< T, Key >::clear

Definition at line 1482 of file empq_impl.h.

References NULL.

◆ delete_str_elt()

template<class T , class Key >
void em_pqueue< T, Key >::delete_str_elt ( unsigned short  buf_id,
unsigned int  stream_id 
)
protected

Definition at line 954 of file empq_impl.h.

References assert.

◆ empty_buff()

template<class T , class Key >
void em_pqueue< T, Key >::empty_buff ( unsigned short  i)
protected

◆ empty_buff_0()

template<class T , class Key >
bool em_pqueue< T, Key >::empty_buff_0
protected

Definition at line 1086 of file empq_impl.h.

References assert, MEMORY_LOG(), and MY_LOG_DEBUG_ID.

◆ extract_all_min()

template<class T , class Key >
bool em_pqueue< T, Key >::extract_all_min ( T &  elt)

Definition at line 802 of file empq_impl.h.

References min, and MY_LOG_DEBUG_ID.

◆ extract_min()

template<class T , class Key >
bool em_pqueue< T, Key >::extract_min ( T &  elt)

Definition at line 727 of file empq_impl.h.

References assert, MY_LOG_DEBUG_ID, x, and XXX.

◆ fillpq()

template<class T , class Key >
bool em_pqueue< T, Key >::fillpq
protected

◆ insert()

template<class T , class Key >
bool em_pqueue< T, Key >::insert ( const T &  elt)

Definition at line 1000 of file empq_impl.h.

References assert, MY_LOG_DEBUG_ID, and x.

◆ is_empty()

template<class T , class Key >
bool em_pqueue< T, Key >::is_empty

Definition at line 563 of file empq_impl.h.

◆ is_full()

template<class T , class Key >
bool em_pqueue< T, Key >::is_full ( )
inline

Definition at line 185 of file empq.h.

◆ maxlen() [1/2]

template<class T , class Key >
long em_pqueue< T, Key >::maxlen

Definition at line 538 of file empq_impl.h.

◆ maxlen() [2/2]

template<class T , class Key >
long em_pqueue< T, Key >::maxlen ( unsigned short  i)

Definition at line 513 of file empq_impl.h.

◆ merge_buffer()

◆ merge_bufs2pq()

◆ merge_streams()

template<class T , class Key >
AMI_err em_pqueue< T, Key >::merge_streams ( ExtendedMergeStream **  instr,
unsigned short  arity,
ExtendedMergeStream outstr,
long  K 
)
protected

!! KEYS BELONGS NOW TO MERGEHEAP, AND WILL BE DELETED BY THE

Definition at line 1380 of file empq_impl.h.

References AMI_ERROR_END_OF_STREAM, AMI_ERROR_NO_ERROR, assert, pqheap_t1< T >::empty(), MEMORY_LOG(), pqheap_t1< T >::min(), MY_LOG_DEBUG_ID, and pqheap_t1< T >::size().

◆ min()

template<class T , class Key >
bool em_pqueue< T, Key >::min ( T &  elt)

Definition at line 658 of file empq_impl.h.

References assert, MY_LOG_DEBUG_ID, and XXX.

◆ print()

template<class T , class Key >
void em_pqueue< T, Key >::print

Definition at line 1523 of file empq_impl.h.

◆ print_range()

template<class T , class Key >
void em_pqueue< T, Key >::print_range

Definition at line 1498 of file empq_impl.h.

◆ print_size()

template<class T , class Key >
void em_pqueue< T, Key >::print_size

Definition at line 1546 of file empq_impl.h.

References assert.

◆ print_stream_sizes()

template<class T , class Key >
void em_pqueue< T, Key >::print_stream_sizes
protected

Definition at line 1568 of file empq_impl.h.

◆ size()

template<class T , class Key >
unsigned long em_pqueue< T, Key >::size

Definition at line 550 of file empq_impl.h.

Friends And Related Function Documentation

◆ operator<<

template<class T , class Key >
ostream& operator<< ( ostream &  s,
const em_pqueue< T, Key > &  empq 
)
friend

Definition at line 221 of file empq.h.


The documentation for this class was generated from the following files: