Esempio n. 1
0
 public HeavySingleContextHandler(RdContext <T> context, ProtocolContexts handler)
 {
     myHandler                    = handler;
     Context                      = context;
     myInternRoot                 = new InternRoot <T>(context.ReadDelegate, context.WriteDelegate);
     myProtocolValueSet           = new RdSet <T>(context.ReadDelegate, context.WriteDelegate, new ViewableSet <T>(new ConcurrentSet <T>()));
     myModificationCookieValueSet = new ModificationCookieViewableSet <T, ProtocolContexts.SendWithoutContextsCookie>(myHandler.CreateSendWithoutContextsCookie, myProtocolValueSet);
 }
Esempio n. 2
0
File: RdSet.cs Progetto: yvvan/rd
 public static void Write(SerializationCtx ctx, UnsafeWriter writer, RdSet <T> value)
 {
     Assertion.Assert(!value.RdId.IsNil, "!value.RdId.IsNil");
     writer.Write(value.RdId);
 }
Esempio n. 3
0
        public Protocol([NotNull] string name, [NotNull] ISerializers serializers, [NotNull] IIdentities identities, [NotNull] IScheduler scheduler,
                        [NotNull] IWire wire, Lifetime lifetime, SerializationCtx?serializationCtx = null, [CanBeNull] RdSet <ClientId> parentClientIdSet = null)
        {
            Name     = name ?? throw new ArgumentNullException(nameof(name));
            Location = new RName(name);

            Serializers          = serializers ?? throw new ArgumentNullException(nameof(serializers));
            Identities           = identities ?? throw new ArgumentNullException(nameof(identities));
            Scheduler            = scheduler ?? throw new ArgumentNullException(nameof(scheduler));
            Wire                 = wire ?? throw new ArgumentNullException(nameof(wire));
            ClientIdSet          = parentClientIdSet ?? new RdSet <ClientId>(ClientId.ReadDelegate, ClientId.WriteDelegate);
            SerializationContext = serializationCtx ?? new SerializationCtx(this, new Dictionary <string, IInternRoot>()
            {
                { ProtocolInternScopeStringId, CreateProtocolInternRoot(lifetime) }
            });
            OutOfSyncModels = new ViewableSet <RdExtBase>();
        }