1 |
#include "System.h"
|
2 |
#include <iostream.h>
|
3 |
#include "../NetWork/MutexHandler.h"
|
4 |
#include "SystemDefine.h"
|
5 |
|
6 |
System::System(){}
|
7 |
|
8 |
System::~System(){}
|
9 |
|
10 |
void System::println(const String &string)
|
11 |
{
|
12 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
13 |
|
14 |
pthread_mutex_lock(&mut);
|
15 |
|
16 |
if (string.buffer != null)
|
17 |
{
|
18 |
cout << string.buffer << endl;
|
19 |
}
|
20 |
|
21 |
pthread_mutex_unlock(&mut);
|
22 |
}
|
23 |
|
24 |
void System::print(const String &string)
|
25 |
{
|
26 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
27 |
|
28 |
pthread_mutex_lock(&mut);
|
29 |
|
30 |
if (string.buffer != null)
|
31 |
{
|
32 |
cout << string.buffer;
|
33 |
}
|
34 |
|
35 |
pthread_mutex_unlock(&mut);
|
36 |
}
|
37 |
|
38 |
void System::println(String *string)
|
39 |
{
|
40 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
41 |
|
42 |
pthread_mutex_lock(&mut);
|
43 |
|
44 |
if (string!=null)
|
45 |
{
|
46 |
if (string->buffer != null)
|
47 |
{
|
48 |
cout << string->buffer << endl;
|
49 |
}
|
50 |
}
|
51 |
|
52 |
pthread_mutex_unlock(&mut);
|
53 |
}
|
54 |
|
55 |
void System::print(String *string)
|
56 |
{
|
57 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
58 |
|
59 |
pthread_mutex_lock(&mut);
|
60 |
|
61 |
if (string!=null)
|
62 |
{
|
63 |
if (string->buffer != null)
|
64 |
{
|
65 |
cout << string->buffer;
|
66 |
}
|
67 |
}
|
68 |
|
69 |
pthread_mutex_unlock(&mut);
|
70 |
}
|
71 |
|
72 |
|
73 |
void System::println(char* input)
|
74 |
{
|
75 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
76 |
|
77 |
pthread_mutex_lock(&mut);
|
78 |
|
79 |
if (input != null)
|
80 |
{
|
81 |
cout << input << endl;
|
82 |
}
|
83 |
|
84 |
pthread_mutex_unlock(&mut);
|
85 |
}
|
86 |
|
87 |
void System::print(char* input)
|
88 |
{
|
89 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
90 |
|
91 |
pthread_mutex_lock(&mut);
|
92 |
|
93 |
if (input != null)
|
94 |
{
|
95 |
cout << input;
|
96 |
}
|
97 |
|
98 |
pthread_mutex_unlock(&mut);
|
99 |
}
|
100 |
|
101 |
void System::println(unsigned char* input)
|
102 |
{
|
103 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
104 |
|
105 |
pthread_mutex_lock(&mut);
|
106 |
|
107 |
if (input != null)
|
108 |
{
|
109 |
cout << input << endl;
|
110 |
}
|
111 |
|
112 |
pthread_mutex_unlock(&mut);
|
113 |
}
|
114 |
|
115 |
void System::print(unsigned char* input)
|
116 |
{
|
117 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
118 |
|
119 |
pthread_mutex_lock(&mut);
|
120 |
|
121 |
if (input != null)
|
122 |
{
|
123 |
cout << input;
|
124 |
}
|
125 |
|
126 |
pthread_mutex_unlock(&mut);
|
127 |
}
|
128 |
|
129 |
void System::println(int input)
|
130 |
{
|
131 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
132 |
|
133 |
pthread_mutex_lock(&mut);
|
134 |
|
135 |
cout << input << endl;
|
136 |
|
137 |
pthread_mutex_unlock(&mut);
|
138 |
}
|
139 |
|
140 |
void System::print(int input)
|
141 |
{
|
142 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
143 |
|
144 |
pthread_mutex_lock(&mut);
|
145 |
|
146 |
cout << input;
|
147 |
|
148 |
pthread_mutex_unlock(&mut);
|
149 |
}
|
150 |
|
151 |
void System::println(float input)
|
152 |
{
|
153 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
154 |
|
155 |
pthread_mutex_lock(&mut);
|
156 |
|
157 |
cout << input << endl;
|
158 |
|
159 |
pthread_mutex_unlock(&mut);
|
160 |
}
|
161 |
|
162 |
void System::print(float input)
|
163 |
{
|
164 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
165 |
|
166 |
pthread_mutex_lock(&mut);
|
167 |
|
168 |
cout << input;
|
169 |
|
170 |
pthread_mutex_unlock(&mut);
|
171 |
}
|
172 |
|
173 |
void System::println(short input)
|
174 |
{
|
175 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
176 |
|
177 |
pthread_mutex_lock(&mut);
|
178 |
|
179 |
cout << input << endl;
|
180 |
|
181 |
pthread_mutex_unlock(&mut);
|
182 |
}
|
183 |
|
184 |
void System::print(short input)
|
185 |
{
|
186 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
187 |
|
188 |
pthread_mutex_lock(&mut);
|
189 |
|
190 |
cout << input;
|
191 |
|
192 |
pthread_mutex_unlock(&mut);
|
193 |
}
|
194 |
|
195 |
void System::println(unsigned short input)
|
196 |
{
|
197 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
198 |
|
199 |
pthread_mutex_lock(&mut);
|
200 |
|
201 |
cout << input << endl;
|
202 |
|
203 |
pthread_mutex_unlock(&mut);
|
204 |
}
|
205 |
|
206 |
void System::print(unsigned short input)
|
207 |
{
|
208 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
209 |
|
210 |
pthread_mutex_lock(&mut);
|
211 |
|
212 |
cout << input;
|
213 |
|
214 |
pthread_mutex_unlock(&mut);
|
215 |
}
|
216 |
|
217 |
void System::println(char input)
|
218 |
{
|
219 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
220 |
|
221 |
pthread_mutex_lock(&mut);
|
222 |
|
223 |
cout << input << endl;
|
224 |
|
225 |
pthread_mutex_unlock(&mut);
|
226 |
}
|
227 |
|
228 |
void System::print(char input)
|
229 |
{
|
230 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
231 |
|
232 |
pthread_mutex_lock(&mut);
|
233 |
|
234 |
cout << input;
|
235 |
|
236 |
pthread_mutex_unlock(&mut);
|
237 |
}
|
238 |
|
239 |
void System::println(unsigned char input)
|
240 |
{
|
241 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
242 |
|
243 |
pthread_mutex_lock(&mut);
|
244 |
|
245 |
cout << input << endl;
|
246 |
|
247 |
pthread_mutex_unlock(&mut);
|
248 |
}
|
249 |
|
250 |
void System::print(unsigned char input)
|
251 |
{
|
252 |
pthread_mutex_t mut=MutexHandler::getMutex();
|
253 |
|
254 |
pthread_mutex_lock(&mut);
|
255 |
|
256 |
cout << input;
|
257 |
|
258 |
pthread_mutex_unlock(&mut);
|
259 |
} |