Containers New Features
This commit is contained in:
parent
ec2a71ccdb
commit
72a25600a2
10 changed files with 1192 additions and 0 deletions
89
Containers/outdated/tests/fat_nodes.cpp
Normal file
89
Containers/outdated/tests/fat_nodes.cpp
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
|
||||
#include "containers.h"
|
||||
|
||||
namespace tp {
|
||||
|
||||
struct AvlNode {
|
||||
|
||||
template<typename Type>
|
||||
struct EphemeralNode {
|
||||
Type mVal = NULL;
|
||||
halni mVersion = NULL;
|
||||
};
|
||||
|
||||
template<typename Type>
|
||||
struct EphemeralsContainer {
|
||||
List<EphemeralNode<Type>> mList;
|
||||
};
|
||||
|
||||
struct PesistentLink {
|
||||
static EphemeralsContainer<AvlNode*> sContainer;
|
||||
EphemeralNode<AvlNode*>* mNode = NULL;
|
||||
PesistentLink& operator=(const PesistentLink& field) {
|
||||
}
|
||||
PesistentLink& operator=(AvlNode* val) {
|
||||
}
|
||||
//Type& operator->() { return mNode->mVal; }
|
||||
//const ListIterator& operator*() { return *this; }
|
||||
operator AvlNode*() {
|
||||
}
|
||||
};
|
||||
|
||||
struct PesistentValue {
|
||||
static EphemeralsContainer<halni> sContainer;
|
||||
EphemeralNode<halni>* mNode = NULL;
|
||||
PesistentLink& operator=(const PesistentLink& field) {}
|
||||
PesistentLink& operator=(halni val) {}
|
||||
operator halni() {
|
||||
}
|
||||
};
|
||||
|
||||
PesistentLink mLeft;
|
||||
PesistentLink mRight;
|
||||
PesistentLink mParent;
|
||||
PesistentValue mHeight;
|
||||
|
||||
PesistentValue mVal;
|
||||
halni mRefCount = 0;
|
||||
|
||||
AvlNode() { mVal = 0; }
|
||||
AvlNode(halni aKey) {
|
||||
mVal = aKey;
|
||||
}
|
||||
|
||||
bool disentRight(halni aKey) {
|
||||
return aKey > mVal;
|
||||
}
|
||||
|
||||
bool disentLeft(halni aKey) {
|
||||
return aKey < mVal;
|
||||
}
|
||||
|
||||
bool exactNode(halni aKey) {
|
||||
return aKey == mVal;
|
||||
}
|
||||
|
||||
halni getFindKey(AvlNode* node = NULL) {
|
||||
return mVal;
|
||||
}
|
||||
|
||||
void copyData(const AvlNode& in) {
|
||||
mVal = in.mVal;
|
||||
}
|
||||
|
||||
halni keyInRightSubtree(halni key) { return key; }
|
||||
halni keyInLeftSubtree(halni key) { return key; }
|
||||
|
||||
void updateTreeCahceCallBack() {}
|
||||
|
||||
void* operator new(std::size_t) {
|
||||
}
|
||||
|
||||
void operator delete(void* p) {
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void fat_nodes_test() {
|
||||
tp::AvlTree<tp::AvlNode, tp::halni> avl;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue