classdef TgtConnTargetInfo < coder.internal.connectivity.TgtConnCodeGen
% TGTCONNTARGETINFO - See coder.internal.connectivity.TgtConnMgr
%

% Copyright 2014-2015 The MathWorks, Inc.
    
    methods(Access=protected)
        function obj = TgtConnTargetInfo()
        end
    end
    
    %****************************
    %*
    %*        BUILD-TIME
    %*     Public Interface
    %* -------------------------
    %*
    %*  isNeeded(obj)
    %*  getSupportedAppSvcNames(obj)
    %*
    %****************************

    methods(Access=public, Abstract)
        %
        % Called by the TgtConnMgr initialize() method at build-time and
        % returns true if building for this particular target, false otherwise.
        %
        % Note: The TgtConnMgr method getTopModelAndBuildArgs() returns the top
        % model name and build args for accessing parameters of the top model
        % (e.g. to get the system target file). See the build-time public
        % interface of coder.internal.connectivity.TgtConnMgr for more details.
        %
        isNeeded = isNeeded(obj);
    
        %
        % Called by the TgtConnMgr initialize() method at build-time and
        % returns a cell array of Application service names supported by
        % this particular target.  The TgtConnMgr adds each Application
        % service to the model build only if the Application service's
        % isNeeded() method returns true.  Some supported Application
        % services may NOT be added to the model build under certain
        % circumstances (e.g. a particular Application service may only be
        % needed if a particular ConfigSet parameter is enabled).
        %
        % The TgtConnMgr adds certain Application services to the model build,
        % but it is a specific TgtConnTargetInfo object's responsibility to add
        % all information about each needed Application service to BuildInfo.
        % For example, the ToAsyncQueueAppSvc requires a library to be linked
        % with the generated code.  The ToAsyncQueueAppSvc source code is
        % target independent, but the source code may have to be compiled and
        % linked differently for different targets (e.g. Rapid Accelerator
        % links as a shared library, but SLRT compiles and links into the
        % SLRT kernel).  Therefore, the Application service itself does not
        % have enough information to add itself to BuildInfo, the
        % TgtConnTargetInfo object must add to BuildInfo itself.  TgtConnMgr
        % keeps track of which Application services are needed and the
        % TgtConnTargetInfo object adds the appropriate library to BuildInfo.
        %
        getSupportedAppSvcNames(obj);
    end
    
    %****************************
    %*
    %*         RUN-TIME
    %*     Public Interface
    %* -------------------------
    %*
    %*  getTargetConnectionOptions(obj, argMap)
    %*
    %****************************
    
    methods(Access=public, Abstract)
        %
        % Called by the TgtConnMgr Start() method and returns a
        % coder.internal.connectivity.ConnectionOptions object used in a
        % call to coder.internal.connectivity.TargetConnection by TgtConnMgr
        % to establish a communication channel between host and target.
        %
        % argMap stores parameter-value pairs (each key is a parameter name)
        % used to calculate the ConnectionOptions object property values.
        % These parameter-value pairs may determine the type of transport
        % used (e.g. serial, TCP/IP) and the details of the chosen transport
        % (e.g. serial channel, TCP/IP port).
        %
        getTargetConnectionOptions(obj, argMap);
    end
end
