% ConfigurationsHelper - main entry point for all configurations related tasks.  
% Predominantly used by the configUI and also by distcomp.configuration to get 
% current configurations serializer (for backwards compatibility of Profiles).
%
% Use pctconfig('useprofiles', <true/false>) to switch between using (API2) 
% Profiles-backed configurations and (API1) preferences-backed configurations

% Copyright 2011-2015 The MathWorks, Inc.
classdef (Sealed, Hidden) ConfigurationsHelper
    methods (Static)
        function ser = getCurrentSerializer()
        % getCurrentSerializer() - returns the correct serializer to use
        % based on the current 'useprofiles' option in pctconfig
            import parallel.internal.settings.PreferencesConfigSerializer
            import parallel.internal.settings.ProfilesConfigSerializer
            [~, undoc] = pctconfig();
            if undoc.useprofiles
                ser = ProfilesConfigSerializer.getInstance();
            else
                ser = PreferencesConfigSerializer.getInstance();
            end
        end
    end
end

