-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstdinout.cpp
97 lines (78 loc) · 1.29 KB
/
stdinout.cpp
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include "stdinout.h"
#include"cmdcheck.h"
inputchannel::inputchannel()
{
}
inputchannel::~inputchannel()
{
}
bool inputchannel::Init()
{
return true;
}
bool inputchannel::ReadFd(std::string &_input)
{
cin >> _input;
return true;
}
bool inputchannel::WriteFd(std::string &_output)
{
return false;
}
void inputchannel::Fini()
{
}
int inputchannel::GetFd()
{
return 0;
}
std::string inputchannel::GetChannelInfo()
{
return std::string("stdin");
}
AZinxHandler *inputchannel::GetInputNextStage(BytesMsg &_oInput)
{
return cmdcheck::getInstance();
}
outputchannel::outputchannel()
{
}
outputchannel::~outputchannel()
{
}
bool outputchannel::Init()
{
return true;
}
bool outputchannel::ReadFd(std::string &_input)
{
return false;
}
bool outputchannel::WriteFd(std::string &_output)
{
cout << _output << endl;
return true;
}
void outputchannel::Fini()
{
}
int outputchannel::GetFd()
{
return 1;
}
std::string outputchannel::GetChannelInfo()
{
return string("stdout");
}
AZinxHandler *outputchannel::GetInputNextStage(BytesMsg &_oInput)
{
return nullptr;
}
AZinxHandler *mytcpdata::GetInputNextStage(BytesMsg &_oInput)
{
return cmdcheck::getInstance();
}
ZinxTcpData *mytcpfact::CreateTcpDataChannel(int _fd)
{
return new mytcpdata(_fd);
}