function hLib = hcrl_sum_float

%   Copyright 2016 The MathWorks, Inc.

hLib = RTW.TflTable;

addCaoPath_float = '<MyAdditionLibPath>';

locAddOpEnt(hLib, 'CRL_s_add_d_d_cao', 'double', 'double', 'single', 'cao', addCaoPath_float);
locAddOpEnt(hLib, 'CRL_d_add_d_d_cao', 'double', 'double', 'double', 'cao', addCaoPath_float);

% locAddOpEnt -------------------------------------------------------------
function hEnt=locAddOpEnt(hLib, aImplName, in1Type, in2Type, outType, algoID, libPath)

hdrFile = [aImplName '.h'];
srcFile = [aImplName '.c'];
hEnt = RTW.TflCOperationEntry;

hEnt.setTflCOperationEntryParameters( ...
       'Key',                             'RTW_OP_ADD' ...
       ,'Priority',                         1 ...
       ,'SaturationMode',                   'RTW_WRAP_ON_OVERFLOW' ...
       ,'RoundingModes',                    {'RTW_ROUND_UNSPECIFIED'} ...
       ,'ImplementationName',               aImplName ...
       ,'ImplementationHeaderFile',         hdrFile ...
       ,'ImplementationSourceFile',         srcFile ...
       ,'ImplementationHeaderPath',         libPath ...
       ,'ImplementationSourcePath',         libPath ...
       ,'AdditionalIncludePaths',           {libPath});

if ~isempty(algoID)
    entryAlgoID = getEntryAlgoID(algoID);
    hEnt.EntryInfo.Algorithm = entryAlgoID;
end

hArg = hLib.getTflArgFromString( 'y1', outType );
hArg.IOType = 'RTW_IO_OUTPUT';
hEnt.addConceptualArg(hArg);
hArg = hLib.getTflArgFromString( 'u1', in1Type );
hEnt.addConceptualArg(hArg);
hArg = hLib.getTflArgFromString( 'u2', in2Type );
hEnt.addConceptualArg(hArg);

hEnt.copyConceptualArgsToImplementation();

hLib.addEntry(hEnt);

% Helper function ---------------------------------------------------------
function str = getEntryAlgoID(algoID)
switch algoID
    case 'cao'
        str = 'RTW_CAST_AFTER_OP';
    case 'cbo'
        str = 'RTW_CAST_BEFORE_OP';
    otherwise
        disp('Wrong value for CRL Algorithm ID');
end

% LocalWords:  cao Ent cbo
