mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 17:21:16 +08:00
25 lines
732 B
C#
25 lines
732 B
C#
// Copyright (c) 2025-2026 GeWuYou
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
namespace GFramework.Core.Abstractions.Pool;
|
|
|
|
/// <summary>
|
|
/// 定义可池化对象的接口,提供对象在池中的生命周期管理方法
|
|
/// </summary>
|
|
public interface IPoolableObject
|
|
{
|
|
/// <summary>
|
|
/// 当对象从池中被获取时调用,用于初始化或重置对象状态
|
|
/// </summary>
|
|
void OnAcquire();
|
|
|
|
/// <summary>
|
|
/// 当对象被释放回池中时调用,用于清理或重置对象状态以便下次使用
|
|
/// </summary>
|
|
void OnRelease();
|
|
|
|
/// <summary>
|
|
/// 当对象池被销毁时调用,用于执行最终的清理工作
|
|
/// </summary>
|
|
void OnPoolDestroy();
|
|
} |