Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Communication.Operators/CurrentStateVariableInjector.cs @ 584

Last change on this file since 584 was 584, checked in by abeham, 16 years ago

merged communication framework to trunk (ticket #279)

File size: 972 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4using HeuristicLab.Core;
5using HeuristicLab.Data;
6using HeuristicLab.Communication.Data;
7
8namespace HeuristicLab.Communication.Operators {
9  public class CurrentStateVariableInjector : OperatorBase {
10    public override string Description {
11      get { return @"TODO\r\n add description"; }
12    }
13
14    public CurrentStateVariableInjector() {
15      AddVariableInfo(new VariableInfo("CurrentState", "The current state when working up a protocol", typeof(ProtocolState), VariableKind.In));
16    }
17
18    public override IOperation Apply(IScope scope) {
19      ProtocolState currentState = GetVariableValue<ProtocolState>("CurrentState", scope, true);
20      ConstrainedItemList data = currentState.SendingData;
21      for (int i = 0 ; i < data.Count ; i++) {
22        scope.AddVariable((Variable)data[i].Clone(new Dictionary<Guid, object>()));
23      }
24
25      return null;
26    }
27  }
28}
Note: See TracBrowser for help on using the repository browser.