forked from brian-lau/MatlabProcessManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocessState.m
48 lines (43 loc) · 994 Bytes
/
processState.m
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
% PROCESSSTATE - Utility class for processManager
%
% Useful for sending notifications based on exitValue of process.
%
classdef processState < handle
properties
id
running = 0
exitValue = NaN
stderr = {}
stdout = {}
end
events
exit
exit_success
exit_failure
end
methods
function self = processState(varargin)
end
function set.running(self,val)
self.running = val;
end
function set.exitValue(self,val)
self.exitValue = val;
if val >= 0
notify(self,'exit');
end
if val == 0
notify(self,'exit_success');
end
if val > 0
notify(self,'exit_failure');
end
end
function updateStderr(self,msg)
self.stderr = cat(1,self.stderr,msg);
end
function updateStdout(self,msg)
self.stdout = cat(1,self.stdout,msg);
end
end
end