blob: fdd76e06f7b4e04ae4fbc41c4d1bbcd315584717 [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 Masone9be4a9d2011-05-16 15:44:09 -070034 void RegisterDevice(Device *to_manage);
35 void DeregisterDevice(const Device *to_forget);
36
37 void RegisterService(Service *to_manage);
38 void DeregisterService(const Service *to_forget);
39
40 void FilterByTechnology(Device::Technology tech,
41 std::vector<scoped_refptr<Device> > *found);
42
43 Service* FindService(const std::string& name);
44
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 Masone9be4a9d2011-05-16 15:44:09 -070049 std::vector<scoped_refptr<Device> > devices_;
50 std::vector<scoped_refptr<Service> > 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_