public bool TryGetValue(TKey key, out TValue value) { var tmp = new object[1]; var result = (bool)RuntimeHost.DoCommunication(Id, TryGetValue, key, tmp); value = (TValue)tmp[0]; return(result); }
protected override void OnLinkedTo(RuntimeHost runtimeHost, params object[] args) { if (args == null || args.Length == 0) { m_reg = SharedRegister.Create <T>(runtimeHost.Runtime); } else if (args.Length == 1 && args[0] is T value) { m_reg = SharedRegister.Create <T>(runtimeHost.Runtime, value); } else { throw new ArgumentOutOfRangeException(nameof(args), "The value needs to translate in null, empty or the array that has just one element as T."); } }
protected override void OnLinkedTo(RuntimeHost runtimeHost, params object[] args) { if (args == null || args.Length == 0) { m_dic = SharedDictionary.Create <TKey, TValue>(runtimeHost.Runtime); } else if (args.Length == 1 && args[0] is IEqualityComparer <TKey> comparer) { m_dic = SharedDictionary.Create <TKey, TValue>(comparer, runtimeHost.Runtime); } else { throw new ArgumentOutOfRangeException(nameof(args), "The value needs to translate in null, empty or the array that has just one element as IEqualityComparer<TKey>."); } }
protected override void OnDeserializedCore(StreamingContext ctx) { RuntimeHost.RegisterCommunication(Id, new Func <object[], object>[] { TryAddCore, TryUpdateCore, thisGetCore, thisSetCore, TryRemoveCore, CountGetCore }); }
public DistributedDictionary() { RuntimeHost.RegisterCommunication(Id, new Func <object[], object>[] { TryAddCore, TryUpdateCore, thisGetCore, thisSetCore, TryRemoveCore, CountGetCore }); }
public int Exchange(int value) { return((int)RuntimeHost.DoCommunication(Id, ExchangeCore, value)); }
public TSender GetSender <TSender>(MachineId machineId) where TSender : class, IMethodizedMachineSender { return(RuntimeHost.GetSender <TSender>(Id, machineId)); }
public TSender[] GetSender <TSender>(MonitorId[] monitorIds) where TSender : class, IMethodizedMonitorSender { return(RuntimeHost.GetSender <TSender>(Id, monitorIds)); }
public DistributedCounter() { RuntimeHost.RegisterCommunication(Id, new Func <object[], object>[] { IncrementCore, DecrementCore, GetValueCore, AddCore, ExchangeCore, CompareExchangeCore }); }
public bool TryUpdate(TKey key, TValue newValue, TValue comparisonValue) { return((bool)RuntimeHost.DoCommunication(Id, TryUpdateCore, key, newValue, comparisonValue)); }
public DistributedRegister() { RuntimeHost.RegisterCommunication(Id, new Func <object[], object>[] { UpdateCore, GetValueCore, SetValueCore }); }
protected virtual void OnLinkedTo(RuntimeHost runtimeHost) { }
internal void LinkTo(RuntimeHost runtimeHost) { Id.LinkTo(runtimeHost.Id); OnLinkedTo(runtimeHost); }
protected InterProcessCommunicationProvider(RuntimeHost runtimeHost, string localEndpointName) : this(runtimeHost, new InterProcessCommunicationSetting(localEndpointName)) { }
public object DoCommunication(CommunicationId target, string name, params object[] args) { return(RuntimeHost.DoCommunication(target, name, args)); }
public void Decrement() { RuntimeHost.DoCommunication(Id, DecrementCore); }
protected override void OnDeserializedCore(StreamingContext ctx) { RuntimeHost.RegisterCommunication(Id, new Func <object[], object>[] { IncrementCore, DecrementCore, GetValueCore, AddCore, ExchangeCore, CompareExchangeCore }); }
public void SetSender <TSender>(ref MachineId[] machineIds, TSender[] machines) where TSender : class, IMethodizedMachineSender { RuntimeHost.SetSender(ref machineIds, machines); }
public bool TryAdd(TKey key, TValue value) { return((bool)RuntimeHost.DoCommunication(Id, TryAddCore, key, value)); }
protected virtual void OnLinkedTo(RuntimeHost runtimeHost, params object[] args) { }
protected override void OnDeserializedCore(StreamingContext ctx) { RuntimeHost.RegisterCommunication(Id, new Func <object[], object>[] { UpdateCore, GetValueCore, SetValueCore }); }
public int CompareExchange(int value, int comparand) { return((int)RuntimeHost.DoCommunication(Id, CompareExchangeCore, value, comparand)); }
internal void LinkTo(RuntimeHost runtimeHost, params object[] args) { Id.LinkTo(runtimeHost.Id); OnLinkedTo(runtimeHost, args); }
public T Update(Func <T, T> func) { return((T)RuntimeHost.DoCommunication(Id, UpdateCore, func)); }
public void SetSender <TSender>(ref MonitorId monitorId, TSender monitor) where TSender : class, IMethodizedMonitorSender { RuntimeHost.SetSender(ref monitorId, monitor); }
public T GetValue() { return((T)RuntimeHost.DoCommunication(Id, GetValueCore)); }
public void SetSender <TSender>(ref MonitorId[] monitorIds, TSender[] monitors) where TSender : class, IMethodizedMonitorSender { RuntimeHost.SetSender(ref monitorIds, monitors); }
public void SetValue(T value) { RuntimeHost.DoCommunication(Id, SetValueCore, value); }
public void SetSender <TSender>(ref MachineId machineId, TSender machine) where TSender : class, IMethodizedMachineSender { RuntimeHost.SetSender(ref machineId, machine); }
public int Add(int value) { return((int)RuntimeHost.DoCommunication(Id, AddCore, value)); }