update
This commit is contained in:
parent
fe721162ac
commit
ba7ac2503d
|
@ -3,6 +3,7 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include "data_types.h"
|
#include "data_types.h"
|
||||||
|
#include "validation.h"
|
||||||
|
|
||||||
namespace Inlet {
|
namespace Inlet {
|
||||||
template<typename... Types> struct SignatureImpl;
|
template<typename... Types> struct SignatureImpl;
|
||||||
|
@ -50,6 +51,10 @@ namespace Inlet {
|
||||||
SignatureImpl() : SignatureImpl<Ret, Args...>(), _args_value(First()) { }
|
SignatureImpl() : SignatureImpl<Ret, Args...>(), _args_value(First()) { }
|
||||||
SignatureImpl(First a0, Args... args) :SignatureImpl<Ret, Args...>(args...), _args_value(a0) { }
|
SignatureImpl(First a0, Args... args) :SignatureImpl<Ret, Args...>(args...), _args_value(a0) { }
|
||||||
|
|
||||||
|
First getArgs0() {
|
||||||
|
return _args_value;
|
||||||
|
}
|
||||||
|
|
||||||
Ret execute(std::function<Ret(First, Args...)> unit) {
|
Ret execute(std::function<Ret(First, Args...)> unit) {
|
||||||
auto unit_wrap = [&](Args... args) {
|
auto unit_wrap = [&](Args... args) {
|
||||||
return unit(_args_value, args...);
|
return unit(_args_value, args...);
|
||||||
|
|
|
@ -144,6 +144,10 @@ namespace validate {
|
||||||
template<void* func, typename... types> struct ValidateHelper;
|
template<void* func, typename... types> struct ValidateHelper;
|
||||||
template<void* func, typename return_type, typename... args_type>
|
template<void* func, typename return_type, typename... args_type>
|
||||||
struct ValidateHelper<func, return_type, args_type...> : public ValidateTemplet<args_type...> {
|
struct ValidateHelper<func, return_type, args_type...> : public ValidateTemplet<args_type...> {
|
||||||
|
quint64 address() const {
|
||||||
|
return (quint64) func;
|
||||||
|
}
|
||||||
|
|
||||||
template<int n> ArgsPosition<n, args_type...> pos() {
|
template<int n> ArgsPosition<n, args_type...> pos() {
|
||||||
return ArgsPosition<n, args_type...>(*this);
|
return ArgsPosition<n, args_type...>(*this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue