Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef DICT
- #define DICT
- #include <unordered_set>
- #include "bit_utils.h"
- class byte_dict
- {
- public:
- byte_dict();
- /* fill the dictionary with the indexes of the bytes, return number of bytes inserted */
- int fill(bits b, int index);
- /* return the set of indexes of a byte*/
- std::unordered_set<int> get(byte b);
- /* remove all entries < min, return entries removed*/
- int remove(int min);
- /* remove elements < offset and decrement all entries by offset */
- int update(int offset);
- int size();
- private:
- std::unordered_set<int> dict[256];
- int load;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment