Can be more efficient by not retrieving all the descriptors and using findByName() and instead getting the value from the core map directly.
For example:
Current:
function v = getConfigurationSetting(obj, name)
% Gets the value of an existing configuration setting
descriptors = obj.getConfigurationSettingDescriptors();
d = descriptors.findByName(name);
if isempty(d)
error([name ' does not exist']);
end
v = d.value;
end
More efficient:
function v = getConfigurationSetting(obj, name)
% Gets the value of an existing configuration setting
v = obj.tryCoreWithReturn(@()obj.cobj.Configuration.Item(name));
v = obj.valueFromPropertyValue(convert(v));
end
Descriptor value getters like:
Device.getConfigurationSetting()
Device.hasConfigurationSetting()
Entity.getProperty()
Can be more efficient by not retrieving all the descriptors and using findByName() and instead getting the value from the core map directly.
For example:
Current:
More efficient: