blob: 72dcc1be6298ed5a79db6ff51869b2628652b62a (
plain)
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
|
#pragma once
#include "../base/assert.hpp"
#include "../std/vector.hpp"
#include "../std/map.hpp"
#include "../std/iostream.hpp"
class IndexAndTypeMapping
{
vector<uint32_t> m_types;
typedef map<uint32_t, uint32_t> MapT;
MapT m_map;
void Add(uint32_t ind, uint32_t type);
public:
void Load(istream & s);
uint32_t GetType(uint32_t ind) const
{
ASSERT_LESS ( ind, m_types.size(), () );
return m_types[ind];
}
uint32_t GetIndex(uint32_t t) const;
/// For Debug purposes only.
bool HasIndex(uint32_t t) const { return (m_map.find(t) != m_map.end()); }
};
|