LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
PollingServer.m
1classdef PollingServer < ServiceSection
2 % A service section for serving input buffers cyclically
3 %
4 % Copyright (c) 2012-2026, Imperial College London
5 % All rights reserved.
6
7 methods
8 %Constructor
9 function self = PollingServer(classes)
10 % SELF = SERVER(CLASSES)
11
12 self@ServiceSection('PollingServer');
13 self.numberOfServers = 1;
14 self.serviceProcess = {};
15 initServers(self, classes);
16 end
17 end
18
19 methods (Access = 'private')
20 function initServers(self, classes)
21 % INITSERVERS(CLASSES)
22
23 for i = 1 : length(classes)
24 self.serviceProcess{1, i} = {classes{i}.name, ServiceStrategy.LI, Exp(0.0)};
25 end
26 end
27 end
28
29 methods(Access = protected)
30 % Override copyElement method:
31 function clone = copyElement(self)
32 % CLONE = COPYELEMENT()
33
34 % Make a shallow copy of all properties
35 clone = copyElement@Copyable(self);
36 % Make a deep copy of each object
37 for i = 1 : length(self.serviceProcess)
38 if ishandle(clone.serviceProcess{1,i}{3})
39 % this is a problem if one modifies the classes in the
40 % model because the one below is not an handle so it
41 % will not be modified
42 clone.serviceProcess{1,i}{3} = self.serviceProcess{1,i}{3}.copy;
43 end
44 end
45 end
46 end
47
48end
49