WvStreams
|
Classes | |
class | Iter |
Public Member Functions | |
WvDBusMsg (WvStringParm busname, WvStringParm objectname, WvStringParm ifc, WvStringParm method) | |
Constructs a new WvDBus message. More... | |
WvDBusMsg (WvDBusMsg &_msg) | |
Constructs a new WvDBus message, copying it out of an old one. More... | |
WvDBusMsg (DBusMessage *_msg) | |
Constructs a new WvDBus message from an existing low-level D-Bus message. More... | |
operator DBusMessage * () const | |
void | marshal (WvBuf &buf) |
Locks this message, encodes it in DBus binary protocol format, and adds it to the given buffer. More... | |
WvString | get_sender () const |
WvString | get_dest () const |
WvString | get_path () const |
WvString | get_interface () const |
WvString | get_member () const |
WvString | get_error () const |
uint32_t | get_serial () const |
uint32_t | get_replyserial () const |
bool | is_reply () const |
operator WvString () const | |
void | get_arglist (WvStringList &list) const |
WvString | get_argstr () const |
WvDBusMsg & | append (const char *s) |
The following methods are designed to allow appending various arguments to the message. More... | |
WvDBusMsg & | append (bool b) |
WvDBusMsg & | append (signed char c) |
WvDBusMsg & | append (unsigned char c) |
WvDBusMsg & | append (int16_t i) |
WvDBusMsg & | append (uint16_t i) |
WvDBusMsg & | append (int32_t i) |
WvDBusMsg & | append (uint32_t i) |
WvDBusMsg & | append (int64_t i) |
WvDBusMsg & | append (uint64_t i) |
WvDBusMsg & | append (double d) |
WvDBusMsg & | variant_start (WvStringParm element_type) |
Start a variant. More... | |
WvDBusMsg & | variant_end () |
End a variant. More... | |
WvDBusMsg & | struct_start (WvStringParm element_type) |
Start a struct. More... | |
WvDBusMsg & | struct_end () |
End a struct started with struct_start(). More... | |
WvDBusMsg & | array_start (WvStringParm element_type) |
Start an array. More... | |
WvDBusMsg & | array_end () |
End an array started with array_start(). More... | |
WvDBusMsg & | varray_start (WvStringParm element_type) |
Start a variant-array. More... | |
WvDBusMsg & | varray_end () |
End an array started with array_start(). More... | |
WvDBusMsg | reply () |
Generate a message that will be a reply to this one. More... | |
bool | iserror () const |
Return true if this message is an error response. More... | |
void | send (WvDBusConn &conn) |
A shortcut for sending this message on the given connection. More... | |
Static Public Member Functions | |
static WvDBusMsg * | demarshal (WvBuf &buf) |
Demarshals a new WvDBusMsg from a buffer containing its binary DBus protocol representation. More... | |
static size_t | demarshal_bytes_needed (WvBuf &buf) |
Given a buffer containing what might be the header of a DBus message, checks how many bytes need to be in the buffer in order for it to contain a whole message. More... | |
Protected Attributes | |
DBusMessage * | msg |
WvList< DBusMessageIter > | itlist |
Definition at line 28 of file wvdbusmsg.h.
WvDBusMsg::WvDBusMsg | ( | WvStringParm | busname, |
WvStringParm | objectname, | ||
WvStringParm | ifc, | ||
WvStringParm | method | ||
) |
Constructs a new WvDBus message.
If destination is blank, no destination is set; this is appropriate when using D-BUS in a peer-to-peer context (no message bus).
Definition at line 323 of file wvdbusmsg.cc.
References WvList< T >::prepend().
Referenced by demarshal().
WvDBusMsg::WvDBusMsg | ( | WvDBusMsg & | _msg | ) |
Constructs a new WvDBus message, copying it out of an old one.
Definition at line 331 of file wvdbusmsg.cc.
References WvList< T >::prepend().
WvDBusMsg::WvDBusMsg | ( | DBusMessage * | _msg | ) |
Constructs a new WvDBus message from an existing low-level D-Bus message.
Definition at line 339 of file wvdbusmsg.cc.
References WvList< T >::prepend().
|
virtual |
Definition at line 347 of file wvdbusmsg.cc.
WvDBusMsg::operator DBusMessage * | ( | ) | const |
Definition at line 353 of file wvdbusmsg.cc.
Demarshals a new WvDBusMsg from a buffer containing its binary DBus protocol representation.
You're responsible for freeing the object when done. Returns NULL if the object can't be extracted from the buffer. (Implementation in wvdbusmarshal.cc)
Definition at line 27 of file wvdbusmarshal.cc.
References WvBufBaseCommonImpl< T >::get(), WvBufBaseCommonImpl< T >::peek(), WvBufBaseCommonImpl< T >::used(), and WvDBusMsg().
|
static |
Given a buffer containing what might be the header of a DBus message, checks how many bytes need to be in the buffer in order for it to contain a whole message.
If the return value is <= the number of bytes already in the buffer, then demarshal() will succeed (or the incoming message is corrupt). (Implementation in wvdbusmarshal.cc)
Definition at line 70 of file wvdbusmarshal.cc.
References WvBufBaseCommonImpl< T >::peek(), and WvBufBaseCommonImpl< T >::used().
void WvDBusMsg::marshal | ( | WvBuf & | buf | ) |
Locks this message, encodes it in DBus binary protocol format, and adds it to the given buffer.
This message becomes locked and can no longer be append()ed to. You can marshal it more than once, however (but it will always have the same serial number!!) (Implementation in wvdbusmarshal.cc)
Definition at line 83 of file wvdbusmarshal.cc.
Referenced by WvDBusConn::send().
WvString WvDBusMsg::get_sender | ( | ) | const |
Definition at line 359 of file wvdbusmsg.cc.
WvString WvDBusMsg::get_dest | ( | ) | const |
Definition at line 365 of file wvdbusmsg.cc.
WvString WvDBusMsg::get_path | ( | ) | const |
Definition at line 371 of file wvdbusmsg.cc.
WvString WvDBusMsg::get_interface | ( | ) | const |
Definition at line 377 of file wvdbusmsg.cc.
WvString WvDBusMsg::get_member | ( | ) | const |
Definition at line 383 of file wvdbusmsg.cc.
WvString WvDBusMsg::get_error | ( | ) | const |
Definition at line 389 of file wvdbusmsg.cc.
uint32_t WvDBusMsg::get_serial | ( | ) | const |
Definition at line 406 of file wvdbusmsg.cc.
uint32_t WvDBusMsg::get_replyserial | ( | ) | const |
Definition at line 412 of file wvdbusmsg.cc.
bool WvDBusMsg::is_reply | ( | ) | const |
Definition at line 397 of file wvdbusmsg.cc.
WvDBusMsg::operator WvString | ( | ) | const |
Definition at line 430 of file wvdbusmsg.cc.
void WvDBusMsg::get_arglist | ( | WvStringList & | list | ) | const |
Definition at line 418 of file wvdbusmsg.cc.
WvString WvDBusMsg::get_argstr | ( | ) | const |
Definition at line 424 of file wvdbusmsg.cc.
WvDBusMsg & WvDBusMsg::append | ( | const char * | s | ) |
The following methods are designed to allow appending various arguments to the message.
Definition at line 461 of file wvdbusmsg.cc.
References WvList< T >::first().
Referenced by WvDBusConn::request_name().
WvDBusMsg & WvDBusMsg::append | ( | bool | b | ) |
Definition at line 470 of file wvdbusmsg.cc.
WvDBusMsg & WvDBusMsg::append | ( | signed char | c | ) |
Definition at line 479 of file wvdbusmsg.cc.
WvDBusMsg & WvDBusMsg::append | ( | unsigned char | c | ) |
Definition at line 488 of file wvdbusmsg.cc.
WvDBusMsg & WvDBusMsg::append | ( | int16_t | i | ) |
Definition at line 497 of file wvdbusmsg.cc.
WvDBusMsg & WvDBusMsg::append | ( | uint16_t | i | ) |
Definition at line 505 of file wvdbusmsg.cc.
WvDBusMsg & WvDBusMsg::append | ( | int32_t | i | ) |
Definition at line 513 of file wvdbusmsg.cc.
WvDBusMsg & WvDBusMsg::append | ( | uint32_t | i | ) |
Definition at line 521 of file wvdbusmsg.cc.
WvDBusMsg & WvDBusMsg::append | ( | int64_t | i | ) |
Definition at line 529 of file wvdbusmsg.cc.
WvDBusMsg & WvDBusMsg::append | ( | uint64_t | i | ) |
Definition at line 537 of file wvdbusmsg.cc.
WvDBusMsg & WvDBusMsg::append | ( | double | d | ) |
Definition at line 545 of file wvdbusmsg.cc.
WvDBusMsg & WvDBusMsg::variant_start | ( | WvStringParm | element_type | ) |
Start a variant.
Definition at line 553 of file wvdbusmsg.cc.
References WvList< T >::first(), and WvList< T >::prepend().
Referenced by varray_start().
WvDBusMsg & WvDBusMsg::variant_end | ( | ) |
End a variant.
Definition at line 564 of file wvdbusmsg.cc.
References WvListBase::count(), and WvList< T >::unlink_first().
Referenced by array_end(), and varray_end().
WvDBusMsg & WvDBusMsg::struct_start | ( | WvStringParm | element_type | ) |
Start a struct.
Elements append()ed after this will be inside the struct, and you should be careful that you append the right types in the right order. Finish using struct_end().
Definition at line 580 of file wvdbusmsg.cc.
References WvList< T >::first(), and WvList< T >::prepend().
WvDBusMsg & WvDBusMsg::struct_end | ( | ) |
End a struct started with struct_start().
Definition at line 591 of file wvdbusmsg.cc.
References array_end().
WvDBusMsg & WvDBusMsg::array_start | ( | WvStringParm | element_type | ) |
Start an array.
Elements append()ed after this will be inside the array. Finish using array_end().
Definition at line 597 of file wvdbusmsg.cc.
References WvList< T >::first(), and WvList< T >::prepend().
Referenced by varray_start().
WvDBusMsg & WvDBusMsg::array_end | ( | ) |
End an array started with array_start().
Definition at line 608 of file wvdbusmsg.cc.
References variant_end().
Referenced by struct_end(), and varray_end().
WvDBusMsg & WvDBusMsg::varray_start | ( | WvStringParm | element_type | ) |
Start a variant-array.
Elements append()ed after this will be inside the array. Finish using varray_end().
A variant-array is like an array, but is enclosed automatically inside a variant object. This is useful for arrays of arrays, where each inner array is of a different type.
Definition at line 614 of file wvdbusmsg.cc.
References array_start(), and variant_start().
WvDBusMsg & WvDBusMsg::varray_end | ( | ) |
End an array started with array_start().
Definition at line 621 of file wvdbusmsg.cc.
References array_end(), WvListBase::count(), and variant_end().
WvDBusMsg WvDBusMsg::reply | ( | ) |
Generate a message that will be a reply to this one.
Definition at line 629 of file wvdbusmsg.cc.
bool WvDBusMsg::iserror | ( | ) | const |
Return true if this message is an error response.
Definition at line 635 of file wvdbusmsg.cc.
void WvDBusMsg::send | ( | WvDBusConn & | conn | ) |
A shortcut for sending this message on the given connection.
Equivalent to conn.send(*this).
Definition at line 641 of file wvdbusmsg.cc.
References WvDBusConn::send().
|
mutableprotected |
Definition at line 286 of file wvdbusmsg.h.
|
protected |
Definition at line 287 of file wvdbusmsg.h.