Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

listNode.h File Reference


Detailed Description

Amiga-style doubly linked list functions.

Definition in file listNode.h.

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

struct  lnMinNode
 Basic node structure that is used for doubly linked list. More...
struct  lnNode
 Extended node structure that is used for doubly linked lists that can be ordered by priority. More...
struct  lnMinList
 A combined head and tail for lists that contain lnMinNode's. More...
struct  lnList
 A combined head and tail for lists that contain lnNode's. More...

Defines

#define lnEmptyList(list)   ((struct lnMinNode *)(list)->lh_TailPred == (struct lnMinNode *)(list))
 Check if a list is empty.

Functions

void lnRemove (struct lnMinNode *node)
 Remove a node from the list.
void lnNewList (struct lnMinList *list)
 Initialize a list.
void lnMoveList (struct lnMinList *dest, struct lnMinList *src)
 Transfer the nodes on src to dest, overwriting any nodes on dest.
void lnAppendList (struct lnMinList *dest, struct lnMinList *src)
 Append the nodes from src to dest.
void lnAddHead (struct lnMinList *list, struct lnMinNode *node)
 Add a node to the head of the list.
void lnAddTail (struct lnMinList *list, struct lnMinNode *node)
 Add a node to the tail of the list.
lnMinNodelnRemHead (struct lnMinList *list)
 Remove and return the node at the head of the list, or NULL if the list is empty.
lnMinNodelnRemTail (struct lnMinList *list)
 Remove and return the node at the tail of the list, or NULL if the list is empty.
void lnInsert (struct lnMinNode *pred, struct lnMinNode *node)
 Insert a node at a specific position in a list.
void lnEnqueue (struct lnList *list, struct lnNode *node)
 Insert a node into a prioritized list.
lnNodelnFindName (struct lnList *list, const char *name)
 Find a node with the given name.
unsigned int lnCountNodes (struct lnMinList *list)
 Count the number of nodes in a list.


Define Documentation

#define lnEmptyList list   )     ((struct lnMinNode *)(list)->lh_TailPred == (struct lnMinNode *)(list))
 

Check if a list is empty.

Parameters:
list The list to check.
Returns:
True if the list is empty.

Definition at line 134 of file listNode.h.

Referenced by lnAppendList().


Function Documentation

void lnAddHead struct lnMinList list,
struct lnMinNode node
 

Add a node to the head of the list.

Parameters:
list The list object the node is to be added to.
node The node to add.

Definition at line 92 of file listNode.c.

References lnMinList::lh_Head, lnMinNode::ln_Pred, lnMinNode::ln_Succ, and require.

Referenced by StrictPolicyImpl::RedistributeCPU(), and WeightedPolicyImpl::RedistributeCPU().

void lnAddTail struct lnMinList list,
struct lnMinNode node
 

Add a node to the tail of the list.

Parameters:
list The list object the node is to be added to.
node The node to add.

Definition at line 105 of file listNode.c.

References lnMinList::lh_Tail, lnMinList::lh_TailPred, lnMinNode::ln_Pred, lnMinNode::ln_Succ, and require.

Referenced by ManagerImpl::AddTask(), PartitionPolicyImpl::AddTask(), WeightedPolicyImpl::AddTask(), cpCreateChildProcess(), lnEnqueue(), StrictPolicyImpl::RedistributeCPU(), WeightedPolicyImpl::RedistributeCPU(), and rk_resource_set_create().

void lnAppendList struct lnMinList dest,
struct lnMinList src
 

Append the nodes from src to dest.

Parameters:
dest The destination list object.
src The source list object.

Definition at line 74 of file listNode.c.

References lnMinList::lh_Head, lnMinList::lh_Tail, lnMinList::lh_TailPred, lnMinNode::ln_Pred, lnMinNode::ln_Succ, lnEmptyList, lnNewList(), and require.

Here is the call graph for this function:

unsigned int lnCountNodes struct lnMinList list  ) 
 

Count the number of nodes in a list.

Parameters:
list The list to scan.
Returns:
The number of nodes in the list.

Definition at line 220 of file listNode.c.

References lnMinList::lh_Head, lnMinNode::ln_Succ, and require.

Referenced by ManagerImpl::GetTaskList(), PartitionPolicyImpl::GetTaskList(), StrictPolicyImpl::GetTaskList(), and WeightedPolicyImpl::GetTaskList().

void lnEnqueue struct lnList list,
struct lnNode node
 

Insert a node into a prioritized list.

Parameters:
list An ordered list.
node The node to insert.

Definition at line 174 of file listNode.c.

References lnList::lh_Head, lnNode::ln_Pred, lnNode::ln_Pri, lnNode::ln_Succ, lnAddTail(), lnInsert(), and require.

Referenced by StrictPolicyImpl::AddTask(), and StrictPolicyImpl::SetTaskPriority().

Here is the call graph for this function:

struct lnNode* lnFindName struct lnList list,
const char *  name
 

Find a node with the given name.

Parameters:
list The list to search.
name The name to search for.
Returns:
The first node in the list that matches the given name or NULL if no match could be found.

Definition at line 199 of file listNode.c.

References lnList::lh_Head, lnNode::ln_Name, lnNode::ln_Succ, and require.

void lnInsert struct lnMinNode pred,
struct lnMinNode node
 

Insert a node at a specific position in a list.

Parameters:
pred The node in the list that the new node should be inserted after.
node The node to insert.

Definition at line 161 of file listNode.c.

References lnMinNode::ln_Pred, lnMinNode::ln_Succ, and require.

Referenced by lnEnqueue().

void lnMoveList struct lnMinList dest,
struct lnMinList src
 

Transfer the nodes on src to dest, overwriting any nodes on dest.

Parameters:
dest The destination list object.
src The source list object.

Definition at line 60 of file listNode.c.

References lnMinList::lh_Head, lnMinList::lh_Tail, lnMinList::lh_TailPred, lnMinNode::ln_Pred, lnMinNode::ln_Succ, lnNewList(), and require.

Here is the call graph for this function:

void lnNewList struct lnMinList list  ) 
 

Initialize a list.

Parameters:
list The list object to initialize.

Definition at line 49 of file listNode.c.

References lnMinList::lh_Head, lnMinList::lh_Tail, lnMinList::lh_TailPred, and require.

Referenced by cpInitChildProcessData(), lnAppendList(), lnMoveList(), ManagerImpl::ManagerImpl(), PartitionPolicyImpl::PartitionPolicyImpl(), StrictPolicyImpl::RedistributeCPU(), WeightedPolicyImpl::RedistributeCPU(), rk_stub_set_mode(), StrictPolicyImpl::StrictPolicyImpl(), and WeightedPolicyImpl::WeightedPolicyImpl().

struct lnMinNode* lnRemHead struct lnMinList list  ) 
 

Remove and return the node at the head of the list, or NULL if the list is empty.

Parameters:
list A valid list object.
Returns:
The node at the head of 'list', or NULL if the list is empty.

Definition at line 118 of file listNode.c.

References lnMinList::lh_Head, lnMinNode::ln_Pred, lnMinNode::ln_Succ, and require.

Referenced by cpKillChildProcessData().

void lnRemove struct lnMinNode node  ) 
 

Remove a node from the list.

Parameters:
node The node to remove.

Definition at line 32 of file listNode.c.

References lnMinNode::ln_Pred, lnMinNode::ln_Succ, and require.

Referenced by cpDeleteChildProcess(), ManagerImpl::RemoveTask(), PartitionPolicyImpl::RemoveTask(), StrictPolicyImpl::RemoveTask(), WeightedPolicyImpl::RemoveTask(), ManagerImpl::RepairTaskList(), PartitionPolicyImpl::RepairTaskList(), StrictPolicyImpl::RepairTaskList(), WeightedPolicyImpl::RepairTaskList(), rk_resource_set_destroy(), and StrictPolicyImpl::SetTaskPriority().

struct lnMinNode* lnRemTail struct lnMinList list  ) 
 

Remove and return the node at the tail of the list, or NULL if the list is empty.

Parameters:
list A valid list object.
Returns:
The node at the tail of 'list', or NULL if the list is empty.

Definition at line 139 of file listNode.c.

References lnMinList::lh_Tail, lnMinList::lh_TailPred, lnMinNode::ln_Pred, lnMinNode::ln_Succ, and require.


Generated on Fri Oct 22 07:50:36 2004 for CPU Broker by  doxygen 1.3.9.1