Simutrans-Squirrel-API OTRP v63_4
Loading...
Searching...
No Matches
simple_heap_x Class Reference

Classes

class  node_x

Public Member Functions

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

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()

simple_heap_x::node_x 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: