/usr/include/blasr/datastructures/alignment/CmpIndexedStringTable.h is in libblasr-dev 0~20151014+gitbe5d1bf-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | #ifndef DATASTRUCTURES_ALIGNMENT_CMP_INDEXED_STRING_TABLE_H_
#define DATASTRUCTURES_ALIGNMENT_CMP_INDEXED_STRING_TABLE_H_
#include <vector>
#include <string>
#include <map>
using namespace std;
class CmpIndexedStringTable {
public:
void resize(int size) {
names.resize(size);
ids.resize(size);
}
void StoreArrayIndexMap() {
int i;
for (i = 0; i < ids.size(); i++) {
idToArrayIndex[ids[i]] = i;
}
}
//
// The terminology of Index here is confusing.
// Actually 'Index' is equivalent to 'id'.
// Each id represents index of an indexed string.
// That's why an id is called an 'Index' in this function.
// GetNameAtIndex returns name of an indexed string,
// whose index is the given value
//
bool GetNameAtIndex(int index, string &name) {
map<int,int>::iterator mapIt;
mapIt = idToArrayIndex.find(index);
if (mapIt != idToArrayIndex.end()) {
name = names[mapIt->second];
return true;
}
else {
return false;
}
}
//
// Here 'Id' means indexes of indexed strings,
// 'Index' means index of an 'Id' in ids
//
bool GetIndexOfId(int id, int &index) {
map<int,int>::iterator mapIt;
mapIt = idToArrayIndex.find(id);
if (mapIt != idToArrayIndex.end()) {
index = mapIt->second;
return true;
}
else {
return false;
}
}
vector<int> ids;
vector<string> names;
map<int,int> idToArrayIndex;
};
#endif
|