29 using System.Collections.Generic;
32 namespace OpenSim.Framework
36 protected Dictionary<Type, object> m_moduleInterfaces =
new Dictionary<Type, object>();
43 public void RegisterInterface<T>(T iface)
45 lock (m_moduleInterfaces)
47 if (!m_moduleInterfaces.ContainsKey(typeof(T)))
49 m_moduleInterfaces.Add(typeof(T), iface);
54 public bool TryGet<T>(out T iface)
56 if (m_moduleInterfaces.ContainsKey(typeof(T)))
58 iface = (T)m_moduleInterfaces[typeof(T)];
67 return (T)m_moduleInterfaces[typeof(T)];
70 public void StackModuleInterface<M>(M mod)
74 public T[] RequestModuleInterfaces<T>()
76 return new T[] {
default(T) };