From f19f813537c7aea1c20749c914e756b54a9c3cf5 Mon Sep 17 00:00:00 2001 From: Igor Pavlov <87184205+ip7z@users.noreply.github.com> Date: Mon, 27 Dec 2021 00:00:00 +0000 Subject: '21.07' --- CPP/Common/MyMap.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 CPP/Common/MyMap.h (limited to 'CPP/Common/MyMap.h') diff --git a/CPP/Common/MyMap.h b/CPP/Common/MyMap.h new file mode 100644 index 0000000..cbcbadd --- /dev/null +++ b/CPP/Common/MyMap.h @@ -0,0 +1,28 @@ +// MyMap.h + +#ifndef __COMMON_MYMAP_H +#define __COMMON_MYMAP_H + +#include "MyTypes.h" +#include "MyVector.h" + +class CMap32 +{ + struct CNode + { + UInt32 Key; + UInt32 Keys[2]; + UInt32 Values[2]; + UInt16 Len; + Byte IsLeaf[2]; + }; + CRecordVector Nodes; + +public: + + void Clear() { Nodes.Clear(); } + bool Find(UInt32 key, UInt32 &valueRes) const throw(); + bool Set(UInt32 key, UInt32 value); // returns true, if there is such key already +}; + +#endif -- cgit v1.2.3-55-g6feb