Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

priority_list.h File Reference

#include "common.h"
#include "config.h"
#include "collection.h"
#include "linked_list.h"

Go to the source code of this file.

Data Structures

struct  _cp_priority_list

Defines

#define PRIORITY_LIST_IMMEDIATE   1
#define PRIORITY_LIST_NORMAL   2
#define cp_priority_list_create(immediate, normal_priorities, weights)
#define cp_priority_list_get_next(l)   cp_priority_list_get_next_by_option((l), (l)->mode)
#define cp_priority_list_rdlock(list)   cp_priority_list_lock(list, COLLECTION_LOCK_READ)
#define cp_priority_list_wrlock(list)   cp_priority_list_lock(list, COLLECTION_LOCK_WRITE)

Typedefs

typedef CPROPS_DLL struct
_cp_priority_list 
cp_priority_list


Detailed Description

push your data on a cp_priority_list then retrieve them by priority. priority levels are 0 - immediate: a priority list instantiated with an immediate priority will only return immediate priority items as long as such items are present on the immediate priority sub queue. 1 - the first 'normal priority' subqueue defined. Subqueues are defined with a weight. If you define the first subqueue with say weight 2 and the second with 1, in the absence of an immediate priority subqueue, calling cp_priority_list_get_next will return 2 items from the queue with weight 2, then 1 item from the queue with weight 1. Do not confuse the subqueue index, which is used to determine which queue you push items on (ie, what 'priority' they receive) with the actual weights. You could easily construct a cp_priority_list where priority 1 items have a lower weight than priority 2 items and vice versa.

Definition in file priority_list.h.


Generated on Sat Dec 1 10:25:30 2007 for cprops by  doxygen 1.3.9.1