started working on new Autoarr and Hashtable
This commit is contained in:
40
src/Autoarr/Autoarr2.cpp
Normal file
40
src/Autoarr/Autoarr2.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "Autoarr2.hpp"
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
template<typename T>
|
||||
Autoarr2<T>::Autoarr2() {
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T Autoarr2<T>::Get(uint32 index) {
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T *Autoarr2<T>::GetPtr(uint32 index) {
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void Autoarr2<T>::Set(uint32 index, T value) {
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void Autoarr2<T>::Add(T value) {
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Autoarr2<T>::~Autoarr2() {
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
uint32 Autoarr2<T>::Length() {
|
||||
|
||||
}
|
||||
19
src/Autoarr/Autoarr2.hpp
Normal file
19
src/Autoarr/Autoarr2.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "../base/base.h"
|
||||
|
||||
template <typename T>
|
||||
class Autoarr2 {
|
||||
uint16 blocks_count;
|
||||
uint16 block_length;
|
||||
|
||||
T** values;
|
||||
public:
|
||||
Autoarr2();
|
||||
uint32 Length();
|
||||
T Get(uint32 index);
|
||||
T* GetPtr(uint32 index);
|
||||
void Set(uint32 index, T value);
|
||||
void Add(T value);
|
||||
~Autoarr2();
|
||||
};
|
||||
@@ -4,7 +4,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../base/base.h"
|
||||
#include "hash.h"
|
||||
#include "KeyValuePair.h"
|
||||
|
||||
|
||||
35
src/Hashtable/Hashtable2.cpp
Normal file
35
src/Hashtable/Hashtable2.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "Hashtable2.hpp"
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
template<typename TKey, typename TValue>
|
||||
Hashtable2<TKey, TValue>::Hashtable2() {
|
||||
|
||||
}
|
||||
|
||||
template<typename TKey, typename TValue>
|
||||
TValue Hashtable2<TKey, TValue>::Get(TKey key) {
|
||||
|
||||
}
|
||||
|
||||
template<typename TKey, typename TValue>
|
||||
TValue Hashtable2<TKey, TValue>::GetPtr(TKey key) {
|
||||
|
||||
}
|
||||
|
||||
template<typename TKey, typename TValue>
|
||||
bool Hashtable2<TKey, TValue>::AddOrSet(TKey key, TValue) {
|
||||
|
||||
}
|
||||
|
||||
template<typename TKey, typename TValue>
|
||||
bool Hashtable2<TKey, TValue>::Remove(TKey) {
|
||||
|
||||
}
|
||||
|
||||
template<typename TKey, typename TValue>
|
||||
Hashtable2<TKey, TValue>::~Hashtable2() {
|
||||
|
||||
}
|
||||
20
src/Hashtable/Hashtable2.hpp
Normal file
20
src/Hashtable/Hashtable2.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "hash.h"
|
||||
#include "../Autoarr/Autoarr2.hpp"
|
||||
|
||||
template <typename TKey, typename TValue>
|
||||
class Hashtable2{
|
||||
uint8 hein;
|
||||
public:
|
||||
Autoarr2<TKey>* Keys;
|
||||
Autoarr2<TValue>* Values;
|
||||
|
||||
Hashtable2();
|
||||
TValue Get(TKey key);
|
||||
TValue GetPtr(TKey key);
|
||||
bool AddOrSet(TKey key, TValue);
|
||||
bool Remove(TKey);
|
||||
~Hashtable2();
|
||||
};
|
||||
|
||||
@@ -51,7 +51,9 @@ extern "C" {
|
||||
#pragma GCC error "unknown compiler"
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((void*)0)
|
||||
#endif
|
||||
|
||||
#if __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user