SimpleWindow
载入中...
搜索中...
未找到
INotifyObjectDead.h
1#pragma once
2
3#include "Delegate.h"
4
5namespace sw
6{
7 class INotifyObjectDead; // 向前声明
8
12 using ObjectDeadEventHandler = Action<INotifyObjectDead &>;
13
18 {
19 public:
24
29 {
30 if (ObjectDead) {
31 ObjectDead(*this);
32 }
33 }
34 };
35}
Definition Delegate.h:21
对象销毁通知接口
Definition INotifyObjectDead.h:18
ObjectDeadEventHandler ObjectDead
对象销毁时触发该事件
Definition INotifyObjectDead.h:23
virtual ~INotifyObjectDead()
析构时触发对象销毁事件
Definition INotifyObjectDead.h:28