diff --git a/src/Autoarr/Autoarr2.hpp b/src/Autoarr2/Autoarr2.hpp similarity index 97% rename from src/Autoarr/Autoarr2.hpp rename to src/Autoarr2/Autoarr2.hpp index 6ca15b9..ad7da69 100644 --- a/src/Autoarr/Autoarr2.hpp +++ b/src/Autoarr2/Autoarr2.hpp @@ -1,15 +1,11 @@ -// -// -// - #pragma once #include "../base/base.h" template class Autoarr2 { -public: T** values; +public: uint16 blocks_count; uint16 block_length; uint16 max_block_length; diff --git a/src/Autoarr/Autoarr2_instances.cpp b/src/Autoarr2/Autoarr2_instances.cpp similarity index 100% rename from src/Autoarr/Autoarr2_instances.cpp rename to src/Autoarr2/Autoarr2_instances.cpp diff --git a/src/Autoarr/Autoarr2_methods.hpp b/src/Autoarr2/Autoarr2_methods.hpp similarity index 100% rename from src/Autoarr/Autoarr2_methods.hpp rename to src/Autoarr2/Autoarr2_methods.hpp diff --git a/src/Hashtable/Hashtable2.hpp b/src/Hashtable/Hashtable2.hpp deleted file mode 100644 index bfd3eac..0000000 --- a/src/Hashtable/Hashtable2.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// -// - -#pragma once - -#include "hash.h" -#include "../Autoarr/Autoarr2.hpp" - -template -class Hashtable2{ - uint8 hein; -public: - Autoarr2* Keys; - Autoarr2* Values; - - Hashtable2(); - TValue Get(TKey key); - TValue GetPtr(TKey key); - bool AddOrSet(TKey key, TValue); - bool Remove(TKey); - ~Hashtable2(); -}; - diff --git a/src/Hashtable2/Hashtable2.hpp b/src/Hashtable2/Hashtable2.hpp new file mode 100644 index 0000000..d055149 --- /dev/null +++ b/src/Hashtable2/Hashtable2.hpp @@ -0,0 +1,19 @@ +#pragma once + +#include "../Hashtable/hash.h" +#include "../Autoarr2/Autoarr2.hpp" + +template +class Hashtable2{ + uint8 hein; +public: + Autoarr2* keys; + Autoarr2* values; + + Hashtable2(); + TValue get(TKey key); + TValue getptr(TKey key); + bool addOrSet(TKey key, TValue); + bool remove(TKey); + virtual ~Hashtable2(); +}; diff --git a/src/Hashtable/Hashtable2.cpp b/src/Hashtable2/Hashtable2_methods.hpp similarity index 62% rename from src/Hashtable/Hashtable2.cpp rename to src/Hashtable2/Hashtable2_methods.hpp index 93486d1..9aa4b92 100644 --- a/src/Hashtable/Hashtable2.cpp +++ b/src/Hashtable2/Hashtable2_methods.hpp @@ -1,3 +1,5 @@ +#pragma once + #include "Hashtable2.hpp" template @@ -6,22 +8,22 @@ Hashtable2::Hashtable2() { } template -TValue Hashtable2::Get(TKey key) { +TValue Hashtable2::get(TKey key) { + +} + +template +TValue Hashtable2::getptr(TKey key) { } template -TValue Hashtable2::GetPtr(TKey key) { +bool Hashtable2::addOrSet(TKey key, TValue) { } template -bool Hashtable2::AddOrSet(TKey key, TValue) { - -} - -template -bool Hashtable2::Remove(TKey) { +bool Hashtable2::remove(TKey) { } diff --git a/tests/test_autoarr2.cpp b/tests/test_autoarr2.cpp index f19957b..cf19f6b 100644 --- a/tests/test_autoarr2.cpp +++ b/tests/test_autoarr2.cpp @@ -1,21 +1,10 @@ #include "tests.h" -#include "../src/Autoarr/Autoarr2.hpp" +#include "../src/Autoarr2/Autoarr2.hpp" #define maxlength 160 void printautoarr2(Autoarr2* ar){ - printf("\e[94mAutoarr2: " - IFWIN("%llu", "%lu") - "\n blocks_count: %u\n" - " max_block_length: %u\n" - " block_length: %u\n" - " length: %u\n", - sizeof(Autoarr2), - ar->blocks_count, - ar->max_block_length, - ar->block_length, - ar->length); } void fillar2(Autoarr2* ar){ @@ -35,7 +24,7 @@ void printallval2(Autoarr2* ar){ } void test_autoarr2(){ - optime("test_autoarr",1,({ + optime("test_autoarr2",1,({ printf("\e[96m------------[test_autoarr2]-----------\n"); Autoarr2* ar=new Autoarr2(16); printf("\e[92mautoarr2 created\n");