classdef (Hidden = true) SectionData < handle
% Class that holds the profiling result data for a section

% Copyright 2020-2022 The MathWorks, Inc.

properties (GetAccess = private, SetAccess = private)
Name;
MaxExecTicks;
NumCalls;
AverExecTicks;
MaxSelfTicks;
AverSelfTicks;
MaxTurnaroundTicks;
AverTurnaroundTicks;
Children;
TotalExecTicks;
TotalSelfTicks;
TotalTurnaroundTicks;
Parent;
TimerTicksPerSecond;
end

methods (Access = public)

function lName = getName(this)
lName = this.Name;
end

function lMaxExecTimeInTicks = getMaxExecTime(this)
lMaxExecTimeInTicks = this.MaxExecTicks;
end

function lAverExecTimeInTicks = getAverExecTime(this)
lAverExecTimeInTicks = this.AverExecTicks;
end

function lMaxSelfTimeInTicks = getMaxSelfTime(this)
lMaxSelfTimeInTicks = this.MaxSelfTicks;
end

function lAverSelfTimeInTicks = getAverSelfTime(this)
lAverSelfTimeInTicks = this.AverSelfTicks;
end

function lMaxTurnaroundTimeInTicks = getMaxTurnaroundTime(this)
lMaxTurnaroundTimeInTicks = this.MaxTurnaroundTicks;
end

function lAverTurnaroundTimeInTicks = getAverTurnaroundTime(this)
lAverTurnaroundTimeInTicks = this.AverTurnaroundTicks;
end

function lChildren = getChildren(this)
lChildren = this.Children;
end

function lNumCalls = getNumCalls(this)
lNumCalls = this.NumCalls;
end

function lParent = getParent(this)
lParent = this.Parent;
end

function lTimerTicksPerSecond = getTimerTicksPerSecond(this)
lTimerTicksPerSecond = this.TimerTicksPerSecond;
end

function setParent(this, Parent)
this.Parent = Parent;
end

function setName(this, Name)
this.Name = Name;
end

function setChildren(this, Children)
this.Children = Children;
end

% Constructor
function this = SectionData(lExecutionTimeSection)
this.NumCalls = lExecutionTimeSection.NumCalls;
this.MaxExecTicks = lExecutionTimeSection.MaximumExecutionTimeInTicks;
this.TotalExecTicks = lExecutionTimeSection.TotalExecutionTimeInTicks;
this.AverExecTicks = double(this.TotalExecTicks)/double(this.NumCalls);
this.MaxSelfTicks = lExecutionTimeSection.MaximumSelfTimeInTicks;
this.TotalSelfTicks = lExecutionTimeSection.TotalSelfTimeInTicks;
this.AverSelfTicks = double(this.TotalSelfTicks)/double(this.NumCalls);
this.MaxTurnaroundTicks = lExecutionTimeSection.MaximumTurnaroundTimeInTicks;
this.TotalTurnaroundTicks= lExecutionTimeSection.TotalTurnaroundTimeInTicks;
this.AverTurnaroundTicks = double(this.TotalTurnaroundTicks)/double(this.NumCalls);
this.TimerTicksPerSecond = lExecutionTimeSection.getTimerTicksPerSecond;
end
end
end