18 #ifndef DBUSCXX_MESSAGE_H
19 #define DBUSCXX_MESSAGE_H
21 #define DBUSCXX_MESSAGE_NO_REPLY_EXPECTED 0x01
22 #define DBUSCXX_MESSAGE_NO_AUTO_START_FLAG 0x02
58 operator bool()
const;
85 std::string
sender()
const;
134 uint8_t
flags()
const;
149 static std::shared_ptr<Message>
create_from_data( uint8_t* data, uint32_t data_len, std::vector<int> fds = std::vector<int>() );
163 std::vector<uint8_t>*
body();
164 const std::vector<uint8_t>*
body()
const;
181 template <
typename T>
184 if( !ptr ) {
throw DBus::ErrorInvalidSharedPtr(); }
186 return ( *ptr ) >> value;
189 template <
typename T>
192 if( !ptr ) {
throw DBus::ErrorInvalidSharedPtr(); }
194 return ( *ptr ) << value;
Insertion iterator allow values to be appended to a message.
Definition: messageappenditerator.h:38
Extraction iterator allowing values to be retrieved from a message.
Definition: messageiterator.h:56
This class represents a basic DBus message and also serves as a base class for the specialized messag...
Definition: message.h:43
Variant header_field(MessageHeaderFields field) const
Returns the given header field(if it exists), otherwise returns a default constructed variant.
Definition: message.cpp:378
Signature signature() const
Definition: message.cpp:162
bool set_destination(const std::string &s)
Set the destination of this message.
Definition: message.cpp:123
virtual ~Message()
Definition: message.cpp:52
bool operator==(const Message &other)
Definition: message.cpp:59
MessageIterator operator>>(T &value) const
Definition: message.h:90
virtual MessageType type() const =0
std::string sender() const
Definition: message.cpp:140
int filedescriptor_at_location(int location) const
Definition: message.cpp:439
std::vector< uint8_t > * body()
Definition: message.cpp:416
uint8_t flags() const
The message flags, as the marshaled byte.
Definition: message.cpp:400
std::string destination() const
Definition: message.cpp:130
static std::shared_ptr< Message > create_from_data(uint8_t *data, uint32_t data_len, std::vector< int > fds=std::vector< int >())
Definition: message.cpp:261
void clear_sig_and_data()
Clears the signature and the data, so you can re-append data.
Definition: message.cpp:389
uint32_t serial() const
Definition: message.cpp:101
void set_flags(uint8_t flags)
Definition: message.cpp:404
DBUS_CXX_PROPAGATE_CONST(std::unique_ptr< priv_data >) m_priv
bool serialize_to_vector(std::vector< uint8_t > *vec, uint32_t serial) const
Serialize this message to the given vector.
Definition: message.cpp:172
bool auto_start()
Returns true if the bus is allowed to start an owner for this message's destination if it is not runn...
Definition: message.cpp:119
MessageAppendIterator operator<<(const T &value)
Definition: message.h:97
bool is_valid() const
Definition: message.cpp:87
void add_filedescriptor(int fd)
Definition: message.cpp:424
Endianess endianess() const
Definition: message.cpp:435
MessageIterator end() const
Definition: message.cpp:154
uint32_t filedescriptors_size() const
Definition: message.cpp:431
const std::vector< int > & filedescriptors() const
Definition: message.cpp:448
Message()
Definition: message.cpp:48
void append_signature(std::string toappend)
Definition: message.cpp:365
MessageAppendIterator append()
Definition: message.cpp:158
MessageIterator begin() const
Definition: message.cpp:150
void set_auto_start(bool auto_start)
Definition: message.cpp:111
void invalidate()
Definition: message.cpp:93
Variant set_header_field(MessageHeaderFields field, Variant value)
Set the given header field.
Definition: message.cpp:408
Represents a DBus signature.
Definition: signature.h:74
A Variant is a type-safe union for DBus operations.
Definition: variant.h:42
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18
MessageHeaderFields
Definition: enums.h:140
std::shared_ptr< DBus::Connection > operator<<(std::shared_ptr< DBus::Connection > ptr, std::shared_ptr< DBus::Message > msg)
Definition: connection.h:431
MessageType
Definition: enums.h:81
DBus::MessageIterator operator>>(std::shared_ptr< const DBus::Message > ptr, T &value)
Definition: message.h:183
Endianess
Definition: enums.h:114