match: move to bus namespace
match directly works on the bus and may be used by servers
as well as clients, so sdbusplus::bus seems better suited.
Change-Id: If34ad209e83de58365bb64812d19d0bb92a2a1f0
Signed-off-by: Christian Andersen <c.andersen@kostal.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/Makefile.am b/Makefile.am
index 4bed320..9b72b3a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,6 +4,7 @@
mapbox/recursive_wrapper.hpp \
mapbox/variant.hpp \
sdbusplus/bus.hpp \
+ sdbusplus/bus/match.hpp \
sdbusplus/exception.hpp \
sdbusplus/message.hpp \
sdbusplus/message/append.hpp \
@@ -14,7 +15,6 @@
sdbusplus/server/bindings.hpp \
sdbusplus/server/interface.hpp \
sdbusplus/server/manager.hpp \
- sdbusplus/server/match.hpp \
sdbusplus/server/object.hpp \
sdbusplus/server/transaction.hpp \
sdbusplus/slot.hpp \
diff --git a/sdbusplus/bus.hpp.in b/sdbusplus/bus.hpp.in
index 7d25294..dc809ad 100644
--- a/sdbusplus/bus.hpp.in
+++ b/sdbusplus/bus.hpp.in
@@ -16,7 +16,7 @@
namespace server { namespace interface { struct interface; } }
namespace server { namespace manager { struct manager; } }
namespace server { namespace object { template<class...> struct object; } }
-namespace server { namespace match { struct match; } }
+namespace bus { namespace match { struct match; } }
namespace bus
{
@@ -308,7 +308,7 @@
friend struct server::interface::interface;
friend struct server::manager::manager;
template<class... Args> friend struct server::object::object;
- friend struct server::match::match;
+ friend struct match::match;
private:
busp_t get() { return _bus.get(); }
diff --git a/sdbusplus/server/match.hpp b/sdbusplus/bus/match.hpp
similarity index 74%
rename from sdbusplus/server/match.hpp
rename to sdbusplus/bus/match.hpp
index 05907bd..1daca60 100644
--- a/sdbusplus/server/match.hpp
+++ b/sdbusplus/bus/match.hpp
@@ -6,7 +6,7 @@
namespace sdbusplus
{
-namespace server
+namespace bus
{
namespace match
@@ -14,14 +14,14 @@
struct match
{
- /* Define all of the basic class operations:
- * Not allowed:
- * - Default constructor to avoid nullptrs.
- * - Copy operations due to internal unique_ptr.
- * Allowed:
- * - Move operations.
- * - Destructor.
- */
+ /* Define all of the basic class operations:
+ * Not allowed:
+ * - Default constructor to avoid nullptrs.
+ * - Copy operations due to internal unique_ptr.
+ * Allowed:
+ * - Move operations.
+ * - Destructor.
+ */
match() = delete;
match(const match&) = delete;
match& operator=(const match&) = delete;
@@ -54,5 +54,5 @@
using match_t = match::match;
-} // namespace server
+} // namespace bus
} // namespace sdbusplus
diff --git a/sdbusplus/server.hpp.in b/sdbusplus/server.hpp.in
index b177d5e..b6a340c 100644
--- a/sdbusplus/server.hpp.in
+++ b/sdbusplus/server.hpp.in
@@ -1,12 +1,21 @@
#pragma once
#include <sdbusplus/bus.hpp>
+#include <sdbusplus/bus/match.hpp>
+// Alias for deprecated sdbusplus::server::match namespace.
+namespace sdbusplus
+{
+namespace server
+{
+namespace match = bus::match;
+using match_t = bus::match_t;
+} // server
+} // sdbusplus
#include <sdbusplus/vtable.hpp>
#include <sdbusplus/server/interface.hpp>
#include <sdbusplus/server/manager.hpp>
#include <sdbusplus/server/object.hpp>
-#include <sdbusplus/server/match.hpp>
#include <sdbusplus/server/bindings.hpp>
#if @WANT_TRANSACTION@
#include <sdbusplus/server/transaction.hpp>