Simulant
21.12-1275
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
simulant
generic
notifies_destruction.h
1
#pragma once
2
3
#include "../signals/signal.h"
4
#include "../logging.h"
5
6
namespace
smlt
{
7
8
template
<
typename
T>
9
class
NotifiesDestruction
{
10
typedef
sig::signal
<void (T*)>
destruction_signal
;
11
12
DEFINE_SIGNAL(
destruction_signal
, signal_destruction);
13
14
public
:
15
virtual
~
NotifiesDestruction
() {
16
try
{
17
signal_destruction_((T*)
this
);
18
}
catch
(...) {
19
S_WARN(
_F
(
"Exception while signaling destruction of object {0} at {1}"
).format(
20
typeid
(T).name(),
this
21
));
22
}
23
}
24
};
25
26
}
smlt
Definition:
animation.cpp:25
smlt::Formatter
Definition:
formatter.h:12
smlt::NotifiesDestruction
Definition:
notifies_destruction.h:9
smlt::sig::signal
Definition:
signal.h:330
Generated by
1.8.20