2019-11-28 11:55:22 +00:00
|
|
|
#define HOOK(hookName, source, ...) \
|
|
|
|
{ \
|
2020-08-15 13:10:48 +00:00
|
|
|
try { \
|
|
|
|
auto aggregator = source->GetScriptIterator(); \
|
|
|
|
while (aggregator.HasNext()) { \
|
|
|
|
auto next = aggregator.GetNext(); \
|
|
|
|
try { \
|
|
|
|
next->hookName(__VA_ARGS__); \
|
|
|
|
} catch (const std::exception& e) { \
|
2020-08-17 10:18:01 +00:00
|
|
|
THROW("Exception running script hook '" #hookName "': " << e.what()) \
|
2020-08-15 13:10:48 +00:00
|
|
|
} \
|
2020-07-31 12:17:38 +00:00
|
|
|
} \
|
2020-08-15 14:34:52 +00:00
|
|
|
} catch (const ArbUt::Exception& e) { \
|
2020-08-15 13:10:48 +00:00
|
|
|
throw e; \
|
|
|
|
} catch (const std::exception& e) { \
|
2020-08-17 10:18:01 +00:00
|
|
|
THROW("Exception setting up script hook '" #hookName "': " << e.what()) \
|
2020-05-29 16:49:48 +00:00
|
|
|
} \
|
|
|
|
}
|