Index: trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/QueueSerializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/QueueSerializer.cs (revision 11353)
+++ trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/QueueSerializer.cs (revision 11353)
@@ -0,0 +1,78 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Reflection;
+using HeuristicLab.Persistence.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.CompositeSerializers {
+
+ [StorableClass]
+ internal sealed class QueueSerializer : ICompositeSerializer {
+
+ [StorableConstructor]
+ private QueueSerializer(bool deserializing) { }
+ public QueueSerializer() { }
+
+ public int Priority {
+ get { return 100; }
+ }
+
+
+ public bool CanSerialize(Type type) {
+ return type == typeof(Queue) ||
+ type.IsGenericType &&
+ type.GetGenericTypeDefinition() == typeof(Queue<>);
+ }
+
+ public string JustifyRejection(Type type) {
+ return "not Queue or generic Queue<>";
+ }
+
+ public IEnumerable CreateMetaInfo(object o) {
+ return new Tag[] { };
+ }
+
+ public IEnumerable Decompose(object obj) {
+ foreach (object o in (IEnumerable)obj) {
+ yield return new Tag(null, o);
+ }
+ }
+
+ public object CreateInstance(Type type, IEnumerable metaInfo) {
+ return Activator.CreateInstance(type, true);
+ }
+
+ public void Populate(object instance, IEnumerable tags, Type type) {
+ MethodInfo addMethod = type.GetMethod("Enqueue");
+ try {
+ foreach (var tag in tags)
+ addMethod.Invoke(instance, new[] { tag.Value });
+ } catch (Exception e) {
+ throw new PersistenceException("Exception caught while trying to populate queue.", e);
+ }
+ }
+ }
+}
Index: trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj (revision 11174)
+++ trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj (revision 11353)
@@ -143,4 +143,5 @@
+