Coconut Framework
beta
|
Define CNObjectList data structure. More...
Go to the source code of this file.
Classes | |
struct | CNObjectList |
List of CNObject. More... | |
Functions | |
static struct CNObjectList | CNMakeEmptyObjectList (struct CNResource *resource) |
Initialize CNObjectList. More... | |
void | CNDestroyObjectList (struct CNObjectList *dst) |
Destroy CNObject(s) in the list and list items. More... | |
static size_t | CNCountOfObjectsInList (const struct CNObjectList *src) |
Get count of items in the object list. More... | |
static struct CNListItem * | CNFirstListObject (const struct CNObjectList *src) |
Get 1st item in the list. More... | |
static struct CNListItem * | CNLastListObject (const struct CNObjectList *src) |
Get last item in the list. More... | |
static struct CNListItem * | CNCentinelListObject (const struct CNObjectList *src) |
Get centinel item of the list. More... | |
static void | CNAppendObjectToList (struct CNObjectList *dst, struct CNObject *src) |
Append object to the list. More... | |
static void | CNPrependObjectToList (struct CNObjectList *dst, struct CNObject *src) |
Prepend object to the list. More... | |
struct CNObjectList | CNCopyObjectList (const struct CNObjectList *src) |
Make the copy of source object list. More... | |
static void | CNInsertObjectToList (struct CNObjectList *dst, struct CNListItem *prev, struct CNObject *src) |
Insert item to the list. More... | |
void | CNInsertObjectsToList (struct CNObjectList *owner, struct CNListItem *prev, const struct CNObjectList *src) |
Insert objects to the list. More... | |
static struct CNObject * | CNUnlinkObjectFromList (struct CNObjectList *owner, struct CNListItem *dst) |
Unlink an item from the list and return it's data. More... | |
static struct CNObject * | CNUnlinkFirstObjectFromList (struct CNObjectList *dst) |
Get 1st object in the list. More... | |
static struct CNObject * | CNUnlinkLastObjectFromList (struct CNObjectList *dst) |
Get last object in the list. More... | |
static void | CNMoveObjectList (struct CNObjectList *dst, struct CNObjectList *src) |
Move objects from source to destination. More... | |
void | CNAppendObjectsToList (struct CNObjectList *dst, struct CNObjectList *src) |
Copy objects from source to destination. More... | |
static struct CNListItem * | CNSearchObjectInList (const struct CNObjectList *list, struct CNObject *obj) |
Search list item which has source data reference. More... | |
static struct CNListItem * | CNSearchMatchedObjectInList (const struct CNObjectList *list, CNMatchDataFuncRef func, void *info) |
Search object which matched source data. More... | |
CNBoolean | CNDeleteObjectInList (struct CNObjectList *dst, struct CNObject *obj) |
Delete object in the list. More... | |
Define CNObjectList data structure.
|
static |
Initialize CNObjectList.
resource | Resource for the list |
References CNMakeEmptyList(), and CNObjectList::objectList.
void CNDestroyObjectList | ( | struct CNObjectList * | dst | ) |
Destroy CNObject(s) in the list and list items.
dst | Destination list |
Referenced by CNDestroyContextOfNode().
|
inlinestatic |
Get count of items in the object list.
src | Source object list |
References CNCountOfItemsInList(), and CNObjectList::objectList.
Referenced by CNCountOfConsumerEdges(), CNCountOfNodesInGraph(), and CNCountOfProducerEdges().
|
static |
Get 1st item in the list.
src | Source list |
References CNFirstListItem(), and CNObjectList::objectList.
Referenced by CNFirstConsumerEdgeInNode(), CNFirstEdgeInGraph(), CNFirstNodeInGraph(), and CNFirstProducerEdgeInNode().
|
static |
Get last item in the list.
src | Source list |
References CNLastListItem(), and CNObjectList::objectList.
|
static |
Get centinel item of the list.
src | Source list |
References CNCentinelListItem(), and CNObjectList::objectList.
Referenced by CNCentinelConsumerEdgeInNode(), CNCentinelEdgeInGraph(), CNCentinelNodeInGraph(), and CNCentinelProducerEdgeInNode().
|
inlinestatic |
Append object to the list.
dst | Destination list |
src | Source object |
References CNAppendItemToList(), CNRetainObject(), and CNObjectList::objectList.
|
inlinestatic |
Prepend object to the list.
dst | Destination list |
src | Source object |
References CNPrependItemToList(), CNRetainObject(), and CNObjectList::objectList.
struct CNObjectList CNCopyObjectList | ( | const struct CNObjectList * | src | ) |
Make the copy of source object list.
src | Source list |
|
inlinestatic |
Insert item to the list.
dst | Destination list |
prev | Item in the owner list, the source object will be linked as the next of this. |
src | Source object |
References CNInsertItemToList(), CNRetainObject(), and CNObjectList::objectList.
void CNInsertObjectsToList | ( | struct CNObjectList * | owner, |
struct CNListItem * | prev, | ||
const struct CNObjectList * | src | ||
) |
Insert objects to the list.
owner | Destination list |
prev | Item in the owner list, the source data will be linked as the next of this. |
src | Source data list |
|
static |
Unlink an item from the list and return it's data.
owner | Destination list |
dst | Destination list item to be removed |
References CNUnlinkItemFromList(), and CNObjectList::objectList.
|
static |
Get 1st object in the list.
obj | Pointer of the 1st object |
NULL | There are not objects in the list |
dst | Source and destination list After this operation, the 1st item is removed from list |
References CNUnlinkFirstItemFromList(), and CNObjectList::objectList.
|
static |
Get last object in the list.
obj | Pointer of the 1st object |
NULL | There are not objects in the list |
dst | Source and destination list After this operation, the last item is removed from list |
References CNUnlinkLastItemFromList(), and CNObjectList::objectList.
|
inlinestatic |
Move objects from source to destination.
dst | Destination list |
src | Source list |
References CNMoveList(), and CNObjectList::objectList.
void CNAppendObjectsToList | ( | struct CNObjectList * | dst, |
struct CNObjectList * | src | ||
) |
Copy objects from source to destination.
dst | Destination list |
src | Source list |
|
static |
Search list item which has source data reference.
listitem | The list item which has source data |
NULL | There are no list item |
list | List to be searched |
obj | Source object |
References CNSearchDataInList(), and CNObjectList::objectList.
|
static |
Search object which matched source data.
listitem | The list item which mached with source data |
NULL | There are no list item |
list | List to be searched |
func | Maching function |
info | Maching information |
References CNSearchMatchedDataInList(), and CNObjectList::objectList.
CNBoolean CNDeleteObjectInList | ( | struct CNObjectList * | dst, |
struct CNObject * | obj | ||
) |
Delete object in the list.
True | Source object is found in list and it is removed |
False | Source object is NOT found in the list |
dst | Source list |
obj | Source object |