Changeset 1673


Ignore:
Timestamp:
04/27/09 16:16:21 (12 years ago)
Author:
epitzer
Message:

Migrate HL.Operators-3.3 to new persistence library. (#603)

Location:
trunk/sources
Files:
5 edited
1 moved

Legend:

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

    r1530 r1673  
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Data;
     28using HeuristicLab.Persistence.Default.Decomposers.Storable;
    2829
    2930namespace HeuristicLab.Operators {
     
    3334  /// </summary>
    3435  public class CombinedOperator : DelegatingOperator {
     36
     37    [Storable]
    3538    private string myDescription;
    3639    /// <summary>
     
    4043      get { return myDescription; }
    4144    }
     45
     46    [Storable]
    4247    private IOperatorGraph myOperatorGraph;
    4348    /// <summary>
     
    131136        DescriptionChanged(this, new EventArgs());
    132137    }
    133 
    134     #region Persistence Methods
    135     /// <summary>
    136     /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>.
    137     /// </summary>
    138     /// <remarks>The description and the operator graph of the current instance are saved as child
    139     /// nodes with tag names <c>Description</c> <c>OperatorGraph</c>.<br/>
    140     /// Calls <see cref="OperatorBase.GetXmlNode"/> of base class <see cref="DelegatingOperator"/>.</remarks>
    141     /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param>
    142     /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param>
    143     /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param>
    144     /// <returns>The saved <see cref="XmlNode"/>.</returns>
    145     public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
    146       XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    147       XmlNode descriptionNode = document.CreateNode(XmlNodeType.Element, "Description", null);
    148       descriptionNode.InnerText = myDescription;
    149       node.AppendChild(descriptionNode);
    150       node.AppendChild(PersistenceManager.Persist("OperatorGraph", OperatorGraph, document, persistedObjects));
    151       return node;
    152     }
    153     /// <summary>
    154     /// Loads the persisted instance from the specified <paramref name="node"/>.
    155     /// </summary>
    156     /// <remarks>Calls <see cref="OperatorBase.Populate"/> of base class <see cref="DelegatingOperator"/>.
    157     /// <br/> See <see cref="GetXmlNode"/> for further information on how the data must be saved.</remarks>
    158     /// <param name="node">The <see cref="XmlNode"/> where the operator is saved.</param>
    159     /// <param name="restoredObjects">The dictionary of all already restored objects.
    160     /// (Needed to avoid cycles.)</param>
    161     public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
    162       base.Populate(node, restoredObjects);
    163       XmlNode descriptionNode = node.SelectSingleNode("Description");
    164       if (descriptionNode != null) myDescription = descriptionNode.InnerText;
    165       myOperatorGraph = (IOperatorGraph)PersistenceManager.Restore(node.SelectSingleNode("OperatorGraph"), restoredObjects);
    166     }
    167     #endregion
    168138  }
    169139}
  • trunk/sources/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj

    r1670 r1673  
    55    <ProductVersion>9.0.30729</ProductVersion>
    66    <SchemaVersion>2.0</SchemaVersion>
    7     <ProjectGuid>{A9983BA2-B3B2-475E-8E2C-62050B71D1C5}</ProjectGuid>
     7    <ProjectGuid>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</ProjectGuid>
    88    <OutputType>Library</OutputType>
    99    <AppDesignerFolder>Properties</AppDesignerFolder>
    1010    <RootNamespace>HeuristicLab.Operators</RootNamespace>
    11     <AssemblyName>HeuristicLab.Operators-3.2</AssemblyName>
     11    <AssemblyName>HeuristicLab.Operators-3.3</AssemblyName>
    1212    <SignAssembly>true</SignAssembly>
    1313    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
     
    1717    <UpgradeBackupLocation>
    1818    </UpgradeBackupLocation>
     19    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    1920  </PropertyGroup>
    2021  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     
    3637    <ErrorReport>prompt</ErrorReport>
    3738    <WarningLevel>4</WarningLevel>
    38     <DocumentationFile>bin\Release\HeuristicLab.Operators-3.2.XML</DocumentationFile>
     39    <DocumentationFile>bin\Release\HeuristicLab.Operators-3.3.xml</DocumentationFile>
    3940    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    4041  </PropertyGroup>
     
    7576  <ItemGroup>
    7677    <Reference Include="System" />
     78    <Reference Include="System.Core">
     79      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     80    </Reference>
    7781    <Reference Include="System.Data" />
    7882    <Reference Include="System.Drawing" />
     
    135139  </ItemGroup>
    136140  <ItemGroup>
    137     <ProjectReference Include="..\..\HeuristicLab.Constraints\3.2\HeuristicLab.Constraints-3.2.csproj">
    138       <Project>{FCD62C6F-4793-4593-AE9A-0BDCA256EE99}</Project>
    139       <Name>HeuristicLab.Constraints-3.2</Name>
     141    <ProjectReference Include="..\..\HeuristicLab.Constraints\3.3\HeuristicLab.Constraints-3.3.csproj">
     142      <Project>{19C1E42A-4B48-4EFD-B697-899016F1C198}</Project>
     143      <Name>HeuristicLab.Constraints-3.3</Name>
    140144    </ProjectReference>
    141     <ProjectReference Include="..\..\HeuristicLab.Core\3.2\HeuristicLab.Core-3.2.csproj">
    142       <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
    143       <Name>HeuristicLab.Core-3.2</Name>
     145    <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
     146      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
     147      <Name>HeuristicLab.Core-3.3</Name>
    144148    </ProjectReference>
    145     <ProjectReference Include="..\..\HeuristicLab.Data\3.2\HeuristicLab.Data-3.2.csproj">
    146       <Project>{F473D9AF-3F09-4296-9F28-3C65118DAFFA}</Project>
    147       <Name>HeuristicLab.Data-3.2</Name>
     149    <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
     150      <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
     151      <Name>HeuristicLab.Data-3.3</Name>
     152    </ProjectReference>
     153    <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
     154      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
     155      <Name>HeuristicLab.Persistence-3.3</Name>
    148156    </ProjectReference>
    149157    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
  • trunk/sources/HeuristicLab.Operators/3.3/HeuristicLabOperatorsPlugin.cs

    r1530 r1673  
    2929  /// Plugin class for HeuristicLab.Operators plugin.
    3030  /// </summary>
    31   [ClassInfo(Name = "HeuristicLab.Operators-3.2")]
    32   [PluginFile(Filename = "HeuristicLab.Operators-3.2.dll", Filetype = PluginFileType.Assembly)]
    33   [Dependency(Dependency = "HeuristicLab.Core-3.2")]
    34   [Dependency(Dependency = "HeuristicLab.Data-3.2")]
     31  [ClassInfo(Name = "HeuristicLab.Operators-3.3")]
     32  [PluginFile(Filename = "HeuristicLab.Operators-3.3.dll", Filetype = PluginFileType.Assembly)]
     33  [Dependency(Dependency = "HeuristicLab.Constraints-3.3")]
     34  [Dependency(Dependency = "HeuristicLab.Core-3.3")]
     35  [Dependency(Dependency = "HeuristicLab.Data-3.3")]
     36  [Dependency(Dependency = "HeuristicLab.Persistence-3.3")] 
    3537  public class HeuristicLabOperatorsPlugin : PluginBase {
    3638  }
  • trunk/sources/HeuristicLab.Operators/3.3/Properties/AssemblyInfo.frame

    r581 r1673  
    5454// You can specify all the values or you can default the Revision and Build Numbers
    5555// by using the '*' as shown below:
    56 [assembly: AssemblyVersion("3.2.0.$WCREV$")]
    57 [assembly: AssemblyFileVersion("3.2.0.$WCREV$")]
     56[assembly: AssemblyVersion("3.3.0.$WCREV$")]
     57[assembly: AssemblyFileVersion("3.3.0.$WCREV$")]
    5858[assembly: AssemblyBuildDate("$WCNOW$")]
  • trunk/sources/HeuristicLab.Operators/3.3/VariableInjector.cs

    r1530 r1673  
    2525using System.Xml;
    2626using HeuristicLab.Core;
     27using HeuristicLab.Persistence.Default.Decomposers.Storable;
    2728
    2829namespace HeuristicLab.Operators {
     
    3132  /// </summary>
    3233  public class VariableInjector : OperatorBase {
     34
     35    [Storable]
    3336    private Dictionary<IVariable, IVariableInfo> variableVariableInfoTable;
     37
     38    [Storable]
    3439    private Dictionary<IVariableInfo, IVariable> variableInfoVariableTable;
    3540
     
    142147    }
    143148    #endregion
    144 
    145     #region Persistence Methods
    146     /// <summary>
    147     /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>.
    148     /// <note type="caution"> Variable infos are not persisted!</note>
    149     /// </summary>
    150     /// <remarks>Calls <see cref="OperatorBase.GetXmlNode"/> of base class <see cref="OperatorBase"/>.</remarks>
    151     /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param>
    152     /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param>
    153     /// <param name="persistedObjects">The dictionary of all already persisted objects. (Needed to avoid cycles.)</param>
    154     /// <returns>The saved <see cref="XmlNode"/>.</returns>
    155     public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) {
    156       XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    157       // variable infos should not be persisted
    158       XmlNode infosNode = node.SelectSingleNode("VariableInfos");
    159       infosNode.RemoveAll();
    160       return node;
    161     }
    162     #endregion
    163149  }
    164150}
  • trunk/sources/HeuristicLab.sln

    r1672 r1673  
    172172EndProject
    173173Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Constraints-3.3", "HeuristicLab.Constraints\3.3\HeuristicLab.Constraints-3.3.csproj", "{19C1E42A-4B48-4EFD-B697-899016F1C198}"
     174EndProject
     175Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Operators-3.3", "HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj", "{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}"
    174176EndProject
    175177Global
     
    25422544    {BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}.Visualization Debug|x86.ActiveCfg = Debug|x86
    25432545    {BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}.Visualization Debug|x86.Build.0 = Debug|x86
     2546    {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|Any CPU.ActiveCfg = Debug|Any CPU
     2547    {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU
     2548    {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|x64.ActiveCfg = Debug|x64
     2549    {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|x64.Build.0 = Debug|x64
     2550    {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|x86.ActiveCfg = Debug|x86
     2551    {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|x86.Build.0 = Debug|x86
     2552    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     2553    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|Any CPU.Build.0 = Debug|Any CPU
     2554    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|x64.ActiveCfg = Debug|x64
     2555    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|x64.Build.0 = Debug|x64
     2556    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|x86.ActiveCfg = Debug|x86
     2557    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|x86.Build.0 = Debug|x86
     2558    {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|Any CPU.ActiveCfg = Debug|Any CPU
     2559    {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|Any CPU.Build.0 = Debug|Any CPU
     2560    {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|x64.ActiveCfg = Debug|x64
     2561    {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|x64.Build.0 = Debug|x64
     2562    {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|x86.ActiveCfg = Debug|x86
     2563    {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|x86.Build.0 = Debug|x86
     2564    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|Any CPU.ActiveCfg = Release|Any CPU
     2565    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|Any CPU.Build.0 = Release|Any CPU
     2566    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|x64.ActiveCfg = Release|x64
     2567    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|x64.Build.0 = Release|x64
     2568    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|x86.ActiveCfg = Release|x86
     2569    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|x86.Build.0 = Release|x86
     2570    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|Any CPU.ActiveCfg = Debug|Any CPU
     2571    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|Any CPU.Build.0 = Debug|Any CPU
     2572    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|x64.ActiveCfg = Debug|x64
     2573    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|x64.Build.0 = Debug|x64
     2574    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|x86.ActiveCfg = Debug|x86
     2575    {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|x86.Build.0 = Debug|x86
    25442576    {23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}.CEDMA Debug|Any CPU.ActiveCfg = Debug|Any CPU
    25452577    {23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU
     
    25722604    {23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}.Visualization Debug|x86.ActiveCfg = Debug|x86
    25732605    {23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}.Visualization Debug|x86.Build.0 = Debug|x86
    2574     {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|Any CPU.ActiveCfg = Debug|Any CPU
    2575     {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU
    2576     {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|x64.ActiveCfg = Debug|x64
    2577     {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|x64.Build.0 = Debug|x64
    2578     {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|x86.ActiveCfg = Debug|x86
    2579     {19C1E42A-4B48-4EFD-B697-899016F1C198}.CEDMA Debug|x86.Build.0 = Debug|x86
    2580     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    2581     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|Any CPU.Build.0 = Debug|Any CPU
    2582     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|x64.ActiveCfg = Debug|x64
    2583     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|x64.Build.0 = Debug|x64
    2584     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|x86.ActiveCfg = Debug|x86
    2585     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Debug|x86.Build.0 = Debug|x86
    2586     {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|Any CPU.ActiveCfg = Debug|Any CPU
    2587     {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|Any CPU.Build.0 = Debug|Any CPU
    2588     {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|x64.ActiveCfg = Debug|x64
    2589     {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|x64.Build.0 = Debug|x64
    2590     {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|x86.ActiveCfg = Debug|x86
    2591     {19C1E42A-4B48-4EFD-B697-899016F1C198}.GP Debug|x86.Build.0 = Debug|x86
    2592     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|Any CPU.ActiveCfg = Release|Any CPU
    2593     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|Any CPU.Build.0 = Release|Any CPU
    2594     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|x64.ActiveCfg = Release|x64
    2595     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|x64.Build.0 = Release|x64
    2596     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|x86.ActiveCfg = Release|x86
    2597     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Release|x86.Build.0 = Release|x86
    2598     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|Any CPU.ActiveCfg = Debug|Any CPU
    2599     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|Any CPU.Build.0 = Debug|Any CPU
    2600     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|x64.ActiveCfg = Debug|x64
    2601     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|x64.Build.0 = Debug|x64
    2602     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|x86.ActiveCfg = Debug|x86
    2603     {19C1E42A-4B48-4EFD-B697-899016F1C198}.Visualization Debug|x86.Build.0 = Debug|x86
    26042606  EndGlobalSection
    26052607  GlobalSection(SolutionProperties) = preSolution
Note: See TracChangeset for help on using the changeset viewer.