libiec61850
1.2.0
|
Data Structures | |
struct | LinkedList |
Reference to a linked list or to a linked list element. More... | |
Typedefs | |
typedef void(* | LinkedListValueDeleteFunction) (void *) |
Functions | |
LinkedList | LinkedList_create (void) |
Create a new LinkedList object. More... | |
void | LinkedList_destroy (LinkedList self) |
Delete a LinkedList object. More... | |
void | LinkedList_destroyDeep (LinkedList self, LinkedListValueDeleteFunction valueDeleteFunction) |
Delete a LinkedList object. More... | |
void | LinkedList_destroyStatic (LinkedList self) |
Delete a LinkedList object without freeing the element data. More... | |
void | LinkedList_add (LinkedList self, void *data) |
Add a new element to the list. More... | |
bool | LinkedList_contains (LinkedList self, void *data) |
Check if the specified data is contained in the list. More... | |
bool | LinkedList_remove (LinkedList self, void *data) |
Removed the specified element from the list. More... | |
LinkedList | LinkedList_get (LinkedList self, int index) |
Get the list element specified by index (starting with 0). More... | |
LinkedList | LinkedList_getNext (LinkedList self) |
Get the next element in the list (iterator). More... | |
LinkedList | LinkedList_getLastElement (LinkedList self) |
Get the last element in the list. More... | |
LinkedList | LinkedList_insertAfter (LinkedList listElement, void *data) |
Insert a new element int the list. More... | |
int | LinkedList_size (LinkedList self) |
Get the size of the list. More... | |
void * | LinkedList_getData (LinkedList self) |
void | LinkedList_printStringList (LinkedList self) |
typedef void(* LinkedListValueDeleteFunction) (void *) |
void LinkedList_add | ( | LinkedList | self, |
void * | data | ||
) |
Add a new element to the list.
This function will add a new data element to the list. The new element will the last element in the list.
self | the LinkedList instance |
data | data to append to the LinkedList instance |
bool LinkedList_contains | ( | LinkedList | self, |
void * | data | ||
) |
Check if the specified data is contained in the list.
self | the LinkedList instance |
data | data to remove from the LinkedList instance |
LinkedList LinkedList_create | ( | void | ) |
Create a new LinkedList object.
void LinkedList_destroy | ( | LinkedList | self | ) |
Delete a LinkedList object.
This function destroy the LinkedList object. It will free all data structures used by the LinkedList instance. It will call free for all elements of the linked list. This function should only be used if simple objects (like dynamically allocated strings) are stored in the linked list.
self | the LinkedList instance |
void LinkedList_destroyDeep | ( | LinkedList | self, |
LinkedListValueDeleteFunction | valueDeleteFunction | ||
) |
Delete a LinkedList object.
This function destroy the LinkedList object. It will free all data structures used by the LinkedList instance. It will call a user provided function for each data element. This user provided function is responsible to properly free the data element.
self | the LinkedList instance |
valueDeleteFunction | a function that is called for each data element of the LinkedList with the pointer to the linked list data element. |
void LinkedList_destroyStatic | ( | LinkedList | self | ) |
Delete a LinkedList object without freeing the element data.
This function should be used statically allocated data objects are stored in the LinkedList instance. Other use cases would be if the data elements in the list should not be deleted.
self | the LinkedList instance |
LinkedList LinkedList_get | ( | LinkedList | self, |
int | index | ||
) |
Get the list element specified by index (starting with 0).
self | the LinkedList instance |
index | index of the requested element. |
void* LinkedList_getData | ( | LinkedList | self | ) |
LinkedList LinkedList_getLastElement | ( | LinkedList | self | ) |
Get the last element in the list.
listElement | the LinkedList instance |
LinkedList LinkedList_getNext | ( | LinkedList | self | ) |
Get the next element in the list (iterator).
self | the LinkedList instance |
LinkedList LinkedList_insertAfter | ( | LinkedList | listElement, |
void * | data | ||
) |
Insert a new element int the list.
listElement | the LinkedList instance |
void LinkedList_printStringList | ( | LinkedList | self | ) |
bool LinkedList_remove | ( | LinkedList | self, |
void * | data | ||
) |
Removed the specified element from the list.
self | the LinkedList instance |
data | data to remove from the LinkedList instance |
int LinkedList_size | ( | LinkedList | self | ) |
Get the size of the list.
self | the LinkedList instance |