function propVal = get_impl(a,propName)
% GET(A,PROPNAME) MATLAB Code Generation Library function that gets the value of the 
% embedded.fi (A) property specified by PROPNAME      

% Copyright 2006-2014 The MathWorks, Inc.
%#codegen

coder.extrinsic('eml_getfiprop_helper');
coder.internal.prefer_const(propName);

% This function accepts mxArray input argument
eml_allow_mx_inputs;

% Error if incorrect number of inputs
eml_invariant(nargin == 2,'fixed:coder:incorrectNumberOfInputsGet');              
ain = coder.internal.scalarEg(a);

% Call the eml_getfimathprop_helper function in toolbox/fixedpoint
[propValScalar,pseudoData] = coder.const(@eml_getfiprop_helper,ain, propName, ~eml_is_const(a) , true);

%Note: embedded.fi properties can be divided into two groups, 
% "constant" properties whose values can be computed at compile time
% "runtime" properties that require generation of code
% List of "constant" properties, all supports code gen
%      All properties related with fimath and numerictype
% List of "runtime" properties: 
% 'int', 'bin', 'hex', 'oct', 'dec', 'intarray', 'simulinkarray'
% runtime prop supports code gen: 'double', 'data'

if pseudoData %the only supported runtime properties: data, double
    propVal = double(a);
else
    propVal = propValScalar;
end

%------------------------------------------------------------------------------

