object: add b_list object
b_list behaves exactly like b_queue, with two key differences:
1) it is memory-managed like other b_objects, which means it
is stored on the heap and ref-counted.
2) it is not an invasive data structure, and will automatically
create and manage list nodes that contain pointers to the
list items.
This commit is contained in:
19
object/list.h
Normal file
19
object/list.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef _BLUELIB_LIST_H_
|
||||
#define _BLUELIB_LIST_H_
|
||||
|
||||
#include "object.h"
|
||||
|
||||
#include <blue/core/queue.h>
|
||||
|
||||
struct b_list {
|
||||
struct b_object l_base;
|
||||
struct b_queue l_queue;
|
||||
size_t l_len;
|
||||
};
|
||||
|
||||
struct b_list_entry {
|
||||
struct b_queue_entry e_entry;
|
||||
void *e_data;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user