/// <inheritdoc/> public SharedConfig <TProxy> Lookup <TType, TProxy>(ICodegenType <TType, TProxy> codegenType) where TType : ICodegenType, new() where TProxy : ICodegenProxy <TType, TProxy>, new() { uint slotIndex = 0; return(SharedConfigDictionaryLookup <ProbingPolicy> .Get <TProxy>(SharedConfigDictionary, codegenType, ref slotIndex)); }
/// <inheritdoc/> public SharedConfig <TProxy> Lookup <TProxy>() where TProxy : ICodegenProxy, new() { // #TODO make sure, ICodegenProxy does not have any fields to compare // uint slotIndex = 0; return(SharedConfigDictionaryLookup <ProbingPolicy> .Get <TProxy>(SharedConfigDictionary, default(TProxy), ref slotIndex)); }
/// <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 = 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); }