callmessage.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-or-later OR BSD-3-Clause
2 /***************************************************************************
3  * Copyright (C) 2009,2010 by Rick L. Vinyard, Jr. *
4  * rvinyard@cs.nmsu.edu *
5  * *
6  * This file is part of the dbus-cxx library. *
7  ***************************************************************************/
8 #include <dbus-cxx/message.h>
9 #include <dbus-cxx/path.h>
10 #include <memory>
11 #include <string>
12 #include <vector>
13 
14 #ifndef DBUSCXX_CALLMESSAGE_H
15 #define DBUSCXX_CALLMESSAGE_H
16 
17 namespace DBus {
18 
19 class ReplyMessage;
20 class ErrorMessage;
21 
34 class CallMessage : public Message {
35 protected:
36 
37  CallMessage();
38 
39  CallMessage( const std::string& dest, const std::string& path, const std::string& iface, const std::string& method );
40 
41  CallMessage( const std::string& path, const std::string& iface, const std::string& method );
42 
43  CallMessage( const std::string& path, const std::string& method );
44 
45 public:
46 
47  static std::shared_ptr<CallMessage> create();
48 
49  static std::shared_ptr<CallMessage> create( const std::string& dest, const std::string& path, const std::string& iface, const std::string& method );
50 
51  static std::shared_ptr<CallMessage> create( const std::string& path, const std::string& iface, const std::string& method );
52 
53  static std::shared_ptr<CallMessage> create( const std::string& path, const std::string& method );
54 
64  std::shared_ptr<ReturnMessage> create_reply() const;
65 
75  std::shared_ptr<ErrorMessage> create_error_reply() const;
76 
77  void set_path( const std::string& p );
78 
79  Path path() const;
80 
81  void set_interface( const std::string& i );
82 
83  std::string interface_name() const;
84 
85  void set_member( const std::string& m );
86 
87  std::string member() const;
88 
89  void set_no_reply( bool no_reply = true );
90 
91  bool expects_reply() const;
92 
93  virtual MessageType type() const;
94 
95 };
96 
97 }
98 
99 #endif
Represents a DBus call message.
Definition: callmessage.h:34
std::shared_ptr< ErrorMessage > create_error_reply() const
Create an error reply to this message.
Definition: callmessage.cpp:77
std::string member() const
Definition: callmessage.cpp:123
static std::shared_ptr< CallMessage > create()
Definition: callmessage.cpp:47
void set_interface(const std::string &i)
Definition: callmessage.cpp:105
CallMessage()
Definition: callmessage.cpp:20
std::string interface_name() const
Definition: callmessage.cpp:109
void set_member(const std::string &m)
Definition: callmessage.cpp:119
void set_path(const std::string &p)
Definition: callmessage.cpp:91
bool expects_reply() const
Definition: callmessage.cpp:145
Path path() const
Definition: callmessage.cpp:95
std::shared_ptr< ReturnMessage > create_reply() const
Create a reply to this call message.
Definition: callmessage.cpp:63
virtual MessageType type() const
Definition: callmessage.cpp:149
void set_no_reply(bool no_reply=true)
Definition: callmessage.cpp:133
This class represents a basic DBus message and also serves as a base class for the specialized messag...
Definition: message.h:43
Represents a DBus Path.
Definition: path.h:21
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18
MessageType
Definition: enums.h:81