Priority Queue
[mod_cache]


型定義

typedef cache_pqueue_t cache_pqueue_t
typedef long(*) cache_pqueue_set_priority (long queue_clock, void *a)
typedef long(*) cache_pqueue_get_priority (void *a)
typedef apr_ssize_t(*) cache_pqueue_getpos (void *a)
typedef void(*) cache_pqueue_setpos (void *a, apr_ssize_t pos)
typedef void(*) cache_pqueue_print_entry (FILE *out, void *a)

関数

cache_pqueue_tcache_pq_init (apr_ssize_t n, cache_pqueue_get_priority pri, cache_pqueue_getpos get, cache_pqueue_setpos set)
void cache_pq_free (cache_pqueue_t *q)
apr_ssize_t cache_pq_size (cache_pqueue_t *q)
apr_status_t cache_pq_insert (cache_pqueue_t *q, void *d)
void cache_pq_change_priority (cache_pqueue_t *q, long old_priority, long new_priority, void *d)
void * cache_pq_pop (cache_pqueue_t *q)
apr_status_t cache_pq_remove (cache_pqueue_t *q, void *d)
void * cache_pq_peek (cache_pqueue_t *q)
void cache_pq_print (cache_pqueue_t *q, FILE *out, cache_pqueue_print_entry print)
void cache_pq_dump (cache_pqueue_t *q, FILE *out, cache_pqueue_print_entry print)
int cache_pq_is_valid (cache_pqueue_t *q)

型定義

typedef apr_ssize_t(*) cache_pqueue_getpos(void *a)

callback function to get a position of a element

typedef void(*) cache_pqueue_print_entry(FILE *out, void *a)

debug callback function to print a entry

typedef long(*) cache_pqueue_set_priority(long queue_clock, void *a)

callback function to assign a priority for a element

引数:
a the element
戻り値:
the score (the lower the score the longer it is kept int the queue)

typedef void(*) cache_pqueue_setpos(void *a, apr_ssize_t pos)

callback function to set a position of a element

引数:
a the element
pos the position to set it to

typedef struct cache_pqueue_t cache_pqueue_t

the cache priority queue handle


関数

void cache_pq_dump ( cache_pqueue_t q,
FILE *  out,
cache_pqueue_print_entry  print 
)

dump the queue and it's internal structure

void cache_pq_free ( cache_pqueue_t q  ) 

free all memory used by the queue

引数:
q the queue

cache_pqueue_t* cache_pq_init ( apr_ssize_t  n,
cache_pqueue_get_priority  pri,
cache_pqueue_getpos  get,
cache_pqueue_setpos  set 
)

initialize the queue

引数:
n the initial estimate of the number of queue items for which memory should be preallocated
pri the callback function to run to assign a score to a element
get the callback function to get the current element's position
set the callback function to set the current element's position
戻り値:
the handle or NULL for insufficent memory

apr_status_t cache_pq_insert ( cache_pqueue_t q,
void *  d 
)

insert an item into the queue.

引数:
q the queue
d the item
戻り値:
APR_SUCCESS on success

int cache_pq_is_valid ( cache_pqueue_t q  ) 

checks that the pq is in the right order, etc

void* cache_pq_peek ( cache_pqueue_t q  ) 

access highest-ranking item without removing it.

引数:
q the queue
d the entry
戻り値:
NULL on error, otherwise the entry

void* cache_pq_pop ( cache_pqueue_t q  ) 

pop the highest-ranking item from the queue.

引数:
p the queue
d where to copy the entry to
戻り値:
NULL on error, otherwise the entry

void cache_pq_print ( cache_pqueue_t q,
FILE *  out,
cache_pqueue_print_entry  print 
)

print the queue

apr_status_t cache_pq_remove ( cache_pqueue_t q,
void *  d 
)

remove an item from the queue.

引数:
p the queue
d the entry
戻り値:
APR_SUCCESS on success

apr_ssize_t cache_pq_size ( cache_pqueue_t q  ) 

return the size of the queue.

引数:
q the queue


Apacheに対してSun Jul 19 22:05:28 2009に生成されました。  doxygen 1.4.7