summaryrefslogtreecommitdiff
path: root/lib/PCommon.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PCommon.cc')
-rw-r--r--lib/PCommon.cc44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/PCommon.cc b/lib/PCommon.cc
new file mode 100644
index 0000000..20299ba
--- /dev/null
+++ b/lib/PCommon.cc
@@ -0,0 +1,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;
+}