Oolite
Loading...
Searching...
No Matches
OOPriorityQueue.m File Reference
#include <assert.h>
import "OOFunctionAttributes.h"
import "OOPriorityQueue.h"
Include dependency graph for OOPriorityQueue.m:

Go to the source code of this file.

Classes

category  OOPriorityQueue(Private)
class  OOPriorityQueueEnumerator

Typedefs

typedef NSComparisonResult(* CompareIMP) (id self, SEL _cmd, id other)

Enumerations

enum  { kMinCapacity = 16 }

Functions

OOINLINE NSUInteger PQLeftChild (NSUInteger n) INLINE_CONST_FUNC
OOINLINE NSUInteger PQRightChild (NSUInteger n) INLINE_CONST_FUNC
OOINLINE NSUInteger PQParent (NSUInteger n) INLINE_CONST_FUNC
OOINLINE NSComparisonResult PQCompare (id a, id b, SEL comparator)

Typedef Documentation

◆ CompareIMP

typedef NSComparisonResult(* CompareIMP) (id self, SEL _cmd, id other)

Definition at line 83 of file OOPriorityQueue.m.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kMinCapacity 

Definition at line 47 of file OOPriorityQueue.m.

47 {
48 kMinCapacity = 16
49};
@ kMinCapacity

Function Documentation

◆ PQCompare()

OOINLINE NSComparisonResult PQCompare ( id a,
id b,
SEL comparator )

Definition at line 85 of file OOPriorityQueue.m.

86{
87 CompareIMP compare = NULL;
88 NSComparisonResult result;
89
90 // This is equivalent to [a performSelector:comparator withObject:b], except the resulting value isn't an object.
91 compare = (CompareIMP)[a methodForSelector:comparator];
92 result = compare(a, comparator, b);
93 return result;
94}
NSComparisonResult(* CompareIMP)(id self, SEL _cmd, id other)

References OOINLINE.

Referenced by OOPriorityQueue(Private)::bubbleDownFrom:, OOPriorityQueue(Private)::bubbleUpFrom:, and OOPriorityQueue::removeObject:.

Here is the caller graph for this function:

◆ PQLeftChild()

OOINLINE NSUInteger PQLeftChild ( NSUInteger n)

Definition at line 68 of file OOPriorityQueue.m.

69{
70 return (n << 1) + 1;
71}

References OOINLINE.

Referenced by OOPriorityQueue(Private)::bubbleDownFrom:.

Here is the caller graph for this function:

◆ PQParent()

OOINLINE NSUInteger PQParent ( NSUInteger n)

Definition at line 78 of file OOPriorityQueue.m.

79{
80 return ((n + 1) >> 1) - 1;
81}

References OOINLINE.

Referenced by OOPriorityQueue(Private)::bubbleUpFrom:.

Here is the caller graph for this function:

◆ PQRightChild()

OOINLINE NSUInteger PQRightChild ( NSUInteger n)

Definition at line 73 of file OOPriorityQueue.m.

74{
75 return (n << 1) + 2;
76}

References OOINLINE.

Referenced by OOPriorityQueue(Private)::bubbleDownFrom:.

Here is the caller graph for this function: