forked from marbl/Mash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HashList.h
39 lines (31 loc) · 1.01 KB
/
HashList.h
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
29
30
31
32
33
34
35
36
37
38
39
// Copyright © 2015, Battelle National Biodefense Institute (BNBI);
// all rights reserved. Authored by: Brian Ondov, Todd Treangen,
// Sergey Koren, and Adam Phillippy
//
// See the LICENSE.txt file included with this software for license information.
#ifndef HashList_h
#define HashList_h
#include "hash.h"
#include <vector>
class HashList
{
public:
HashList() {use64 = true;}
HashList(bool use64new) {use64 = use64new;}
hash_u at(int index) const;
void clear();
void resize(int size);
void set32(int index, uint32_t value);
void set64(int index, uint64_t value);
void setUse64(bool use64New) {use64 = use64New;}
int size() const {return use64 ? hashes64.size() : hashes32.size();}
void sort();
void push_back32(hash32_t hash) {hashes32.push_back(hash);}
void push_back64(hash64_t hash) {hashes64.push_back(hash);}
bool get64() const {return use64;}
private:
bool use64;
std::vector<hash32_t> hashes32;
std::vector<hash64_t> hashes64;
};
#endif