Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 1 | // 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 Petkov | d196726 | 2011-07-18 14:55:18 -0700 | [diff] [blame^] | 11 | #include <dbus-c++/dbus.h> |
| 12 | |
| 13 | #include "shill/refptr_types.h" |
Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 14 | |
| 15 | namespace shill { |
| 16 | |
| 17 | class ModemManager; |
| 18 | class ModemManagerProxyInterface; |
Darin Petkov | d196726 | 2011-07-18 14:55:18 -0700 | [diff] [blame^] | 19 | class SupplicantInterfaceProxyInterface; |
| 20 | class SupplicantProcessProxyInterface; |
Darin Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 21 | |
| 22 | // Global DBus proxy factory that can be mocked out in tests. |
| 23 | class 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 Petkov | d196726 | 2011-07-18 14:55:18 -0700 | [diff] [blame^] | 33 | 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 Petkov | c90fe52 | 2011-07-15 13:59:47 -0700 | [diff] [blame] | 42 | 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_ |