File: relation_roles.h

package info (click to toggle)
tilemaker 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 78,284 kB
  • sloc: cpp: 28,715; ansic: 4,052; makefile: 180; ruby: 77; sh: 6
file content (22 lines) | stat: -rw-r--r-- 540 bytes parent folder | download
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