Simutrans-Squirrel-API
Classes | Public Member Functions | List of all members
simple_heap_x Class Reference

Classes

class  node_x
 

Public Member Functions

void clear ()
 Clears the heap.
 
void insert (integer weight, integer value)
 
bool is_empty ()
 
integer len ()
 
void pop ()
 
 simple_heap_x ()
 

Detailed Description

Exports a binary heap structure with with simple nodes.

Definition at line 6 of file api_pathfinding.cc.

Constructor & Destructor Documentation

◆ simple_heap_x()

simple_heap_x::simple_heap_x ( )

Constructor

Member Function Documentation

◆ insert()

void simple_heap_x::insert ( integer  weight,
integer  value 
)

Inserts a node into the heap.

Parameters
weightheap is sorted with respect to weight
valuethe data to be stored

◆ is_empty()

bool simple_heap_x::is_empty ( )
Returns
true when heap is empty

◆ len()

integer simple_heap_x::len ( )
Returns
number of nodes in heap

◆ pop()

void simple_heap_x::pop ( )

Pops the top node of the heap. Raises error if heap is empty.

Returns
top node

The documentation for this class was generated from the following file: