Add path conditions

Add support to setProperty and destroyObject to conditionally
perform their action based on the result of a condition testing
functor.

Change-Id: I67ded31f4a7ee0f7a29bb6edc06ebf9249cdc070
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/functor.cpp b/functor.cpp
index a657257..253f0e9 100644
--- a/functor.cpp
+++ b/functor.cpp
@@ -24,10 +24,18 @@
 {
 namespace functor
 {
-
 bool PropertyConditionBase::operator()(
     sdbusplus::bus::bus& bus,
     sdbusplus::message::message&,
+    Manager& mgr) const
+{
+    std::string path(_path);
+    return (*this)(path, bus, mgr);
+}
+
+bool PropertyConditionBase::operator()(
+    const std::string& path,
+    sdbusplus::bus::bus& bus,
     Manager&) const
 {
     std::string host;
@@ -43,7 +51,7 @@
                               "/xyz/openbmc_project/ObjectMapper",
                               "xyz.openbmc_project.ObjectMapper",
                               "GetObject");
-        mapperCall.append(_path);
+        mapperCall.append(path);
         mapperCall.append(std::vector<std::string>({_iface}));
 
         auto mapperResponseMsg = bus.call(mapperCall);
@@ -70,7 +78,7 @@
     }
     auto hostCall = bus.new_method_call(
                         host.c_str(),
-                        _path.c_str(),
+                        path.c_str(),
                         "org.freedesktop.DBus.Properties",
                         "Get");
     hostCall.append(_iface);