classdef ExecProfInstrumenter < internal.cxxfe.FrontEndHandler
    %% The class ExecProfInstrumenter allows performing
    %  execution profile instrumentation within the C front end.
    %
    %  This is an undocumented class. Its methods and properties are
    %  likely to change without warning from one release to the next.

    %  Copyright 2013-2019 The MathWorks, Inc.

    properties (Access = private)
        ComponentRegistry;
        TraceInfo;
        WordSize;
        FrontEndOptions;
        Callback;
    end

    methods       
        function afterParsing(this, ilPtr, ~, origFileName, ~)
            % 2nd parameter: FEOpts
            assert(~isempty(this.TraceInfo(origFileName)), ...
                ['You must pass traceability information to parse and instrument ' origFileName]);
            coder.profile.private.exec_prof_mex(ilPtr, this.ComponentRegistry,...
                 this.TraceInfo(origFileName), this.WordSize, this.Callback);
        end

        function this = ExecProfInstrumenter(componentRegistry, traceInfo, ...
                            wordSize, frontEndOptions, callback)
            this.ComponentRegistry = componentRegistry;
            this.TraceInfo = traceInfo;
            this.WordSize = wordSize;
            this.FrontEndOptions = frontEndOptions;
            this.Callback = callback;
        end
    end
end

% LocalWords:  lang WORDSIZES EDG
