-
Notifications
You must be signed in to change notification settings - Fork 0
/
fibnodebase.h
38 lines (32 loc) · 1.16 KB
/
fibnodebase.h
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
#ifndef FIBNODEBASE_H
#define FIBNODEBASE_H
template <class Derived>
class FibNodeBase
{
public:
FibNodeBase();
FibNodeBase(int k);
FibNodeBase(int k, int d, bool m);
~FibNodeBase();
FibNodeBase *Child;
FibNodeBase *Prev;
FibNodeBase *Next;
FibNodeBase *Parent;
int key;
int degree;
bool mark;
inline Derived *child() const { return static_cast<Derived *>(this->Child); }
inline Derived *parent() const { return static_cast<Derived *>(this->Parent); }
inline Derived *next() const { return static_cast<Derived *>(this->Next); }
inline Derived *prev() const { return static_cast<Derived *>(this->Prev); }
inline void insertAfter(FibNodeBase *newFNode);
inline void insertAfter(FibNodeBase *newFNode, FibNodeBase *newFNodeLast); // splice
inline void insertBefore(FibNodeBase *newFNode);
inline void insertBefore(FibNodeBase *newFNode, FibNodeBase *newFNodeLast); // splice
inline bool unlink(); // FNode not derstroyed, returns
inline void unlink2();
inline void unChild();
inline void makeChild(FibNodeBase *child);
inline void makeChildLink(FibNodeBase *child);
};
#endif // FIBNODEBASE_H