1 #ifndef DBUS_MATCH_HPP 2 #define DBUS_MATCH_HPP 3 4 #include <string> 5 #include <boost/asio.hpp> 6 7 namespace dbus { 8 9 class connection; 10 11 void delete_match(connection&, std::string); 12 13 /// Simple placeholder object for a match rule. 14 /** 15 * A match rule determines what messages will be received by this application. 16 * 17 * Each rule will be represented by an instance of match. To remove that rule, 18 * dispose of the object. 19 */ 20 //TODO use noncopyable 21 class match 22 { 23 connection& connection_; 24 std::string expression_; 25 26 match(connection& c, 27 BOOST_ASIO_MOVE_ARG(std::string) e) 28 : connection_(c), 29 expression_(BOOST_ASIO_MOVE_CAST(std::string)(e)) 30 {} 31 32 public: 33 friend class connection; 34 35 const std::string& get_expression() const { return expression_; } 36 connection& get_connection() { return connection_; } 37 ~match(); 38 }; 39 40 } // namespace dbus 41 42 #endif // DBUS_MATCH_HPP 43