blob: 58d440762dd78ecf76f61799799756efc1285700 [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 Masone8fe2c7e2011-06-09 15:51:19 -070016#include "shill/property_store_interface.h"
Chris Masone9be4a9d2011-05-16 15:44:09 -070017#include "shill/service.h"
18#include "shill/shill_event.h"
Paul Stewart75897df2011-04-27 09:05:53 -070019
20namespace shill {
21
Chris Masoned0ceb8c2011-06-02 10:05:39 -070022class ControlInterface;
Chris Masone8fe2c7e2011-06-09 15:51:19 -070023class Error;
Chris Masoned0ceb8c2011-06-02 10:05:39 -070024class EventDispatcher;
Chris Masone8fe2c7e2011-06-09 15:51:19 -070025class ManagerAdaptorInterface;
Chris Masoned0ceb8c2011-06-02 10:05:39 -070026
Chris Masone8fe2c7e2011-06-09 15:51:19 -070027class Manager : public PropertyStoreInterface {
Paul Stewart75897df2011-04-27 09:05:53 -070028 public:
29 // A constructor for the Manager object
Chris Masone9be4a9d2011-05-16 15:44:09 -070030 Manager(ControlInterface *control_interface,
31 EventDispatcher *dispatcher);
Paul Stewart75897df2011-04-27 09:05:53 -070032 ~Manager();
33 void Start();
34 void Stop();
35
Chris Masonec1e50412011-06-07 13:04:53 -070036 void RegisterDevice(DeviceRefPtr to_manage);
37 void DeregisterDevice(DeviceConstRefPtr to_forget);
Chris Masone9be4a9d2011-05-16 15:44:09 -070038
Chris Masonec1e50412011-06-07 13:04:53 -070039 void RegisterService(ServiceRefPtr to_manage);
40 void DeregisterService(ServiceConstRefPtr to_forget);
Chris Masone9be4a9d2011-05-16 15:44:09 -070041
42 void FilterByTechnology(Device::Technology tech,
Chris Masonec1e50412011-06-07 13:04:53 -070043 std::vector<DeviceRefPtr> *found);
Chris Masone9be4a9d2011-05-16 15:44:09 -070044
Chris Masonee0dea762011-06-09 09:06:03 -070045 ServiceRefPtr FindService(const std::string& name);
Chris Masone9be4a9d2011-05-16 15:44:09 -070046
Chris Masone8fe2c7e2011-06-09 15:51:19 -070047 // Implementation of PropertyStoreInterface
48 bool SetBoolProperty(const std::string& name, bool value, Error *error);
49
50 bool SetStringProperty(const std::string& name,
51 const std::string& value,
52 Error *error);
53
Paul Stewart75897df2011-04-27 09:05:53 -070054 private:
Paul Stewart0af98bf2011-05-10 17:38:08 -070055 scoped_ptr<ManagerAdaptorInterface> adaptor_;
56 DeviceInfo device_info_;
Paul Stewart75897df2011-04-27 09:05:53 -070057 bool running_;
Chris Masonec1e50412011-06-07 13:04:53 -070058 std::vector<DeviceRefPtr> devices_;
59 std::vector<ServiceRefPtr> services_;
Chris Masone413a3192011-05-09 17:10:05 -070060 friend class ManagerAdaptorInterface;
Paul Stewart75897df2011-04-27 09:05:53 -070061};
62
63} // namespace shill
64
65#endif // SHILL_MANAGER_