started working on new Autoarr and Hashtable
This commit is contained in:
parent
745ae56aad
commit
343d23dc26
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
@ -12,7 +12,9 @@
|
|||||||
<inspection_tool class="EmptyDeclOrStmt" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="EmptyDeclOrStmt" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="GrazieInspection" enabled="false" level="TYPO" enabled_by_default="false" />
|
<inspection_tool class="GrazieInspection" enabled="false" level="TYPO" enabled_by_default="false" />
|
||||||
<inspection_tool class="LanguageDetectionInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="LanguageDetectionInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="Misra" enabled="true" level="WARNING" enabled_by_default="true" />
|
<inspection_tool class="Misra" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="myMisraCPPChecks" value="clion-misra-cpp2008-*,-clion-misra-cpp2008-11-0-1" />
|
||||||
|
</inspection_tool>
|
||||||
<inspection_tool class="OCUnusedGlobalDeclaration" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="OCUnusedGlobalDeclaration" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||||
<option name="processCode" value="true" />
|
<option name="processCode" value="true" />
|
||||||
|
|||||||
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" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../base/base.h"
|
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
#include "KeyValuePair.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"
|
#pragma GCC error "unknown compiler"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL ((void*)0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user