public ConfigurationModuleBuilder BindSetEntry <U, T>(GenericType <U> iface, IImpl <T> opt) where U : Name <ISet <T> > { ConfigurationModuleBuilder c = DeepCopy(); Type ifaceType = typeof(U); c.ProcessUse(opt); c.FreeImpls.Add(ifaceType, opt); if (!SetOpts.Contains(opt)) { c.SetOpts.Add(opt); } return(c); }
private void ProcessSet(object impl) { FieldInfo f; Builder.Map.TryGetValue(impl, out f); if (f == null) { var e = new ClassHierarchyException("Unknown Impl/Param when setting " + impl.GetType().Name + ". Did you pass in a field from some other module?"); Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER); } if (!reqSet.Contains(f)) { reqSet.Add(f); } }
private void ProcessUse(object impl) { FieldInfo f; Map.TryGetValue(impl, out f); if (f == null) { var e = new ClassHierarchyException("Unknown Impl/Param when binding " + impl.GetType().Name + ". Did you pass in a field from some other module?"); Utilities.Diagnostics.Exceptions.Throw(e, LOGGER); } if (!reqUsed.Contains(f)) { reqUsed.Add(f); } if (!optUsed.Contains(f)) { optUsed.Add(f); } }