WvStreams
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
WvDBusReplyMsg Class Reference
Inheritance diagram for WvDBusReplyMsg:
Inheritance graph
[legend]

Public Member Functions

 WvDBusReplyMsg (DBusMessage *_msg)
 Constructs a new reply message (a message intended to be a reply to an existing D-Bus message).
 
 operator DBusMessage * () const
 
void marshal (WvBuf &buf)
 Locks this message, encodes it in DBus binary protocol format, and adds it to the given buffer.
 
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
 
WvDBusMsgappend (const char *s)
 The following methods are designed to allow appending various arguments to the message.
 
WvDBusMsgappend (bool b)
 
WvDBusMsgappend (signed char c)
 
WvDBusMsgappend (unsigned char c)
 
WvDBusMsgappend (int16_t i)
 
WvDBusMsgappend (uint16_t i)
 
WvDBusMsgappend (int32_t i)
 
WvDBusMsgappend (uint32_t i)
 
WvDBusMsgappend (int64_t i)
 
WvDBusMsgappend (uint64_t i)
 
WvDBusMsgappend (double d)
 
WvDBusMsgvariant_start (WvStringParm element_type)
 Start a variant.
 
WvDBusMsgvariant_end ()
 End a variant.
 
WvDBusMsgstruct_start (WvStringParm element_type)
 Start a struct.
 
WvDBusMsgstruct_end ()
 End a struct started with struct_start().
 
WvDBusMsgarray_start (WvStringParm element_type)
 Start an array.
 
WvDBusMsgarray_end ()
 End an array started with array_start().
 
WvDBusMsgvarray_start (WvStringParm element_type)
 Start a variant-array.
 
WvDBusMsgvarray_end ()
 End an array started with array_start().
 
WvDBusMsg reply ()
 Generate a message that will be a reply to this one.
 
bool iserror () const
 Return true if this message is an error response.
 
void send (WvDBusConn &conn)
 A shortcut for sending this message on the given connection.
 

Static Public Member Functions

static WvDBusMsgdemarshal (WvBuf &buf)
 Demarshals a new WvDBusMsg from a buffer containing its binary DBus protocol representation.
 
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.
 

Protected Attributes

DBusMessage * msg
 
WvList< DBusMessageIter > itlist
 

Detailed Description

Definition at line 18 of file wvdbusmsg.cc.

Constructor & Destructor Documentation

◆ WvDBusReplyMsg()

WvDBusReplyMsg::WvDBusReplyMsg ( DBusMessage *  _msg)

Constructs a new reply message (a message intended to be a reply to an existing D-Bus message).

Don't call this directly. Use WvDBusMsg::reply() instead.

Definition at line 647 of file wvdbusmsg.cc.

◆ ~WvDBusReplyMsg()

virtual WvDBusReplyMsg::~WvDBusReplyMsg ( )
inlinevirtual

Definition at line 29 of file wvdbusmsg.cc.

Member Function Documentation

◆ operator DBusMessage *()

WvDBusMsg::operator DBusMessage * ( ) const
inherited

Definition at line 353 of file wvdbusmsg.cc.

◆ demarshal()

WvDBusMsg * WvDBusMsg::demarshal ( WvBuf &  buf)
staticinherited

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 >::peek(), WvBufBaseCommonImpl< T >::put(), and WvBufBaseCommonImpl< T >::used().

◆ demarshal_bytes_needed()

size_t WvDBusMsg::demarshal_bytes_needed ( WvBuf &  buf)
staticinherited

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(), WvBufBaseCommonImpl< T >::put(), and WvBufBaseCommonImpl< T >::used().

◆ marshal()

void WvDBusMsg::marshal ( WvBuf &  buf)
inherited

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().

◆ get_sender()

WvString WvDBusMsg::get_sender ( ) const
inherited

Definition at line 359 of file wvdbusmsg.cc.

◆ get_dest()

WvString WvDBusMsg::get_dest ( ) const
inherited

Definition at line 365 of file wvdbusmsg.cc.

◆ get_path()

WvString WvDBusMsg::get_path ( ) const
inherited

Definition at line 371 of file wvdbusmsg.cc.

◆ get_interface()

WvString WvDBusMsg::get_interface ( ) const
inherited

Definition at line 377 of file wvdbusmsg.cc.

◆ get_member()

WvString WvDBusMsg::get_member ( ) const
inherited

Definition at line 383 of file wvdbusmsg.cc.

◆ get_error()

WvString WvDBusMsg::get_error ( ) const
inherited

Definition at line 389 of file wvdbusmsg.cc.

◆ get_serial()

uint32_t WvDBusMsg::get_serial ( ) const
inherited

Definition at line 406 of file wvdbusmsg.cc.

◆ get_replyserial()

uint32_t WvDBusMsg::get_replyserial ( ) const
inherited

Definition at line 412 of file wvdbusmsg.cc.

◆ is_reply()

bool WvDBusMsg::is_reply ( ) const
inherited

Definition at line 397 of file wvdbusmsg.cc.

◆ operator WvString()

WvDBusMsg::operator WvString ( ) const
inherited

Definition at line 430 of file wvdbusmsg.cc.

◆ get_arglist()

void WvDBusMsg::get_arglist ( WvStringList list) const
inherited

Definition at line 418 of file wvdbusmsg.cc.

◆ get_argstr()

WvString WvDBusMsg::get_argstr ( ) const
inherited

Definition at line 424 of file wvdbusmsg.cc.

◆ append() [1/11]

WvDBusMsg & WvDBusMsg::append ( const char *  s)
inherited

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().

◆ append() [2/11]

WvDBusMsg & WvDBusMsg::append ( bool  b)
inherited

Definition at line 470 of file wvdbusmsg.cc.

◆ append() [3/11]

WvDBusMsg & WvDBusMsg::append ( signed char  c)
inherited

Definition at line 479 of file wvdbusmsg.cc.

◆ append() [4/11]

WvDBusMsg & WvDBusMsg::append ( unsigned char  c)
inherited

Definition at line 488 of file wvdbusmsg.cc.

◆ append() [5/11]

WvDBusMsg & WvDBusMsg::append ( int16_t  i)
inherited

Definition at line 497 of file wvdbusmsg.cc.

◆ append() [6/11]

WvDBusMsg & WvDBusMsg::append ( uint16_t  i)
inherited

Definition at line 505 of file wvdbusmsg.cc.

◆ append() [7/11]

WvDBusMsg & WvDBusMsg::append ( int32_t  i)
inherited

Definition at line 513 of file wvdbusmsg.cc.

◆ append() [8/11]

WvDBusMsg & WvDBusMsg::append ( uint32_t  i)
inherited

Definition at line 521 of file wvdbusmsg.cc.

◆ append() [9/11]

WvDBusMsg & WvDBusMsg::append ( int64_t  i)
inherited

Definition at line 529 of file wvdbusmsg.cc.

◆ append() [10/11]

WvDBusMsg & WvDBusMsg::append ( uint64_t  i)
inherited

Definition at line 537 of file wvdbusmsg.cc.

◆ append() [11/11]

WvDBusMsg & WvDBusMsg::append ( double  d)
inherited

Definition at line 545 of file wvdbusmsg.cc.

◆ variant_start()

WvDBusMsg & WvDBusMsg::variant_start ( WvStringParm  element_type)
inherited

Start a variant.

Definition at line 553 of file wvdbusmsg.cc.

References WvList< T >::first(), and WvList< T >::prepend().

Referenced by WvDBusMsg::varray_start().

◆ variant_end()

WvDBusMsg & WvDBusMsg::variant_end ( )
inherited

◆ struct_start()

WvDBusMsg & WvDBusMsg::struct_start ( WvStringParm  element_type)
inherited

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().

◆ struct_end()

WvDBusMsg & WvDBusMsg::struct_end ( )
inherited

End a struct started with struct_start().

Definition at line 591 of file wvdbusmsg.cc.

References WvDBusMsg::array_end().

◆ array_start()

WvDBusMsg & WvDBusMsg::array_start ( WvStringParm  element_type)
inherited

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 WvDBusMsg::varray_start().

◆ array_end()

WvDBusMsg & WvDBusMsg::array_end ( )
inherited

End an array started with array_start().

Definition at line 608 of file wvdbusmsg.cc.

References WvDBusMsg::variant_end().

Referenced by WvDBusMsg::struct_end(), and WvDBusMsg::varray_end().

◆ varray_start()

WvDBusMsg & WvDBusMsg::varray_start ( WvStringParm  element_type)
inherited

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 WvDBusMsg::array_start(), and WvDBusMsg::variant_start().

◆ varray_end()

WvDBusMsg & WvDBusMsg::varray_end ( )
inherited

End an array started with array_start().

Definition at line 621 of file wvdbusmsg.cc.

References WvDBusMsg::array_end(), WvListBase::count(), and WvDBusMsg::variant_end().

◆ reply()

WvDBusMsg WvDBusMsg::reply ( )
inherited

Generate a message that will be a reply to this one.

Definition at line 629 of file wvdbusmsg.cc.

◆ iserror()

bool WvDBusMsg::iserror ( ) const
inherited

Return true if this message is an error response.

Definition at line 635 of file wvdbusmsg.cc.

◆ send()

void WvDBusMsg::send ( WvDBusConn conn)
inherited

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().

Member Data Documentation

◆ msg

DBusMessage* WvDBusMsg::msg
mutableprotectedinherited

Definition at line 286 of file wvdbusmsg.h.

◆ itlist

WvList<DBusMessageIter> WvDBusMsg::itlist
protectedinherited

Definition at line 287 of file wvdbusmsg.h.


The documentation for this class was generated from the following file: