Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2877 for trunk/sources


Ignore:
Timestamp:
02/26/10 16:40:01 (15 years ago)
Author:
epitzer
Message:

further steps towards migration of ProgrammableOperator to HL 3.3 (#842)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperator.cs

    r2799 r2877  
    4040namespace HeuristicLab.Operators.Programmable {
    4141
    42   public class ProgrammableOperator : Operator {
     42  [Item("ProgrammableOperator", "An operator that can be programmed for arbitrary needs.")]
     43  [Creatable("Test")]
     44  [EmptyStorableClass]
     45  public class ProgrammableOperator : SingleSuccessorOperator {
    4346
    4447    #region Fields & Properties
     
    98101    }
    99102
     103    public override bool CanChangeDescription {
     104      get {
     105        return true;
     106      }
     107    }
     108
    100109    #endregion
    101110
     
    153162
    154163    public ProgrammableOperator() {     
    155       code = "";
    156       Description = "An operator that can be programmed for arbitrary needs.";
     164      code = "";     
    157165      executeMethod = null;
    158166      ProgrammableOperator.StaticInitialize();
     
    347355      CodeMemberMethod method = new CodeMemberMethod();
    348356      method.Name = "Execute";
    349       method.ReturnType = new CodeTypeReference(typeof(HeuristicLab.Core.IExecutionSequence));
     357      method.ReturnType = new CodeTypeReference(typeof(HeuristicLab.Core.IOperation));
    350358      method.Attributes = MemberAttributes.Public | MemberAttributes.Static;
    351       method.Parameters.Add(new CodeParameterDeclarationExpression(typeof(IOperator), "op"));
    352 //      method.Parameters.Add(new CodeParameterDeclarationExpression(typeof(IScope), "scope"));
     359      method.Parameters.Add(new CodeParameterDeclarationExpression(typeof(IOperator), "op"));     
    353360      foreach (var param in Parameters)
    354361        method.Parameters.Add(new CodeParameterDeclarationExpression(param.DataType, param.Name));
     
    366373
    367374    #region HeuristicLab interfaces
    368    
    369     public override IExecutionSequence Apply() {
     375
     376    public override IOperation Apply() {
    370377      lock (syncRoot) {
    371378        if (executeMethod == null) {
     
    376383      var parameters = new List<object>() { this };     
    377384      parameters.AddRange(Parameters.Select(p => (object)p.ActualValue));
    378       return (IExecutionSequence)executeMethod.Invoke(null, parameters.ToArray());
     385      return (IOperation)executeMethod.Invoke(null, parameters.ToArray());
    379386    }
    380387   
     
    402409   
    403410    #endregion
    404    
     411    
    405412  }
    406413}
Note: See TracChangeset for help on using the changeset viewer.