-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathAProtocol.hpp
More file actions
52 lines (43 loc) · 789 Bytes
/
AProtocol.hpp
File metadata and controls
52 lines (43 loc) · 789 Bytes
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
48
49
50
51
52
#ifndef __APROTOCOL__
#define __APROTOCOL__
class Core;
class ANetwork;
namespace Protocol
{
enum error_code
{
OK,
ALREADY_EXIST,
DOESNT_EXIST,
NOT_IMPLEMENTED,
CANT_ADD,
NO_NAME,
NO_FROM,
NO_TO,
NO_TYPE,
NO_COMMAND,
ERROR_CODE_SIZE
};
class AProtocol
{
public:
AProtocol(){}
~AProtocol(){}
void set_core(Core* c)
{
this->__core = c;
}
void set_network(ANetwork* n)
{
this->__network = n;
}
virtual std::string interpret(std::string const& command) = 0;
protected:
Core* __core;
ANetwork* __network;
private:
AProtocol(const AProtocol&);
AProtocol& operator=(const AProtocol&);
};
}
#endif /* __APROTOCOL__ */