classdef manipulations < types.core.LabMetaData & types.untyped.GroupClass
% MANIPULATIONS A group of manipulations


% PROPERTIES
properties
    manipulationdata; % manipulation data attributes
end

methods
    function obj = manipulations(varargin)
        % MANIPULATIONS Constructor for manipulations
        %     obj = MANIPULATIONS(parentname1,parentvalue1,..,parentvalueN,parentargN,name1,value1,...,nameN,valueN)
        % manipulationdata = manipulationdata
        obj = obj@types.core.LabMetaData(varargin{:});
        [obj.manipulationdata, ivarargin] = types.util.parseConstrained(obj,'manipulationdata', 'types.ndx_cell_explorer.manipulationdata', varargin{:});
        varargin(ivarargin) = [];
        
        p = inputParser;
        p.KeepUnmatched = true;
        p.PartialMatching = false;
        p.StructExpand = false;
        misc.parseSkipInvalidName(p, varargin);
        if strcmp(class(obj), 'types.ndx_cell_explorer.manipulations')
            types.util.checkUnset(obj, unique(varargin(1:2:end)));
        end
    end
    %% SETTERS
    function obj = set.manipulationdata(obj, val)
        obj.manipulationdata = obj.validate_manipulationdata(val);
    end
    %% VALIDATORS
    
    function val = validate_manipulationdata(obj, val)
        constrained = {'types.ndx_cell_explorer.manipulationdata'};
        types.util.checkSet('manipulationdata', struct(), constrained, val);
    end
    %% EXPORT
    function refs = export(obj, fid, fullpath, refs)
        refs = export@types.core.LabMetaData(obj, fid, fullpath, refs);
        if any(strcmp(refs, fullpath))
            return;
        end
        if ~isempty(obj.manipulationdata)
            refs = obj.manipulationdata.export(fid, fullpath, refs);
        end
    end
end

end