Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/15 16:59:57 (9 years ago)
Author:
swagner
Message:

#2520: Worked on new persistence implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StaticCache.cs

    r13358 r13367  
    3636    private Dictionary<Type, Guid> type2Guid;
    3737    private Dictionary<Type, TypeInfo> typeInfos;
     38    private ExtensionRegistry extensionRegistry;
    3839
    3940    internal StaticCache() {
     
    4748        type2Guid = new Dictionary<Type, Guid>();
    4849        typeInfos = new Dictionary<Type, TypeInfo>();
     50        extensionRegistry = ExtensionRegistry.CreateInstance();
    4951
    50         foreach (var transformer in ApplicationManager.Manager.GetInstances<ITransformer>().OrderBy(x => x.Order)) {
     52        foreach (var transformer in ApplicationManager.Manager.GetInstances<ITransformer>().OrderBy(x => x.Priority)) {
    5153          guid2Transformer.Add(transformer.Guid, transformer);
    5254          transformer2Guid.Add(transformer, transformer.Guid);
     
    7173            RegisterType(StorableClassAttribute.GetStorableClassAttribute(t).Guid, t);
    7274        }
     75
     76        RegisterExtension(BoolBox.Bool);
     77        RegisterExtension(IntBox.Int);
     78        RegisterExtension(LongBox.Long);
     79        RegisterExtension(UnsignedIntBox.UnsignedInt);
     80        RegisterExtension(UnsignedLongBox.UnsignedLong);
     81        RegisterExtension(FloatBox.Float);
     82        RegisterExtension(DoubleBox.Double);
     83        RegisterExtension(StringBox.String);
     84        RegisterExtension(BytesBox.Bytes);
     85        RegisterExtension(BoolArrayBox.BoolArray);
     86        RegisterExtension(IntArrayBox.IntArray);
     87        RegisterExtension(MatrixBox.Matrix);
     88        RegisterExtension(BoolMatrixBox.BoolMatrix);
     89        RegisterExtension(IntMatrixBox.IntMatrix);
     90        RegisterExtension(DictionaryBox.Dictionary);
    7391      }
    7492    }
     
    7997        type2Guid.Add(type, guid);
    8098      }
     99    }
     100    public void RegisterExtension<TExtension>(GeneratedExtensionBase<TExtension> extension) {
     101      extensionRegistry.Add(extension);
    81102    }
    82103
     
    104125      }
    105126    }
     127    public ExtensionRegistry GetExtensionRegistry() {
     128      return extensionRegistry;
     129    }
    106130  }
    107131}
Note: See TracChangeset for help on using the changeset viewer.