﻿% COMPILER GENERATED CODE
% THIS WILL BE OVERWRITTEN AT EACH GENERATION
% EDIT AT YOUR OWN RISK

classdef Unmapper < handle % For {ProjectName}
    properties (Access = private)
        m_helper = [];
    end
    methods
        function this = Unmapper(helper)
            this.m_helper = helper;
        end
        function outputData = FillOutputData(self)
            outputMapping = self.m_helper.MappingCompiler.GetTypeMapping(self.m_helper.Unmapper.OutputMapping);
            self.m_helper.Unmapper.Reset();
            outputData = self.Fill{OutputCategoryIdentifier}{OutputDataTypeIdentifier}(outputMapping);
        end
        function outputMeta = FillOutputMeta(self)
            outputMapping = self.m_helper.MappingCompiler.GetTypeMapping(self.m_helper.Unmapper.OutputMapping);
            self.m_helper.Unmapper.Reset();
            outputMeta = self.Fill{OutputCategoryIdentifier}{OutputMetaTypeIdentifier}(outputMapping);
        end
        function measurements = Unmap(self,outputData, outputMeta)
            measurements = NET.createGeneric('System.Collections.Generic.List', {'GSF.TimeSeries.IMeasurement'});
            outputMapping = self.m_helper.MappingCompiler.GetTypeMapping(self.m_helper.Unmapper.OutputMapping);
            self.CollectFrom{OutputCategoryIdentifier}{OutputDataTypeIdentifier}(measurements, outputMapping, outputData, outputMeta)
        end
    end
    methods (Access = private)
        {FillFunctions}

        {UnmappingFunctions}
    end
end