17 #include <type_traits>
22 template <
typename ValueType>
25 return this->
getEnvironment()->convertProxyToObject(*this).convert<ValueType>();
35 typename std::enable_if<!std::is_same<T, Proxy>::value, T>::type
36 convertProxy(
const Proxy &p)
38 return p.convert<T>();
42 typename std::enable_if<std::is_same<T, Proxy>::value, T>::type
43 convertProxy(
const Proxy &p)
55 return env->makeProxy(value);
65 #for $NARGS in range($MAX_ARGS)
66 template <
typename ReturnType, $expand('
typename A%d', $NARGS)>
67 ReturnType
Proxy::call(
const std::string &name, $expand(
'const A%d &a%d', $NARGS))
const
69 Proxy args[$(max(1, $NARGS))];
70 #for $i in range($NARGS):
75 Proxy ret = handle->
call(name, args, $NARGS);
76 return Detail::convertProxy<ReturnType>(ret);
80 template <$expand('
typename A%d', $NARGS)>
83 return this->call<Proxy, $expand('A%d', $NARGS)>(name, $expand(
'a%d', $NARGS));
86 template <$expand('
typename A%d', $NARGS)>
87 void Proxy::callVoid(
const std::string &name, $expand(
'const A%d &a%d', $NARGS))
const
89 this->call<Proxy, $expand('A%d', $NARGS)>(name, $expand(
'a%d', $NARGS));
ReturnType call(const std::string &name) const
Call a method with a return type and 0 args.
Definition: ProxyImpl.hpp:66
std::shared_ptr< ProxyEnvironment > Sptr
Definition: Environment.hpp:45
std::shared_ptr< ProxyEnvironment > getEnvironment(void) const
void callVoid(const std::string &name) const
Call a method with a void return and 0 args.
Definition: Proxy.hpp:240
Proxy callProxy(const std::string &name) const
Call a method with a Proxy return and 0 args.
Definition: Proxy.hpp:235
std::shared_ptr< ProxyHandle > getHandle(void) const
Get the handle held in this proxy object.
ValueType convert(void) const
Definition: ProxyImpl.hpp:23