File: relation_roles.h

package info (click to toggle)
tilemaker 3.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 83,488 kB
  • sloc: cpp: 29,461; ansic: 12,510; makefile: 229; ruby: 77; sh: 43
file content (22 lines) | stat: -rw-r--r-- 540 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef RELATION_ROLES_H
#define RELATION_ROLES_H

#include <boost/container/flat_map.hpp>
#include <mutex>
#include <vector>
#include <string>

class RelationRoles {
public:
	RelationRoles();
	uint16_t getOrAddRole(const std::string& role);
	std::string getRole(uint16_t role) const;

private:
	std::vector<std::string> popularRoleStrings;
	std::vector<std::string> rareRoleStrings;
	std::mutex mutex;
	boost::container::flat_map<std::string, uint16_t> popularRoles;
	boost::container::flat_map<std::string, uint16_t> rareRoles;
};
#endif