Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/BaseConverter.cs @ 17834

Last change on this file since 17834 was 17834, checked in by dpiringe, 3 years ago

#3026

  • added ResultFormatter to add an extra layer of result transformation logic (converting a result value to a string with a defined logic, e.g. MatlabResultFormatter for ISymbolicRegressionSolution)
  • extended the IResultJsonItem with two properties for result formatting
  • added a new control to selected a result formatter for a result value
  • refactored the Runner for the new result formatting process
File size: 795 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using HeuristicLab.Core;
7using HeuristicLab.Data;
8using Newtonsoft.Json.Linq;
9
10namespace HeuristicLab.JsonInterface {
11  public abstract class BaseConverter : IJsonItemConverter
12  {
13    public abstract int Priority { get; }
14
15    public abstract bool CanConvertType(Type t);
16
17    public abstract Type ConvertableType { get; }
18
19    public abstract void Inject(IItem item, IJsonItem data, IJsonItemConverter root);
20    public abstract IJsonItem Extract(IItem value, IJsonItemConverter root);
21
22
23    #region Helper
24    protected IItem Instantiate(Type type, params object[] args) =>
25      (IItem)Activator.CreateInstance(type,args);
26    #endregion
27  }
28}
Note: See TracBrowser for help on using the repository browser.