smrtlink/src/table.cpp

26 lines
418 B
C++
Raw Normal View History

2016-01-16 22:33:04 +00:00
/*
* lookupTable.h
*
* Created on: 11.10.2015
* Author: jdi
*/
#include <string>
#include "table.h"
table::table(std::initializer_list<set> l) {
int i = 0;
for (set s : l) {
2016-01-21 03:58:21 +00:00
this->left[s.type] = s;
2016-01-16 22:33:04 +00:00
}
}
2016-01-21 03:58:21 +00:00
table::set table::operator[](short n){
return this->left[n];
2016-01-16 22:33:04 +00:00
}
2016-01-17 00:01:49 +00:00
bool table::exists(short n){
2016-01-16 22:33:04 +00:00
return !(left.find(n) == left.end());
}
2016-01-21 03:58:21 +00:00
std::string table::name(short n){
return this->left[n].name;
2016-01-16 22:33:04 +00:00
}