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); }
public SendWithoutContextsCookie(ProtocolContexts contexts) { myContexts = contexts; myPrevValue = contexts.mySendWithoutContexts.Value; contexts.mySendWithoutContexts.Value = true; }
public MessageContextCookie(ProtocolContexts handler, int numContextValues) { myHandler = handler; myNumContextValues = numContextValues; }
internal Protocol([NotNull] string name, [NotNull] ISerializers serializers, [NotNull] IIdentities identities, [NotNull] IScheduler scheduler, [NotNull] IWire wire, Lifetime lifetime, SerializationCtx?serializationCtx = null, [CanBeNull] ProtocolContexts parentContexts = null, params RdContextBase[] initialContexts) { 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)); SerializationContext = serializationCtx ?? new SerializationCtx(this, new Dictionary <string, IInternRoot <object> >() { { ProtocolInternScopeStringId, CreateProtocolInternRoot(lifetime) } }); Contexts = parentContexts ?? new ProtocolContexts(SerializationContext); wire.Contexts = Contexts; if (serializationCtx == null) { SerializationContext.InternRoots[ProtocolInternScopeStringId].Bind(lifetime, this, ProtocolInternRootRdId); } foreach (var rdContextBase in initialContexts) { rdContextBase.RegisterOn(Contexts); } if (parentContexts == null) { BindContexts(lifetime); } OutOfSyncModels = new ViewableSet <RdExtBase>(); }