public BondSerializer(Akka.Actor.ExtendedActorSystem system, BondSerializerSettings settings) : base(system) { this.Settings = settings; this.typeSerializerFactory = ConstructTypeSerializerFactory(settings); LocalSystem.Value = system; }
private static Func <Type, ITypeSerializer> ConstructTypeSerializerFactory(BondSerializerSettings settings) { switch (settings.Protocol) { case BondSerializerSettings.ProtocolType.Simple: return(type => new SimpleBinaryTypeSerializer(type, settings)); case BondSerializerSettings.ProtocolType.Fast: return(type => new FastBinaryTypeSerializer(type, settings)); case BondSerializerSettings.ProtocolType.Compact: return(type => new CompactBinaryTypeSerializer(type, settings)); default: throw new NotSupportedException($"Protocol type of {settings.Protocol} is not supported by {nameof(BondSerializer)}"); } }
public CompactBinaryTypeSerializer(Type type, BondSerializerSettings settings) : base(type, settings) { }
public SimpleBinaryTypeSerializer(Type type, BondSerializerSettings settings) : base(type, settings) { }
protected TypeSerializer(Type type, BondSerializerSettings settings) { this.settings = settings; this.serializer = new Serializer <TWriter>(type); this.deserializer = new Deserializer <TReader>(type); }
public BondSerializer(Akka.Actor.ExtendedActorSystem system, Config config) : this(system, BondSerializerSettings.Create(config)) { }