classdef StackFunctionSection < coder.profile.StackSection
    %STACKFUNCTIONSECTION contains the stack information of a function

%   Copyright 2022-2023 The MathWorks, Inc.
    
    properties (GetAccess=public, SetAccess=private)
        Memory;
        MaxMemory;
    end
    properties (GetAccess=public, SetAccess=private, Hidden)
        FlagMultipleValues;
    end
    
    methods (Access=public, Hidden=true)
        function val = getName(this)
            lTraceInfo = this.getTraceInfo;
            val = lTraceInfo.getName();
        end
        
        function this = StackFunctionSection(lStackData, lSectionNumber, lSectionId, lTraceInfo)
            util = lStackData.getFunctionUsage(lSectionId);
            this@coder.profile.StackSection(lSectionNumber, lSectionId, lTraceInfo, uint64(0), util.numCalls);
            this.Memory = uint64(util.memory);
            this.FlagMultipleValues = util.flag;
            this.MaxMemory = util.maxMemory;
        end
    end
end
