Example #1
0
        /// <summary>
        /// 分配一个实例
        /// </summary>
        /// <typeparam name="T"> RecyclableObject </typeparam>
        /// <param name=" envType"></param>
        /// <returns></returns>
        public static T Allocate <T>(EnvironmentType envType) where T : RecyclableObject
        {
            var _env = Framework.GetEnv(envType);

            return(Allocate <T>(_env));
        }
Example #2
0
        /// <summary>
        /// 分配一个实例
        /// </summary>
        /// <param name="type">类型</param>
        /// <param name=" envType"></param>
        /// <returns></returns>
        public static RecyclableObject Allocate(Type type, EnvironmentType envType)
        {
            var _env = Framework.GetEnv(envType);

            return(Allocate(type, _env));
        }
Example #3
0
        /// <summary>
        /// 回收所有实例
        /// </summary>
        /// <param name="envType"></param>
        public static void RecyleAll(EnvironmentType envType)
        {
            var _env = Framework.GetEnv(envType);

            RecyleAll(_env);
        }
Example #4
0
        /// <summary>
        /// 获取没有回收的实例
        /// </summary>
        /// <param name="envType"></param>
        /// <param name="id"></param>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static bool GetFromMemory(EnvironmentType envType, Guid id, out RecyclableObject obj)
        {
            var _env = Framework.GetEnv(envType);

            return(GetFromMemory(_env, id, out obj));
        }
Example #5
0
        /// <summary>
        /// 通过唯一id回收对象
        /// </summary>
        /// <param name="envType"></param>
        /// <param name="guid"></param>
        public static void RecyleByGuid(EnvironmentType envType, Guid guid)
        {
            var _env = Framework.GetEnv(envType);

            RecyleByGuid(_env, guid);
        }