Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -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_STUB_DEVICE_ |
| 6 | #define SHILL_STUB_DEVICE_ |
| 7 | |
| 8 | #include <base/memory/ref_counted.h> |
| 9 | #include <base/memory/scoped_ptr.h> |
| 10 | |
| 11 | #include <vector> |
| 12 | |
| 13 | #include "shill/device.h" |
| 14 | #include "shill/service.h" |
| 15 | #include "shill/shill_event.h" |
| 16 | |
| 17 | namespace shill { |
| 18 | |
| 19 | class ControlInterface; |
| 20 | class DeviceAdaptorInterface; |
| 21 | class EventDispatcher; |
| 22 | class Endpoint; |
| 23 | class DeviceInfo; |
| 24 | class Manager; |
| 25 | |
| 26 | // Non-functional Device subclass used for non-operable or blacklisted devices |
| 27 | class DeviceStub : public Device { |
| 28 | public: |
| 29 | DeviceStub(ControlInterface *control_interface, |
| 30 | EventDispatcher *dispatcher, |
| 31 | Manager *manager, |
Chris Masone | 626719f | 2011-08-18 16:58:48 -0700 | [diff] [blame] | 32 | const std::string &link_name, |
| 33 | const std::string &address, |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 34 | int interface_index, |
Paul Stewart | fdd1607 | 2011-09-16 12:41:35 -0700 | [diff] [blame] | 35 | Technology::Identifier technology) |
Chris Masone | 626719f | 2011-08-18 16:58:48 -0700 | [diff] [blame] | 36 | : Device(control_interface, dispatcher, manager, link_name, address, |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 37 | interface_index), |
| 38 | technology_(technology) {} |
| 39 | void Start() {} |
| 40 | void Stop() {} |
Paul Stewart | fdd1607 | 2011-09-16 12:41:35 -0700 | [diff] [blame] | 41 | bool TechnologyIs(const Technology::Identifier type) const { |
| 42 | return type == technology_; |
| 43 | } |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 44 | |
| 45 | private: |
Paul Stewart | fdd1607 | 2011-09-16 12:41:35 -0700 | [diff] [blame] | 46 | Technology::Identifier technology_; |
Darin Petkov | 6f9eaa3 | 2011-08-09 15:26:44 -0700 | [diff] [blame] | 47 | |
Paul Stewart | f1ce5d2 | 2011-05-19 13:10:20 -0700 | [diff] [blame] | 48 | DISALLOW_COPY_AND_ASSIGN(DeviceStub); |
| 49 | }; |
| 50 | |
| 51 | } // namespace shill |
| 52 | |
| 53 | #endif // SHILL_STUB_DEVICE_ |