blob: 60095fec34092234297fa3bfd491eaf5080d410a [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
Paul Stewartd5843772011-05-11 15:40:42 -070021class Manager {
Paul Stewart75897df2011-04-27 09:05:53 -070022 public:
23 // A constructor for the Manager object
Chris Masone9be4a9d2011-05-16 15:44:09 -070024 Manager(ControlInterface *control_interface,
25 EventDispatcher *dispatcher);
Paul Stewart75897df2011-04-27 09:05:53 -070026 ~Manager();
27 void Start();
28 void Stop();
29
Chris Masone9be4a9d2011-05-16 15:44:09 -070030 void RegisterDevice(Device *to_manage);
31 void DeregisterDevice(const Device *to_forget);
32
33 void RegisterService(Service *to_manage);
34 void DeregisterService(const Service *to_forget);
35
36 void FilterByTechnology(Device::Technology tech,
37 std::vector<scoped_refptr<Device> > *found);
38
39 Service* FindService(const std::string& name);
40
Paul Stewart75897df2011-04-27 09:05:53 -070041 private:
Paul Stewart0af98bf2011-05-10 17:38:08 -070042 scoped_ptr<ManagerAdaptorInterface> adaptor_;
43 DeviceInfo device_info_;
Paul Stewart75897df2011-04-27 09:05:53 -070044 bool running_;
Chris Masone9be4a9d2011-05-16 15:44:09 -070045 std::vector<scoped_refptr<Device> > devices_;
46 std::vector<scoped_refptr<Service> > services_;
Chris Masone413a3192011-05-09 17:10:05 -070047 friend class ManagerAdaptorInterface;
Paul Stewart75897df2011-04-27 09:05:53 -070048};
49
50} // namespace shill
51
52#endif // SHILL_MANAGER_