7 #ifndef _QI_TYPE_PROXYPROPERTY_HPP_
8 #define _QI_TYPE_PROXYPROPERTY_HPP_
21 template <
typename T,
template<
class...>
class PropertyType = Property >
35 setup(
object, propertyName);
43 T getter(
GenericObject*
object,
const std::string& propertyName);
44 bool setter(T&,
const T&,
GenericObject*
object,
const std::string& propertyName);
47 template<
typename T,
template<
class...>
class PropertyType>
51 proxy.
setup(
object, signalName);
53 template<
typename T,
template<
class...>
class PropertyType>
56 target.
setup(
object, signalName);
59 template<
typename T,
template<
class...>
class PropertyType>
62 SignalType::disconnectAll();
65 template<
typename T,
template<
class...>
class PropertyType>
72 object.asGenericObject(), propertyName));
75 this->_getter =
boost::bind(&ThisProxyType::getter,
this,
object.asGenericObject(), propertyName);
76 this->_setter =
boost::bind(&ThisProxyType::setter,
this, _1, _2,
object.asGenericObject(), propertyName);
79 template<
typename T,
template<
class...>
class PropertyType>
84 link =
object->
connect(propertyName,
91 bool ok = !
object->disconnect(link).hasError();
93 qiLogError(
"qitype.proxysignal") <<
"Failed to disconnect from parent signal";
98 object, propertyName, link));
102 template<
typename T,
template<
class...>
class PropertyType>
106 SignalType::callSubscribers(args);
110 template<
typename T,
template<
class...>
class PropertyType>
116 object->metaPost(propertyName, params);
118 template<
typename T,
template<
class...>
class PropertyType>
121 return object->property<T>(propertyName).value();
123 template<
typename T,
template<
class...>
class PropertyType>
124 bool ProxyProperty<T, PropertyType>::setter(T& target,
const T& v, GenericObject*
object,
const std::string& propertyName)
127 object->setProperty(propertyName, v).value();
132 #endif // _QITYPE_PROXYPROPERTY_HPP_
ProxyProperty(AnyObject object, const std::string &propertyName)
void connect(const AF &fun, FutureCallbackType type=FutureCallbackType_Auto)
Future< void > onSubscribe(bool enable, GenericObject *object, const std::string &propertyName, SignalLink link)
static const SignalLink invalidSignalLink
void setOnSubscribers(OnSubscribers onSubscribers)
AnyReference bounceEvent(const AnyReferenceVector args)
void setTriggerOverride(Trigger trigger)
#define qiLogError(...)
Log in error mode.
void makeProxyProperty(PropertyType< T > &target, AnyObject object, const std::string &signalName)
void setup(AnyObject object, const std::string &propertyName)
std::vector< AnyReference > AnyReferenceVector
void triggerOverride(const GenericFunctionParameters ¶ms, MetaCallType, GenericObject *object, const std::string &propertyName)
static AnyFunction fromDynamicFunction(DynamicFunction f)
std::enable_if< std::is_function< RF >::value, boost::function< RF > >::type bind(AF &&fun, Arg0 &&arg0, Args &&...args)