Paul Stewart | 75897df | 2011-04-27 09:05:53 -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_CONTROL_INTERFACE_ |
| 6 | #define SHILL_CONTROL_INTERFACE_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | namespace shill { |
| 11 | |
| 12 | class Manager; |
| 13 | class Service; |
| 14 | class Device; |
| 15 | |
| 16 | using std::string; |
| 17 | |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 18 | // This is the Interface for "partner" objects which are in charge of |
| 19 | // handling incoming RPCs to the various core classes. |
| 20 | class AdaptorInterface { |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 21 | public: |
| 22 | virtual void SetProperty(const string &key, const string &value) = 0; |
| 23 | virtual const string *GetProperty(const string &key) = 0; |
| 24 | virtual void ClearProperty(const string &key) = 0; |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 25 | virtual ~AdaptorInterface() {} |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 26 | }; |
| 27 | |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 28 | // These are the functions that a Manager adaptor must support |
| 29 | class ManagerAdaptorInterface { |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 30 | public: |
| 31 | virtual void UpdateRunning() = 0; |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 32 | virtual ~ManagerAdaptorInterface() {} |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 33 | }; |
| 34 | |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 35 | // These are the functions that a Service adaptor must support |
| 36 | class ServiceAdaptorInterface { |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 37 | public: |
| 38 | virtual void UpdateConnected() = 0; |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 39 | virtual ~ServiceAdaptorInterface() {} |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 40 | }; |
| 41 | |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 42 | // These are the functions that a Device adaptor must support |
| 43 | class DeviceAdaptorInterface { |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 44 | public: |
| 45 | virtual void UpdateEnabled() = 0; |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 46 | virtual ~DeviceAdaptorInterface() {} |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 47 | }; |
| 48 | |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 49 | // This is the Interface for an object factory that creates adaptor objects |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 50 | class ControlInterface { |
| 51 | public: |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 52 | virtual ManagerAdaptorInterface *CreateManagerAdaptor(Manager *manager) = 0; |
| 53 | virtual ServiceAdaptorInterface *CreateServiceAdaptor(Service *service) = 0; |
| 54 | virtual DeviceAdaptorInterface *CreateDeviceAdaptor(Device *device) = 0; |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 55 | virtual ~ControlInterface() {} |
| 56 | }; |
| 57 | |
| 58 | } // namespace shill |
| 59 | #endif // SHILL_CONTROL_INTERFACE_ |