[shill] the beginnings of the data model
Flesh out Manager a little, to add vectors of Device* and Service* and ways to look through them.
BUG=chromium-os:15347
TEST=unit tests
Change-Id: Iae5280f56bf58cf1580f0b87c465f4905459f07a
Reviewed-on: http://gerrit.chromium.org/gerrit/966
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/manager.h b/manager.h
index 8e87099..60095fe 100644
--- a/manager.h
+++ b/manager.h
@@ -5,32 +5,45 @@
#ifndef SHILL_MANAGER_
#define SHILL_MANAGER_
+#include <string>
#include <vector>
+#include <base/memory/ref_counted.h>
#include <base/memory/scoped_ptr.h>
-#include "shill/shill_event.h"
-#include "shill/service.h"
#include "shill/device.h"
#include "shill/device_info.h"
+#include "shill/service.h"
+#include "shill/shill_event.h"
namespace shill {
class Manager {
public:
// A constructor for the Manager object
- explicit Manager(ControlInterface *control_interface,
- EventDispatcher *dispatcher);
+ Manager(ControlInterface *control_interface,
+ EventDispatcher *dispatcher);
~Manager();
void Start();
void Stop();
+ void RegisterDevice(Device *to_manage);
+ void DeregisterDevice(const Device *to_forget);
+
+ void RegisterService(Service *to_manage);
+ void DeregisterService(const Service *to_forget);
+
+ void FilterByTechnology(Device::Technology tech,
+ std::vector<scoped_refptr<Device> > *found);
+
+ Service* FindService(const std::string& name);
+
private:
scoped_ptr<ManagerAdaptorInterface> adaptor_;
DeviceInfo device_info_;
bool running_;
- std::vector<Device*> devices_;
- std::vector<Service*> services_;
+ std::vector<scoped_refptr<Device> > devices_;
+ std::vector<scoped_refptr<Service> > services_;
friend class ManagerAdaptorInterface;
};