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_DEVICE_ |
| 6 | #define SHILL_DEVICE_ |
| 7 | |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame^] | 8 | #include <vector> |
| 9 | |
Chris Masone | 487b8bf | 2011-05-13 16:27:57 -0700 | [diff] [blame] | 10 | #include <base/memory/ref_counted.h> |
Paul Stewart | d584377 | 2011-05-11 15:40:42 -0700 | [diff] [blame] | 11 | |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame^] | 12 | #include "shill/service.h" |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 13 | #include "shill/shill_event.h" |
| 14 | |
| 15 | namespace shill { |
| 16 | |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame^] | 17 | class ControlInterface; |
| 18 | class DeviceAdaptorInterface; |
| 19 | class EventDispatcher; |
| 20 | |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 21 | // Device superclass. Individual network interfaces types will inherit from |
| 22 | // this class. |
Paul Stewart | d584377 | 2011-05-11 15:40:42 -0700 | [diff] [blame] | 23 | class Device : public base::RefCounted<Device> { |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 24 | public: |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame^] | 25 | enum Technology { |
| 26 | kEthernet, |
| 27 | kWifi, |
| 28 | kCellular, |
| 29 | kNumTechnologies |
| 30 | }; |
Chris Masone | 0e1d104 | 2011-05-09 18:07:03 -0700 | [diff] [blame] | 31 | |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame^] | 32 | // A constructor for the Device object |
| 33 | Device(ControlInterface *control_interface, |
| 34 | EventDispatcher *dispatcher); |
| 35 | virtual ~Device(); |
| 36 | |
| 37 | virtual void Start(); |
| 38 | virtual void Stop(); |
| 39 | |
| 40 | virtual bool TechnologyIs(Technology type) = 0; |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 41 | |
Paul Stewart | d584377 | 2011-05-11 15:40:42 -0700 | [diff] [blame] | 42 | protected: |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame^] | 43 | std::vector<scoped_refptr<Service> > services_; |
Paul Stewart | d584377 | 2011-05-11 15:40:42 -0700 | [diff] [blame] | 44 | |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 45 | private: |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 46 | DeviceAdaptorInterface *adaptor_; |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 47 | bool running_; |
Chris Masone | 413a319 | 2011-05-09 17:10:05 -0700 | [diff] [blame] | 48 | friend class DeviceAdaptorInterface; |
Chris Masone | 9be4a9d | 2011-05-16 15:44:09 -0700 | [diff] [blame^] | 49 | DISALLOW_COPY_AND_ASSIGN(Device); |
Paul Stewart | 75897df | 2011-04-27 09:05:53 -0700 | [diff] [blame] | 50 | }; |
| 51 | |
| 52 | } // namespace shill |
| 53 | |
| 54 | #endif // SHILL_DEVICE_ |