summaryrefslogtreecommitdiff
path: root/lib/PCommon.cc
blob: 20299ba62c4c278068501bfb865153ea8f7baeaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <stdio.h>
#include "config.h"
#include "PCommon.h"

PriorityList::PriorityList(Key_t IKey, Datas_t const &IDatas):Key(IKey),
Datas(IDatas)
{
}

PriorityList::PriorityList(void):Key(0), Datas(NULL)
{
}

PriorityList::~PriorityList(void){}

Key_t PriorityList::ReadKey(Cell C)
{
	return ((PriorityList *) C)->Key;
}

Datas_t PriorityList::ReadDatas(Cell C)
{
	return ((PriorityList *) C)->Datas;
}

int PriorityList::n(void)
{
	return Key;
}

PriorityList *PriorityList::GenericUnion(PriorityList * P)
{
	Key_t IKey;
	Datas_t IDatas;

	while (!(P->IsEmpty())) {
		IKey = P->Extract_Min(IDatas);
		Insert(IKey, IDatas);
	}
}

int PriorityList::GetType(void) {
  return type;
}