Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1314


Ignore:
Timestamp:
03/09/09 12:44:51 (16 years ago)
Author:
epitzer
Message:

rename ICustomSerializer to ICompoundSerializer. (#506)

Location:
branches/New Persistence Exploration/Persistence/Persistence
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/New Persistence Exploration/Persistence/Persistence/CompoundSerializers.cs

    r1313 r1314  
    55namespace Persistence {
    66
    7   public interface ICustomSerializer {
     7  public interface ICompoundSerializer {
    88    bool CanSerialize(Type type);
    99    IEnumerable Serialize(object o);
     
    1111  }
    1212
    13   public class EnumerableSerializer : ICustomSerializer {
     13  public class EnumerableSerializer : ICompoundSerializer {
    1414    public bool CanSerialize(Type type) {
    1515      if (type.GetInterface("IEnumerable") == null)
     
    3636  }
    3737
    38   public class ArraySerializer : ICustomSerializer {
     38  public class ArraySerializer : ICompoundSerializer {
    3939
    4040    public bool CanSerialize(Type type) {     
  • branches/New Persistence Exploration/Persistence/Persistence/DeSerializer.cs

    r1281 r1314  
    6262
    6363    private Dictionary<Type, IPrimitiveSerializer> primitiveSerializers;
    64     private List<ICustomSerializer> customSerializers;
     64    private List<ICompoundSerializer> customSerializers;
    6565
    6666    delegate void Thunk();
     
    6969    public DeSerializer(
    7070        IEnumerable<IPrimitiveSerializer> primitiveSerializers,
    71         IEnumerable<ICustomSerializer> customSerializers) {
     71        IEnumerable<ICompoundSerializer> customSerializers) {
    7272      id2obj = new Dictionary<int, object>();
    7373      compositeStack = new Stack<IAccessibleObject>();
     
    8282        this.primitiveSerializers.Add(ps.Type, ps);
    8383      }
    84       this.customSerializers = new List<ICustomSerializer>(customSerializers);
     84      this.customSerializers = new List<ICompoundSerializer>(customSerializers);
    8585      this.finalFixes = new List<Thunk>();
    8686    }
     
    112112    private void CompositeEndHandler(IParseToken token) {
    113113      CompositeEnd end = (CompositeEnd)token;
    114       ICustomSerializer customSerializer = this.FindCustomSerializer(end.Type);
     114      ICompoundSerializer customSerializer = this.FindCustomSerializer(end.Type);
    115115      if (customSerializer != null) {
    116116        CustomObject customObject = (CustomObject)compositeStack.Pop();
     
    124124      }
    125125    }
    126     private ICustomSerializer FindCustomSerializer(Type type) {
    127       foreach (ICustomSerializer serializer in customSerializers) {
     126    private ICompoundSerializer FindCustomSerializer(Type type) {
     127      foreach (ICompoundSerializer serializer in customSerializers) {
    128128        if (serializer.CanSerialize(type))
    129129          return serializer;
  • branches/New Persistence Exploration/Persistence/Persistence/NewSerializationTest.cs

    r1312 r1314  
    6060          new Double2XmlSerializer(),
    6161        },
    62         new ICustomSerializer[] {
     62        new ICompoundSerializer[] {
    6363          new ArraySerializer(),
    6464          new EnumerableSerializer() });
  • branches/New Persistence Exploration/Persistence/Persistence/Serializer.cs

    r1280 r1314  
    1111    private Dictionary<object, int> obj2id;
    1212    private Dictionary<Type, IPrimitiveSerializer> primitiveSerializers;
    13     private List<ICustomSerializer> customSerializers;
     13    private List<ICompoundSerializer> customSerializers;
    1414
    1515    public Serializer(object obj, IEnumerable<IPrimitiveSerializer> primitiveSerializers) :
     
    2323        this.primitiveSerializers.Add(serializer.Type, serializer);
    2424      }
    25       this.customSerializers = new List<ICustomSerializer>();
     25      this.customSerializers = new List<ICompoundSerializer>();
    2626      customSerializers.Add(new EnumerableSerializer());
    2727      customSerializers.Add(new ArraySerializer());
     
    5454        this.obj2id.Add(value, id);
    5555        yield return new BeginToken(accessor, id);
    56         ICustomSerializer customSerializer = this.FindCustomSerializer(value.GetType());
     56        ICompoundSerializer customSerializer = this.FindCustomSerializer(value.GetType());
    5757        if (customSerializer != null) {
    5858          foreach (object obj in customSerializer.Serialize(value)) {
     
    7373    }
    7474
    75     private ICustomSerializer FindCustomSerializer(Type type) {
    76       foreach (ICustomSerializer s in customSerializers) {
     75    private ICompoundSerializer FindCustomSerializer(Type type) {
     76      foreach (ICompoundSerializer s in customSerializers) {
    7777        if (s.CanSerialize(type))
    7878          return s;
Note: See TracChangeset for help on using the changeset viewer.