Ejemplo n.º 1
0
 /// <summary>
 /// Create a specified type and name of object pool.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="poolSize"></param>
 /// <param name="createObjectFunc"></param>
 /// <param name="getObjectHandler"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 /// <exception cref="ArgumentException"></exception>
 // ReSharper disable once MemberHidesStaticFromOuterClass
 public static IObjectPool <T> Create <T>(string name, int poolSize, Func <T> createObjectFunc, Action <ObjectBox <T> > getObjectHandler = null)
 => ManagedModels.Create <T, TManagedModel>(name, poolSize, createObjectFunc, getObjectHandler);
Ejemplo n.º 2
0
 /// <summary>
 /// Create a specified type and name of object pool.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="poolFunc"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 /// <exception cref="ArgumentException"></exception>
 // ReSharper disable once MemberHidesStaticFromOuterClass
 public static IObjectPool <T> Create <T>(string name, Func <IObjectPool <T> > poolFunc)
 => ManagedModels.Create <T, TManagedModel>(name, poolFunc);
Ejemplo n.º 3
0
 /// <summary>
 /// Create a specified type and name of object pool.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="pool"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 /// <exception cref="ArgumentException"></exception>
 // ReSharper disable once MemberHidesStaticFromOuterClass
 public static IObjectPool <T> Create <T>(string name, IObjectPool <T> pool)
 => ManagedModels.Create <T, TManagedModel>(name, pool);
Ejemplo n.º 4
0
 /// <summary>
 /// Create a specified type of object pool.
 /// </summary>
 /// <param name="poolFunc"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 /// <exception cref="ArgumentException"></exception>
 // ReSharper disable once MemberHidesStaticFromOuterClass
 public static IObjectPool <T> Create <T>(Func <IObjectPool <T> > poolFunc)
 => ManagedModels.Create <T, TManagedModel>(poolFunc);
Ejemplo n.º 5
0
 /// <summary>
 /// Create a specified type of object pool.
 /// </summary>
 /// <param name="pool"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 /// <exception cref="ArgumentException"></exception>
 // ReSharper disable once MemberHidesStaticFromOuterClass
 public static IObjectPool <T> Create <T>(IObjectPool <T> pool)
 => ManagedModels.Create <T, TManagedModel>(pool);
Ejemplo n.º 6
0
 /// <summary>
 /// Create a specified type of object pool.
 /// </summary>
 /// <param name="policy"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 // ReSharper disable once MemberHidesStaticFromOuterClass
 public static IObjectPool <T> Create <T>(IPolicy <T> policy)
 => ManagedModels.Create <T, TManagedModel>(policy);