summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorRatan Gupta <ratagupt@in.ibm.com>2017-10-06 21:27:13 +0530
committerRatan Gupta <ratagupt@in.ibm.com>2018-02-23 20:05:18 +0530
commitcd22786a280372a2e31c61dffabae204a8ab9d8b (patch)
tree1ce61d893b4f212dca25cca792aa5a5e2035fba1 /src/main.cpp
parentef69ac02f480902f61869ea4d2c08f6aa786786b (diff)
downloadphosphor-dbus-monitor-cd22786a280372a2e31c61dffabae204a8ab9d8b.tar.gz
phosphor-dbus-monitor-cd22786a280372a2e31c61dffabae204a8ab9d8b.zip
Implement event manager class
On handling of property change event, If callback is of type event then event manager would be asked to create the event dbus objects. Change-Id: I7f1d365d7f44a1cca54516e9ef555bb132d6b063 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 08cd849..5e191e1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -13,8 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include "sdbusplus.hpp"
+
+#include "config.h"
#include "generated.hpp"
+#include "sdbusplus.hpp"
+
+#include <sdbusplus/bus.hpp>
+#include <sdbusplus/server/manager.hpp>
using namespace phosphor::dbus::monitoring;
@@ -32,6 +37,12 @@ struct Loop
int main(void)
{
+ auto& bus = SDBusPlus::getBus();
+
+ // Add sdbusplus Object Manager for the 'root' path of events.
+ sdbusplus::server::manager::manager objManager(bus, OBJ_EVENT);
+ bus.request_name(BUSNAME_EVENT);
+
for (auto& watch : ConfigPropertyWatches::get())
{
watch->start();
OpenPOWER on IntegriCloud