Welcome to mirror list, hosted at ThFree Co, Russian Federation.

MyMap.h « Common « CPP - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cbcbadd6fcc14a4f10673863ed85741decee8319 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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<CNode> 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