#include <nodelist.hh>
Collaboration diagram for NODE_LINK_LIST:
Public Methods | |
NODE_LINK_LIST () | |
~NODE_LINK_LIST () | |
int | add_entry (NODE_LINK *node_link_ptr) |
int | delete_entry (NODE_LINK *node_link_ptr) |
NODE_LINK * | first_node () |
NODE_LINK * | next_node () |
Private Attributes | |
NODE_LINK_LIST_ENTRY * | first |
NODE_LINK_LIST_ENTRY * | current |
int | deleting_list |
|
Definition at line 5 of file nodelist.cc. |
|
Definition at line 12 of file nodelist.cc. 00013 { 00014 NODE_LINK_LIST_ENTRY *next_entry; 00015 if (NULL != first) 00016 { 00017 current = first; 00018 while (NULL != current) 00019 { 00020 next_entry = current->next; 00021 if (NULL != current->node_link) 00022 { 00023 delete current->node_link; 00024 current->node_link = NULL; 00025 } 00026 delete current; 00027 current = next_entry; 00028 } 00029 } 00030 } |
|
Definition at line 33 of file nodelist.cc. 00034 { 00035 current = new NODE_LINK_LIST_ENTRY; 00036 if (NULL == current) 00037 { 00038 return (-1); 00039 } 00040 current->next = first; 00041 current->node_link = node_link_ptr; 00042 first = current; 00043 return (0); 00044 } |
|
Definition at line 47 of file nodelist.cc. 00048 { 00049 NODE_LINK_LIST_ENTRY *temp; 00050 NODE_LINK_LIST_ENTRY *last; 00051 00052 if (NULL != first) 00053 { 00054 if (first->node_link == node_link_ptr) 00055 { 00056 temp = first->next; 00057 if (current == first) 00058 { 00059 current = temp; 00060 } 00061 delete first; 00062 first = temp; 00063 return (0); 00064 } 00065 temp = first->next; 00066 last = first; 00067 while (NULL != temp) 00068 { 00069 if (temp->node_link == node_link_ptr) 00070 { 00071 last->next = temp->next; 00072 if (current == temp) 00073 { 00074 current = temp->next; 00075 } 00076 delete temp; 00077 return (0); 00078 } 00079 else 00080 { 00081 last = temp; 00082 temp = temp->next; 00083 } 00084 } 00085 return (-1); 00086 } 00087 return (-1); 00088 } |
|
Definition at line 91 of file nodelist.cc. |
|
Definition at line 102 of file nodelist.cc. |
|
Definition at line 17 of file nodelist.hh. |
|
Definition at line 18 of file nodelist.hh. |
|
Definition at line 19 of file nodelist.hh. |