Add the ability to remove a component from component tree
This functionality will be neaded on Brillo side to remove components
added by vendor daemons when those daemons exit (normally or abnormally).
This will allow those daemons to re-add the same component when they get
restarted.
Change-Id: Ida350cfa38d4f1265d1e86fccca893cdf7f5030c
Reviewed-on: https://weave-review.googlesource.com/2087
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/component_manager_impl.h b/src/component_manager_impl.h
index 97d302d..8c4ad16 100644
--- a/src/component_manager_impl.h
+++ b/src/component_manager_impl.h
@@ -47,6 +47,23 @@
const std::vector<std::string>& traits,
ErrorPtr* error) override;
+ // Removes an existing component instance from device.
+ // |path| is a path to the parent component (or empty string if a root-level
+ // component is being removed).
+ // |name| is a name of the component to be removed.
+ bool RemoveComponent(const std::string& path,
+ const std::string& name,
+ ErrorPtr* error) override;
+
+ // Removes an element from component array.
+ // |path| is a path to the parent component.
+ // |name| is an array root element inside the child components.
+ // |index| is a zero-based element index in the component array.
+ bool RemoveComponentArrayItem(const std::string& path,
+ const std::string& name,
+ size_t index,
+ ErrorPtr* error) override;
+
// Sets callback which is called when new components are added.
void AddComponentTreeChangedCallback(const base::Closure& callback) override;