7 #ifndef _QITYPE_DETAIL_PROXY_REGISTER_HPP_
8 #define _QITYPE_DETAIL_PROXY_REGISTER_HPP_
42 typedef boost::function<Proxy*(void*)>
ToProxy;
72 virtual const std::vector<std::pair<TypeInterface*, int> >&
parentTypes()
74 static std::vector<std::pair<TypeInterface*, int> > empty;
100 typedef boost::function<Proxy*(void*)>
ToProxy;
116 return static_cast<Proxy*
>((ProxyImpl*)storage);
119 template<
typename ProxyImpl>
128 template<
typename ProxyImpl>
133 result =
new TypeProxy(&static_proxy_cast<ProxyImpl>);
137 template<
typename ProxyImpl>
140 boost::shared_ptr<ProxyImpl> sp(
new ProxyImpl(ptr));
151 template<
typename Proxy,
typename Interface>
154 qiLogVerbose(
"qitype.type") <<
"ProxyInterface registration " << typeOf<Interface>()->infoString();
159 map[typeOf<Interface>()->info()] = boost::function<AnyReference(AnyObject)>(&detail::makeProxy<Proxy>);
168 template<
typename ProxyType>
177 registerType(
typeid(ProxyType), detail::makeProxyInterfaceWrapper<ProxyType>());
179 map[typeOf<ProxyType>()->info()] = boost::function<AnyReference(AnyObject)>(&detail::makeProxy<ProxyType>);
185 #define QI_REGISTER_PROXY(Proxy) \
187 static bool BOOST_PP_CAT(_qi_register_proxy_, Proxy) = \
188 ::qi::registerProxy<Proxy>(); \
191 #define QI_REGISTER_PROXY_INTERFACE(Proxy, Interface) \
193 static bool BOOST_PP_CAT(_qi_register_proxy_, Proxy) = \
194 ::qi::registerProxyInterface<Proxy, Interface>(); \
TypeProxyWrapper(ToProxy toProxy)
GenericObject * asGenericObject() const
qi::FutureSync< void > disconnect(SignalLink linkId) const
_QI_BOUNCE_TYPE_METHODS(Methods)
bool registerProxyInterface()
boost::function< Proxy *(void *)> ToProxy
virtual qi::Future< AnyValue > property(void *instance, AnyObject context, unsigned int id)
#define qiLogVerbose(...)
Log in verbose mode. This level is not shown by default.
TypeProxy * makeProxyInterface()
DefaultTypeImplMethods< Proxy > Methods
qi::FutureSync< SignalLink > connect(const std::string &eventName, FUNCTOR_TYPE callback, MetaCallType threadingModel=MetaCallType_Auto) const
virtual qi::Future< void > setProperty(void *instance, AnyObject context, unsigned int id, AnyValue value)=0
virtual qi::Future< AnyValue > property(void *instance, AnyObject context, unsigned int id)=0
virtual qi::Future< void > disconnect(void *instance, AnyObject context, SignalLink linkId)
Disconnect an event link. Returns if disconnection was successful.
bool registerType(const std::type_info &typeId, TypeInterface *type)
Runtime Type factory setter.
TypeProxy * makeProxyInterfaceWrapper()
TypeProxy(ToProxy toProxy)
ProxyGeneratorMap & proxyGeneratorMap()
Object< Empty > asObject() const
virtual const MetaObject & metaObject(void *instance)
virtual qi::Future< AnyReference > metaCall(void *instance, AnyObject context, unsigned int method, const GenericFunctionParameters ¶ms, MetaCallType callType, Signature returnSignature)
const MetaObject & metaObject() const
virtual qi::Future< SignalLink > connect(void *instance, AnyObject context, unsigned int event, const SignalSubscriber &subscriber)
void metaPost(unsigned int event, const GenericFunctionParameters ¶ms) const
ObjectTypeInterface * type
virtual void metaPost(void *instance, AnyObject context, unsigned int signal, const GenericFunctionParameters ¶ms)
DefaultTypeImplMethods< T > Methods
AnyReference makeProxy(AnyObject ptr)
Object< Empty > AnyObject
AnyReference clone() const
_QI_BOUNCE_TYPE_METHODS(Methods)
boost::function< Proxy *(void *)> ToProxy
qi::Future< AnyReference > metaCall(unsigned int method, const GenericFunctionParameters ¶ms, MetaCallType callType=MetaCallType_Auto, Signature returnSignature=Signature()) const
virtual const std::vector< std::pair< TypeInterface *, int > > & parentTypes()
std::map< TypeInfo, boost::function< AnyReference(AnyObject)> > ProxyGeneratorMap
static AnyReference from(const T &ref)
virtual qi::Future< void > setProperty(void *instance, AnyObject context, unsigned int id, AnyValue value)
Proxy * static_proxy_cast(void *storage)
int context()
Get log context.