Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3.1/sources/HeuristicLab.Communication.Operators/DataStreamFinisher.cs @ 583

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

Adding communication framework to branch 3.1 (ticket #278)

File size: 931 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 DataStreamFinisher : OperatorBase {
10    public override string Description {
11      get {
12        return @"TODO";
13      }
14    }
15
16    public DataStreamFinisher() {
17      AddVariableInfo(new VariableInfo("DataStream", "", typeof(IDataStream), VariableKind.Deleted));
18    }
19
20    public override IOperation Apply(IScope scope) {
21      IDataStream datastream = GetVariableValue<IDataStream>("DataStream", scope, true);
22
23      datastream.Close();
24
25      IVariableInfo info = GetVariableInfo("DataStream");
26      if (info.Local)
27        RemoveVariable(info.ActualName);
28      else
29        scope.RemoveVariable(scope.TranslateName(info.FormalName));
30
31      return null;
32    }
33  }
34}
Note: See TracBrowser for help on using the repository browser.