classes moved to separate dirs

This commit is contained in:
Timerix22 2022-06-02 21:16:22 +03:00
parent 358ec7d262
commit 6c0b23f256
7 changed files with 32 additions and 50 deletions

View File

@ -1,15 +1,11 @@
//
//
//
#pragma once
#include "../base/base.h"
template <typename T>
class Autoarr2 {
public:
T** values;
public:
uint16 blocks_count;
uint16 block_length;
uint16 max_block_length;

View File

@ -1,24 +0,0 @@
//
//
//
#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();
};

View File

@ -0,0 +1,19 @@
#pragma once
#include "../Hashtable/hash.h"
#include "../Autoarr2/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);
virtual ~Hashtable2();
};

View File

@ -1,3 +1,5 @@
#pragma once
#include "Hashtable2.hpp"
template<typename TKey, typename TValue>
@ -6,22 +8,22 @@ Hashtable2<TKey, TValue>::Hashtable2() {
}
template<typename TKey, typename TValue>
TValue Hashtable2<TKey, TValue>::Get(TKey key) {
TValue Hashtable2<TKey, TValue>::get(TKey key) {
}
template<typename TKey, typename TValue>
TValue Hashtable2<TKey, TValue>::getptr(TKey key) {
}
template<typename TKey, typename TValue>
TValue Hashtable2<TKey, TValue>::GetPtr(TKey key) {
bool Hashtable2<TKey, TValue>::addOrSet(TKey key, TValue) {
}
template<typename TKey, typename TValue>
bool Hashtable2<TKey, TValue>::AddOrSet(TKey key, TValue) {
}
template<typename TKey, typename TValue>
bool Hashtable2<TKey, TValue>::Remove(TKey) {
bool Hashtable2<TKey, TValue>::remove(TKey) {
}

View File

@ -1,21 +1,10 @@
#include "tests.h"
#include "../src/Autoarr/Autoarr2.hpp"
#include "../src/Autoarr2/Autoarr2.hpp"
#define maxlength 160
void printautoarr2(Autoarr2<uint16>* ar){
printf("\e[94mAutoarr2<uint16>: "
IFWIN("%llu", "%lu")
"\n blocks_count: %u\n"
" max_block_length: %u\n"
" block_length: %u\n"
" length: %u\n",
sizeof(Autoarr2<uint16>),
ar->blocks_count,
ar->max_block_length,
ar->block_length,
ar->length);
}
void fillar2(Autoarr2<uint16>* ar){
@ -35,7 +24,7 @@ void printallval2(Autoarr2<uint16>* ar){
}
void test_autoarr2(){
optime("test_autoarr",1,({
optime("test_autoarr2",1,({
printf("\e[96m------------[test_autoarr2]-----------\n");
Autoarr2<uint16>* ar=new Autoarr2<uint16>(16);
printf("\e[92mautoarr2 created\n");