1classdef PollingServer < ServiceSection
2 % A service section
for serving input buffers cyclically
4 % Copyright (c) 2012-2026, Imperial College London
9 function self = PollingServer(
classes)
10 % SELF = SERVER(CLASSES)
12 self@ServiceSection(
'PollingServer');
13 self.numberOfServers = 1;
14 self.serviceProcess = {};
19 methods (Access =
'private')
20 function initServers(self,
classes)
21 % INITSERVERS(CLASSES)
24 self.serviceProcess{1, i} = {
classes{i}.name, ServiceStrategy.LI, Exp(0.0)};
29 methods(Access =
protected)
30 % Override copyElement method:
31 function clone = copyElement(self)
32 % CLONE = COPYELEMENT()
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;