PenetrateBase/PenetrateBasic/validate.h

28 lines
576 B
C
Raw Normal View History

2024-11-16 11:55:32 +00:00
#pragma once
2024-11-17 15:36:43 +00:00
#include "validate_basic.h"
2024-11-17 14:39:24 +00:00
#include "dispatch.h"
namespace verify {
template<typename... Types> struct T;
template<typename Ret, typename... Args>
struct T<Ret(Args...)> {
template<Inlet::Callable<Ret, Args...> func>
2024-11-17 15:36:43 +00:00
struct Validate {
2024-11-17 14:39:24 +00:00
private:
validate::ValidateImpls<(void*)func, Ret, Args...> _helper;
public:
2024-11-17 15:36:43 +00:00
Validate() {
2024-11-17 14:39:24 +00:00
auto core = dispatch::Dispatch::unique();
core->setCmdValidator(_helper.address(), & _helper);
}
template<int n> validate::ArgsPosition<n, Args...> pos() {
return _helper.pos<n>();
}
};
};
}