blob: 4ec148e817efa750566ffec133ca43e77df32239 [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
Paul Stewart28fbfdf2011-05-31 09:37:38 -070025 void EnsureConnection();
Darin Petkov50308cd2011-06-01 18:25:07 -070026 DBus::Connection *connection() { return connection_.get(); }
27
28 private:
Chris Masoned7732e42011-05-20 11:08:56 -070029 scoped_ptr<DBus::Glib::BusDispatcher> dispatcher_;
Paul Stewart28fbfdf2011-05-31 09:37:38 -070030 scoped_ptr<DBus::Connection> connection_;
Paul Stewart75897df2011-04-27 09:05:53 -070031};
32
33} // namespace shill
34
Chris Masoned7732e42011-05-20 11:08:56 -070035#endif // SHILL_DBUS_CONTROL_