14 #ifndef __WVDBUSCONN_H 15 #define __WVDBUSCONN_H 17 #include "wvstreamclone.h" 19 #include "wvdbusmsg.h" 20 #include "wvhashtable.h" 23 #define WVDBUS_DEFAULT_TIMEOUT (300*1000) 32 typedef wv::function<bool(WvDBusMsg&)> WvDBusCallback;
51 virtual wvuid_t get_uid() = 0;
61 virtual wvuid_t get_uid();
67 bool client, authorized, in_post_select;
106 wvuid_t get_uid() {
return auth ? auth->get_uid() : WVUID_INVALID; }
109 void out(WVSTRING_FORMAT_DECL)
110 {
return out(
WvString(WVSTRING_FORMAT_CALL)); }
119 void request_name(
WvStringParm name,
const WvDBusCallback &onreply = 0,
120 time_t msec_timeout = WVDBUS_DEFAULT_TIMEOUT);
132 virtual void close();
144 void send(
WvDBusMsg msg,
const WvDBusCallback &onreply,
145 time_t msec_timeout = WVDBUS_DEFAULT_TIMEOUT);
163 time_t msec_timeout = WVDBUS_DEFAULT_TIMEOUT,
164 wv::function<
void(uint32_t)> serial_cb = 0);
198 void add_callback(
CallbackPri pri, WvDBusCallback cb,
void *cookie = NULL);
203 void del_callback(
void *cookie);
210 virtual bool filter_func(
WvDBusMsg &msg);
220 time_t mintimeout_msec();
230 Pending(
WvDBusMsg &_msg,
const WvDBusCallback &_cb,
234 serial = msg.get_serial();
235 if (msec_timeout < 0)
236 msec_timeout = 5*3600*1000;
237 valid_until = msecadd(wvstime(), msec_timeout);
240 DeclareWvDict(Pending, uint32_t, serial);
245 void expire_pending(Pending *p);
246 void cancel_pending(uint32_t serial);
247 void add_pending(
WvDBusMsg &msg, WvDBusCallback cb,
248 time_t msec_timeout);
258 const WvDBusCallback &_cb,
void *_cookie)
260 { pri = _pri; cookie = _cookie; }
262 static int priority_order(
const CallbackInfo *a,
const CallbackInfo *b);
264 DeclareWvList(CallbackInfo);
265 CallbackInfoList callbacks;
269 #endif // __WVDBUSCONN_H A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
Based on (and interchangeable with) struct timeval.
the data structure used by pre_select()/post_select() and internally by select(). ...
CallbackPri
The priority level of a callback registration.
virtual bool authorize(WvDBusConn &c)=0
Main action callback.
WvString is an implementation of a simple and efficient printable-string class.
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's...
WvStreamClone simply forwards all requests to the "cloned" stream.