hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cf_queue.h File Reference
#include <pthread.h>
#include <stddef.h>
#include <stdint.h>
#include "citrusleaf/cf_base_types.h"
Include dependency graph for cf_queue.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cf_queue_s
struct  cf_queue_priority_s

Macros

#define CF_QUEUE_ALLOCSZ   64
#define CF_Q_SZ(__q)   (__q->write_offset - __q->read_offset)
#define CF_Q_EMPTY(__q)   (__q->write_offset == __q->read_offset)
#define CF_Q_ELEM_PTR(__q, __i)   (&__q->queue[ (__i % __q->allocsz) * __q->elementsz ] )
#define CF_QUEUE_EMPTY   -2
#define CF_QUEUE_ERR   -1
#define CF_QUEUE_OK   0
#define CF_QUEUE_FOREVER   -1
#define CF_QUEUE_NOWAIT   0
#define CF_QUEUE_PRIORITY_HIGH   1
#define CF_QUEUE_PRIORITY_MEDIUM   2
#define CF_QUEUE_PRIORITY_LOW   3
#define CF_Q_PRI_EMPTY(__q)   (CF_Q_EMPTY(__q->low_q) && CF_Q_EMPTY(__q->medium_q) && CF_Q_EMPTY(__q->high_q))

Typedefs

typedef struct cf_queue_s cf_queue
typedef int(* cf_queue_reduce_fn )(void *buf, void *udata)
typedef struct cf_queue_priority_s cf_queue_priority

Functions

cf_queuecf_queue_create (size_t elementsz, bool threadsafe)
void cf_queue_destroy (cf_queue *q)
int cf_queue_push (cf_queue *q, void *ptr)
bool cf_queue_push_limit (cf_queue *q, void *ptr, uint32_t limit)
int cf_queue_sz (cf_queue *q)
int cf_queue_pop (cf_queue *q, void *buf, int mswait)
int cf_queue_reduce (cf_queue *q, cf_queue_reduce_fn cb, void *udata)
int cf_queue_delete (cf_queue *q, void *buf, bool only_one)
cf_queue_prioritycf_queue_priority_create (size_t elementsz, bool threadsafe)
void cf_queue_priority_destroy (cf_queue_priority *q)
int cf_queue_priority_push (cf_queue_priority *q, void *ptr, int pri)
int cf_queue_priority_pop (cf_queue_priority *q, void *buf, int mswait)
int cf_queue_priority_sz (cf_queue_priority *q)
int cf_queue_test ()

Macro Definition Documentation

#define CF_Q_ELEM_PTR (   __q,
  __i 
)    (&__q->queue[ (__i % __q->allocsz) * __q->elementsz ] )

Definition at line 53 of file cf_queue.h.

#define CF_Q_EMPTY (   __q)    (__q->write_offset == __q->read_offset)

Definition at line 49 of file cf_queue.h.

#define CF_Q_PRI_EMPTY (   __q)    (CF_Q_EMPTY(__q->low_q) && CF_Q_EMPTY(__q->medium_q) && CF_Q_EMPTY(__q->high_q))

Definition at line 129 of file cf_queue.h.

#define CF_Q_SZ (   __q)    (__q->write_offset - __q->read_offset)

Definition at line 47 of file cf_queue.h.

#define CF_QUEUE_ALLOCSZ   64

Definition at line 30 of file cf_queue.h.

#define CF_QUEUE_EMPTY   -2

Definition at line 77 of file cf_queue.h.

#define CF_QUEUE_ERR   -1

Definition at line 78 of file cf_queue.h.

#define CF_QUEUE_FOREVER   -1

Definition at line 84 of file cf_queue.h.

#define CF_QUEUE_NOWAIT   0

Definition at line 85 of file cf_queue.h.

#define CF_QUEUE_OK   0

Definition at line 79 of file cf_queue.h.

#define CF_QUEUE_PRIORITY_HIGH   1

Definition at line 125 of file cf_queue.h.

#define CF_QUEUE_PRIORITY_LOW   3

Definition at line 127 of file cf_queue.h.

#define CF_QUEUE_PRIORITY_MEDIUM   2

Definition at line 126 of file cf_queue.h.

Typedef Documentation

typedef struct cf_queue_s cf_queue
typedef int(* cf_queue_reduce_fn)(void *buf, void *udata)

Definition at line 96 of file cf_queue.h.

Function Documentation

cf_queue* cf_queue_create ( size_t  elementsz,
bool  threadsafe 
)
int cf_queue_delete ( cf_queue q,
void *  buf,
bool  only_one 
)
void cf_queue_destroy ( cf_queue q)
int cf_queue_pop ( cf_queue q,
void *  buf,
int  mswait 
)
cf_queue_priority* cf_queue_priority_create ( size_t  elementsz,
bool  threadsafe 
)
void cf_queue_priority_destroy ( cf_queue_priority q)
int cf_queue_priority_pop ( cf_queue_priority q,
void *  buf,
int  mswait 
)
int cf_queue_priority_push ( cf_queue_priority q,
void *  ptr,
int  pri 
)
int cf_queue_priority_sz ( cf_queue_priority q)
int cf_queue_push ( cf_queue q,
void *  ptr 
)
bool cf_queue_push_limit ( cf_queue q,
void *  ptr,
uint32_t  limit 
)
int cf_queue_reduce ( cf_queue q,
cf_queue_reduce_fn  cb,
void *  udata 
)
int cf_queue_sz ( cf_queue q)
int cf_queue_test ( )