-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopc_codes.h
More file actions
47 lines (40 loc) · 1.02 KB
/
opc_codes.h
File metadata and controls
47 lines (40 loc) · 1.02 KB
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
#ifndef __OPC_CODES_H
#define __OPC_CODES_H
#include <string>
#include <map>
#include "opcodes.h"
using namespace std;
/*
* Storage class for opc codes
*/
class opc_code{
public:
opc_code() = default;
opc_code(int code, string name, string description){
this->code = code;
this->name = name;
this->description = description;
};
int getCode(){ return code; };
string getName() { return name; };
string getDescription() { return description;};
private:
int code;
string name;
string description;
};
/*
* Class that allows search of opcs
*/
class opc_container{
public:
opc_container();
opc_code *getByCode(int code);
opc_code *getByName(string name);
private:
map <int, opc_code*> opcs_by_code;
map <string, opc_code*> opcs_by_name;
void populate();
void populate_both(int code, string name, string description);
};
#endif