PageRenderTime 55ms CodeModel.GetById 51ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/LinFu.Proxy.Interfaces/IProxyCache.cs

http://github.com/philiplaureano/LinFu
C# | 40 lines | 10 code | 3 blank | 27 comment | 0 complexity | 372af6359219797591dc6246035c3837 MD5 | raw file
 1using System;
 2
 3namespace LinFu.Proxy.Interfaces
 4{
 5    /// <summary>
 6    ///     Represents an interface for classes that store results from an
 7    ///     <see cref="IProxyFactory" /> instance.
 8    /// </summary>
 9    public interface IProxyCache
10    {
11        /// <summary>
12        ///     Determines whether or not the cache contains an existing proxy type
13        ///     that is derived from the <paramref name="baseType" /> and implements
14        ///     the given <paramref name="baseInterfaces" />.
15        /// </summary>
16        /// <param name="baseType">The base type of the dynamically-generated proxy type.</param>
17        /// <param name="baseInterfaces">The list of interfaces that the generated proxy type must implement.</param>
18        /// <returns>Returns <c>true</c> if the proxy type already exists; otherwise, it will return <c>false.</c></returns>
19        bool Contains(Type baseType, params Type[] baseInterfaces);
20
21        /// <summary>
22        ///     Retrieves an existing proxy type from the cache.
23        /// </summary>
24        /// <param name="baseType">The base type of the dynamically-generated proxy type.</param>
25        /// <param name="baseInterfaces">The list of interfaces that the generated proxy type must implement.</param>
26        /// <returns>
27        ///     Returns a valid <see cref="Type" /> if the type already exists; otherwise, it might return <c>null</c> or opt
28        ///     to throw an exception.
29        /// </returns>
30        Type Get(Type baseType, params Type[] baseInterfaces);
31
32        /// <summary>
33        ///     Stores a proxy type in the cache.
34        /// </summary>
35        /// <param name="result">The proxy type to be stored.</param>
36        /// <param name="baseType">The base type of the dynamically-generated proxy type.</param>
37        /// <param name="baseInterfaces">The list of interfaces that the generated proxy type must implement.</param>
38        void Store(Type result, Type baseType, params Type[] baseInterfaces);
39    }
40}