Data structure used to bind interfaces to a particular path. More...
Data Fields | |
| const char * | path |
| Path to bind the interface to. | |
| int | pathSize |
| Length of adbus_Bind::path or -1 if null terminated (default). | |
| adbus_Interface * | interface |
| Interface to bind. | |
| void * | cuser2 |
| User pointer available as adbus_CbData::user2 in all the method and property callbacks. | |
| adbus_ProxyMsgCallback | proxy |
| Callback to a proxy function called to proxy method and property sets/gets to the correct thread. | |
| void * | puser |
| User data for adbus_Bind::proxy. | |
| adbus_Callback | release [2] |
| Release callbacks called when the interface is unbound from this path. | |
| void * | ruser [2] |
| User data for adbus_Bind::release. | |
| adbus_ProxyCallback | relproxy |
| Proxy function for the release callbacks. | |
| void * | relpuser |
Related Functions | |
(Note that these are not member functions.) | |
| void | adbus_bind_init (adbus_Bind *b) |
| Initialises an adbus_Bind structure. | |
Data structure used to bind interfaces to a particular path.
Client code registers for paths by:
For example:
int ExampleMethod(adbus_CbData* d) { Object* o = (Object*) d->user2; o->ExampleMethod(); return 0; } adbus_Interface* CreateInterface() { adbus_Interface* i = adbus_iface_new("com.example.Interface", -1); adbus_Member* m = adbus_iface_addmethod(i, "Example", -1); adbus_mbr_setmethod(m, &ExampleMethod, NULL); return i; } void Bind(adbus_Connection* c, Object* o, const char* path) { adbus_Interface* interface = CreateInterface(); adbus_Bind b; adbus_bind_init(&b); b.path = path; b.interface = interface; b.cuser2 = o; adbus_state_bind(o->state, c, &b); adbus_iface_free(interface); }
User pointer available as adbus_CbData::user2 in all the method and property callbacks.
This user data can be freed on unbind by setting adbus_Bind::release and adbus_Bind::ruser.
Interface to bind.
The interface will be internally ref'd via adbus_iface_ref() after the call to adbus_conn_bind() or adbus_state_bind() so the calling code can "free" the interface if it wants to.
Callback to a proxy function called to proxy method and property sets/gets to the correct thread.
If this value is non-zero the proxy will be used to proxy all calls for this bind. In general it should be set be defaulted using adbus_conn_getproxy().
Proxy function for the release callbacks.
In general this should be defaulted using adbus_conn_getproxy().
1.6.1