Esempio n. 1
0
        /// <summary>
        /// Insert element.
        /// </summary>
        /// <typeparam name="TType">Codegen configuration type.</typeparam>
        /// <typeparam name="TProxy">Codegen proxy.</typeparam>
        /// <param name="componentConfig"></param>
        public void UpdateConfig <TType, TProxy>(ComponentConfig <TType, TProxy> componentConfig)
            where TType : ICodegenType, new()
            where TProxy : ICodegenProxy <TType, TProxy>, new()
        {
            uint slotIndex = 0;

            SharedConfig <TProxy> sharedConfig = MlosProxyInternal.SharedConfigDictionaryLookup <ProbingPolicy> .Get <TProxy>(SharedConfigDictionary, componentConfig.Config, ref slotIndex);

            if (sharedConfig.Buffer == IntPtr.Zero)
            {
                throw new KeyNotFoundException("Unable to locate config");
            }

            componentConfig.Config.Update(sharedConfig.Config);
        }
Esempio n. 2
0
        /// <summary>
        /// Insert element.
        /// </summary>
        /// <typeparam name="TType">Codegen configuration type.</typeparam>
        /// <typeparam name="TProxy">Codegen proxy.</typeparam>
        /// <param name="componentConfig"></param>
        public void UpdateConfig <TType, TProxy>(ComponentConfig <TType, TProxy> componentConfig)
            where TType : ICodegenType, new()
            where TProxy : ICodegenProxy <TType, TProxy>, new()
        {
            uint slotIndex = 0;

            SharedConfig <TProxy> sharedConfig = sharedConfigMemoryRegion.Get <ProbingPolicy, TProxy>(componentConfig.Config, ref slotIndex);

            if (sharedConfig.Buffer == IntPtr.Zero)
            {
                throw new KeyNotFoundException("Unable to locate config");
            }

            componentConfig.Config.Update(sharedConfig.Config);
        }
Esempio n. 3
0
 /// <inheritdoc />
 public bool Equals(SharedConfig <TProxy> other) => Buffer == other.Buffer;