classdef (Hidden = true) CodeInfoProject < handle
%CODEINFOPROJECT A framework for interacting with CodeInfo
%
%   This is an undocumented class. Its methods and properties are likely to
%   change without warning from one release to the next.

%   Copyright 2010-2021 The MathWorks, Inc.

    % properties
    properties (SetAccess = 'private', GetAccess = 'protected')
        codeInfoUtils;
    end
    
    properties (Dependent, SetAccess = private)
        codeInfo;                
    end        
    
    methods
        % constructor
        function this = CodeInfoProject(codeInfoUtils)
            narginchk(1, 1);
            % validate arg            
            rtw.connectivity.Utils.validateArg(codeInfoUtils, ...
                'rtw.connectivity.CodeInfoUtils');                                  
            % store codeInfoUtils
            this.codeInfoUtils = codeInfoUtils;
            
        end
        
        function codeInfo = get.codeInfo(this)
	    % getter for the CodeInfo Dependent property, needed to 
            % make sure all client calls access the property via 
	    % CodeDescriptorUtils
            codeInfo = this.codeInfoUtils.getCodeInfo();
        end
        
        function set.codeInfo(~, ~)
            assert(false, 'should not set codeInfo')
        end
        
        % accessor for CodeInfo
        function codeInfo = getCodeInfo(this)
	    % access via CodeDescriptorUtils
            codeInfo = this.codeInfoUtils.getCodeInfo();
        end
        
        % accessor for CodeInfoUtils
        function codeInfoUtils = getCodeInfoUtils(this)
            codeInfoUtils = this.codeInfoUtils;
        end                
    end
end
