DBus::CallMessage Class Reference

Represents a DBus call message. More...

#include <callmessage.h>

Inheritance diagram for DBus::CallMessage:

Public Member Functions

std::shared_ptr< ReturnMessagecreate_reply () const
 Create a reply to this call message. More...
 
std::shared_ptr< ErrorMessagecreate_error_reply () const
 Create an error reply to this message. More...
 
void set_path (const std::string &p)
 
Path path () const
 
void set_interface (const std::string &i)
 
std::string interface_name () const
 
void set_member (const std::string &m)
 
std::string member () const
 
void set_no_reply (bool no_reply=true)
 
bool expects_reply () const
 
virtual MessageType type () const
 
- Public Member Functions inherited from DBus::Message
virtual ~Message ()
 
bool operator== (const Message &other)
 
bool is_valid () const
 
void invalidate ()
 
 operator bool () const
 
uint32_t serial () const
 
void set_auto_start (bool auto_start)
 
bool auto_start ()
 Returns true if the bus is allowed to start an owner for this message's destination if it is not running. More...
 
bool set_destination (const std::string &s)
 Set the destination of this message. More...
 
std::string destination () const
 
std::string sender () const
 
Signature signature () const
 
template<typename T >
MessageIterator operator>> (T &value) const
 
template<typename T >
MessageAppendIterator operator<< (const T &value)
 
MessageIterator begin () const
 
MessageIterator end () const
 
MessageAppendIterator append ()
 
bool serialize_to_vector (std::vector< uint8_t > *vec, uint32_t serial) const
 Serialize this message to the given vector. More...
 
Variant header_field (MessageHeaderFields field) const
 Returns the given header field(if it exists), otherwise returns a default constructed variant. More...
 
uint8_t flags () const
 The message flags, as the marshaled byte. More...
 
Variant set_header_field (MessageHeaderFields field, Variant value)
 Set the given header field. More...
 
Endianess endianess () const
 
const std::vector< int > & filedescriptors () const
 

Static Public Member Functions

static std::shared_ptr< CallMessagecreate ()
 
static std::shared_ptr< CallMessagecreate (const std::string &dest, const std::string &path, const std::string &iface, const std::string &method)
 
static std::shared_ptr< CallMessagecreate (const std::string &path, const std::string &iface, const std::string &method)
 
static std::shared_ptr< CallMessagecreate (const std::string &path, const std::string &method)
 
- Static Public Member Functions inherited from DBus::Message
static std::shared_ptr< Messagecreate_from_data (uint8_t *data, uint32_t data_len, std::vector< int > fds=std::vector< int >())
 

Protected Member Functions

 CallMessage ()
 
 CallMessage (const std::string &dest, const std::string &path, const std::string &iface, const std::string &method)
 
 CallMessage (const std::string &path, const std::string &iface, const std::string &method)
 
 CallMessage (const std::string &path, const std::string &method)
 
- Protected Member Functions inherited from DBus::Message
 Message ()
 
void append_signature (std::string toappend)
 
void clear_sig_and_data ()
 Clears the signature and the data, so you can re-append data. More...
 
void set_flags (uint8_t flags)
 

Detailed Description

Represents a DBus call message.

When this message is received, a matching exported method is called if found. Depending on the result, either the response or an error must be sent back to the sender. The reply should be created with either create_reply() or create_error_reply() depending on the type of error that should be returned.

Author
Rick L Vinyard Jr rviny.nosp@m.ard@.nosp@m.cs.nm.nosp@m.su.e.nosp@m.du

Constructor & Destructor Documentation

◆ CallMessage() [1/4]

DBus::CallMessage::CallMessage ( )
protected

Referenced by create().

◆ CallMessage() [2/4]

DBus::CallMessage::CallMessage ( const std::string &  dest,
const std::string &  path,
const std::string &  iface,
const std::string &  method 
)
protected

◆ CallMessage() [3/4]

DBus::CallMessage::CallMessage ( const std::string &  path,
const std::string &  iface,
const std::string &  method 
)
protected

◆ CallMessage() [4/4]

DBus::CallMessage::CallMessage ( const std::string &  path,
const std::string &  method 
)
protected

References path(), set_member(), and set_path().

Member Function Documentation

◆ create() [1/4]

◆ create() [2/4]

std::shared_ptr< CallMessage > DBus::CallMessage::create ( const std::string &  dest,
const std::string &  path,
const std::string &  iface,
const std::string &  method 
)
static

References CallMessage(), and path().

◆ create() [3/4]

std::shared_ptr< CallMessage > DBus::CallMessage::create ( const std::string &  path,
const std::string &  iface,
const std::string &  method 
)
static

References CallMessage(), and path().

◆ create() [4/4]

std::shared_ptr< CallMessage > DBus::CallMessage::create ( const std::string &  path,
const std::string &  method 
)
static

References CallMessage(), and path().

◆ create_error_reply()

std::shared_ptr< ErrorMessage > DBus::CallMessage::create_error_reply ( ) const

Create an error reply to this message.

If no reply is expected, this will return a valid pointer, but an invalid ErrorMessage so that the reply can be built but will be dropped before it gets sent out.

Returns

References DBus::ErrorMessage::create(), DBUSCXX_MESSAGE_NO_REPLY_EXPECTED, DBus::Message::flags(), DBus::Message::is_valid(), DBus::Message::sender(), and DBus::Message::serial().

◆ create_reply()

std::shared_ptr< ReturnMessage > DBus::CallMessage::create_reply ( ) const

Create a reply to this call message.

If no reply is expected, this will return a valid pointer, but an invalid ReturnMessage so that the reply can be built but will be dropped before it gets sent out.

Returns

References DBus::ReturnMessage::create(), DBUSCXX_MESSAGE_NO_REPLY_EXPECTED, DBus::Message::flags(), DBus::Message::is_valid(), DBus::Message::sender(), and DBus::Message::serial().

◆ expects_reply()

bool DBus::CallMessage::expects_reply ( ) const

◆ interface_name()

std::string DBus::CallMessage::interface_name ( ) const

◆ member()

std::string DBus::CallMessage::member ( ) const

◆ path()

◆ set_interface()

void DBus::CallMessage::set_interface ( const std::string &  i)

◆ set_member()

void DBus::CallMessage::set_member ( const std::string &  m)

◆ set_no_reply()

void DBus::CallMessage::set_no_reply ( bool  no_reply = true)

◆ set_path()

void DBus::CallMessage::set_path ( const std::string &  p)

◆ type()

MessageType DBus::CallMessage::type ( ) const
virtual

Implements DBus::Message.

References DBus::CALL.


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