blob: 2ad0d72e0e41f951b3b3d0a9c5662d3756b3591a [file] [log] [blame]
Paul Stewart75897df2011-04-27 09:05:53 -07001// 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_MANAGER_
6#define SHILL_MANAGER_
7
Chris Masone9be4a9d2011-05-16 15:44:09 -07008#include <string>
Paul Stewart75897df2011-04-27 09:05:53 -07009#include <vector>
Chris Masone487b8bf2011-05-13 16:27:57 -070010
Chris Masone9be4a9d2011-05-16 15:44:09 -070011#include <base/memory/ref_counted.h>
Chris Masone487b8bf2011-05-13 16:27:57 -070012#include <base/memory/scoped_ptr.h>
Paul Stewart75897df2011-04-27 09:05:53 -070013
Paul Stewart75897df2011-04-27 09:05:53 -070014#include "shill/device.h"
Paul Stewart0af98bf2011-05-10 17:38:08 -070015#include "shill/device_info.h"
Chris Masone9be4a9d2011-05-16 15:44:09 -070016#include "shill/service.h"
17#include "shill/shill_event.h"
Paul Stewart75897df2011-04-27 09:05:53 -070018
19namespace shill {
20
Chris Masoned0ceb8c2011-06-02 10:05:39 -070021class ControlInterface;
22class ManagerAdaptorInterface;
23class EventDispatcher;
24
Paul Stewartd5843772011-05-11 15:40:42 -070025class Manager {
Paul Stewart75897df2011-04-27 09:05:53 -070026 public:
27 // A constructor for the Manager object
Chris Masone9be4a9d2011-05-16 15:44:09 -070028 Manager(ControlInterface *control_interface,
29 EventDispatcher *dispatcher);
Paul Stewart75897df2011-04-27 09:05:53 -070030 ~Manager();
31 void Start();
32 void Stop();
33
Chris Masonec1e50412011-06-07 13:04:53 -070034 void RegisterDevice(DeviceRefPtr to_manage);
35 void DeregisterDevice(DeviceConstRefPtr to_forget);
Chris Masone9be4a9d2011-05-16 15:44:09 -070036
Chris Masonec1e50412011-06-07 13:04:53 -070037 void RegisterService(ServiceRefPtr to_manage);
38 void DeregisterService(ServiceConstRefPtr to_forget);
Chris Masone9be4a9d2011-05-16 15:44:09 -070039
40 void FilterByTechnology(Device::Technology tech,
Chris Masonec1e50412011-06-07 13:04:53 -070041 std::vector<DeviceRefPtr> *found);
Chris Masone9be4a9d2011-05-16 15:44:09 -070042
Chris Masonee0dea762011-06-09 09:06:03 -070043 ServiceRefPtr FindService(const std::string& name);
Chris Masone9be4a9d2011-05-16 15:44:09 -070044
Paul Stewart75897df2011-04-27 09:05:53 -070045 private:
Paul Stewart0af98bf2011-05-10 17:38:08 -070046 scoped_ptr<ManagerAdaptorInterface> adaptor_;
47 DeviceInfo device_info_;
Paul Stewart75897df2011-04-27 09:05:53 -070048 bool running_;
Chris Masonec1e50412011-06-07 13:04:53 -070049 std::vector<DeviceRefPtr> devices_;
50 std::vector<ServiceRefPtr> services_;
Chris Masone413a3192011-05-09 17:10:05 -070051 friend class ManagerAdaptorInterface;
Paul Stewart75897df2011-04-27 09:05:53 -070052};
53
54} // namespace shill
55
56#endif // SHILL_MANAGER_