blob: b3e3b8cc20a46ed0235d81f5fab96c9ff1d21d08 [file] [log] [blame]
Thieu Le3426c8f2012-01-11 17:35:11 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Paul Stewartf1ce5d22011-05-19 13:10:20 -07002// 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"
Paul Stewart26b327e2011-10-19 11:38:09 -070014#include "shill/event_dispatcher.h"
Paul Stewartf1ce5d22011-05-19 13:10:20 -070015#include "shill/service.h"
Paul Stewartf1ce5d22011-05-19 13:10:20 -070016
17namespace shill {
18
19class ControlInterface;
20class DeviceAdaptorInterface;
21class EventDispatcher;
22class Endpoint;
23class DeviceInfo;
24class Manager;
Thieu Le3426c8f2012-01-11 17:35:11 -080025class Metrics;
Paul Stewartf1ce5d22011-05-19 13:10:20 -070026
27// Non-functional Device subclass used for non-operable or blacklisted devices
28class DeviceStub : public Device {
29 public:
30 DeviceStub(ControlInterface *control_interface,
31 EventDispatcher *dispatcher,
Thieu Le3426c8f2012-01-11 17:35:11 -080032 Metrics *metrics,
Paul Stewartf1ce5d22011-05-19 13:10:20 -070033 Manager *manager,
Chris Masone626719f2011-08-18 16:58:48 -070034 const std::string &link_name,
35 const std::string &address,
Paul Stewartf1ce5d22011-05-19 13:10:20 -070036 int interface_index,
Paul Stewartfdd16072011-09-16 12:41:35 -070037 Technology::Identifier technology)
Thieu Le3426c8f2012-01-11 17:35:11 -080038 : Device(control_interface, dispatcher, metrics, manager, link_name,
39 address, interface_index, technology) {}
Eric Shienbrood9a245532012-03-07 14:20:39 -050040 void Start(Error */*error*/,
41 const EnabledStateChangedCallback &/*callback*/) {}
42 void Stop(Error */*error*/,
43 const EnabledStateChangedCallback &/*callback*/) {}
Paul Stewartfdd16072011-09-16 12:41:35 -070044 bool TechnologyIs(const Technology::Identifier type) const {
Gaurav Shah435de2c2011-11-17 19:01:07 -080045 return type == technology();
Paul Stewartfdd16072011-09-16 12:41:35 -070046 }
Paul Stewartf1ce5d22011-05-19 13:10:20 -070047
48 private:
Paul Stewartf1ce5d22011-05-19 13:10:20 -070049 DISALLOW_COPY_AND_ASSIGN(DeviceStub);
50};
51
52} // namespace shill
53
54#endif // SHILL_STUB_DEVICE_