blob: 726c2ac7ac13d2c056e2f25021238ae005f6be0c [file] [log] [blame]
Darin Petkovc90fe522011-07-15 13:59:47 -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_PROXY_FACTORY_
6#define SHILL_PROXY_FACTORY_
7
8#include <string>
9
10#include <base/basictypes.h>
Darin Petkovd1967262011-07-18 14:55:18 -070011#include <dbus-c++/dbus.h>
12
13#include "shill/refptr_types.h"
Darin Petkovc90fe522011-07-15 13:59:47 -070014
15namespace shill {
16
17class ModemManager;
18class ModemManagerProxyInterface;
Darin Petkovd1967262011-07-18 14:55:18 -070019class SupplicantInterfaceProxyInterface;
20class SupplicantProcessProxyInterface;
Darin Petkovc90fe522011-07-15 13:59:47 -070021
22// Global DBus proxy factory that can be mocked out in tests.
23class ProxyFactory {
24 public:
25 ProxyFactory();
26 virtual ~ProxyFactory();
27
28 virtual ModemManagerProxyInterface *CreateModemManagerProxy(
29 ModemManager *manager,
30 const std::string &path,
31 const std::string &service);
32
Darin Petkovd1967262011-07-18 14:55:18 -070033 virtual SupplicantProcessProxyInterface *CreateProcessProxy(
34 const char *dbus_path,
35 const char *dbus_addr);
36
37 virtual SupplicantInterfaceProxyInterface *CreateInterfaceProxy(
38 const WiFiRefPtr &wifi,
39 const DBus::Path &object_path,
40 const char *dbus_addr);
41
Darin Petkovc90fe522011-07-15 13:59:47 -070042 static ProxyFactory *factory() { return factory_; }
43 static void set_factory(ProxyFactory *factory) { factory_ = factory; }
44
45 private:
46 static ProxyFactory *factory_;
47
48 DISALLOW_COPY_AND_ASSIGN(ProxyFactory);
49};
50
51} // namespace shill
52
53#endif // SHILL_PROXY_FACTORY_