blob: 0e9c9ad2cc6e445a23554317c9d85125504c4540 [file] [log] [blame]
Paul Stewart75897df2011-04-27 09:05:53 -07001// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef SHILL_DBUS_CONTROL_
6#define SHILL_DBUS_CONTROL_
7
Chris Masoned7732e42011-05-20 11:08:56 -07008#include <base/scoped_ptr.h>
9#include <dbus-c++/glib-integration.h>
10#include <dbus-c++/util.h>
11
Paul Stewart75897df2011-04-27 09:05:53 -070012#include "shill/control_interface.h"
13
14namespace shill {
15// This is the Interface for the control channel for Shill.
16class DBusControl : public ControlInterface {
17 public:
Chris Masoned7732e42011-05-20 11:08:56 -070018 DBusControl();
19 virtual ~DBusControl();
20
Chris Masone413a3192011-05-09 17:10:05 -070021 ManagerAdaptorInterface *CreateManagerAdaptor(Manager *manager);
22 ServiceAdaptorInterface *CreateServiceAdaptor(Service *service);
23 DeviceAdaptorInterface *CreateDeviceAdaptor(Device *device);
Chris Masoned7732e42011-05-20 11:08:56 -070024
25 private:
Paul Stewart28fbfdf2011-05-31 09:37:38 -070026 void EnsureConnection();
Chris Masoned7732e42011-05-20 11:08:56 -070027 scoped_ptr<DBus::Glib::BusDispatcher> dispatcher_;
Paul Stewart28fbfdf2011-05-31 09:37:38 -070028 scoped_ptr<DBus::Connection> connection_;
Paul Stewart75897df2011-04-27 09:05:53 -070029};
30
31} // namespace shill
32
Chris Masoned7732e42011-05-20 11:08:56 -070033#endif // SHILL_DBUS_CONTROL_