regulators: Build IDMap for system

The IDMap class is used to map string IDs to the corresponding C++
Device, Rail, and Rule objects.

The IDMap class is complete and tested, but it was not previously being
populated except in testcases.

Add new methods to the System, Chassis, and Device classes to populate
the IDMap with all the ID -> object mappings in the system.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I80f39b663b011ca643c91f7281ff50c956631331
diff --git a/phosphor-regulators/src/chassis.cpp b/phosphor-regulators/src/chassis.cpp
new file mode 100644
index 0000000..3787365
--- /dev/null
+++ b/phosphor-regulators/src/chassis.cpp
@@ -0,0 +1,31 @@
+/**
+ * Copyright © 2020 IBM Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "chassis.hpp"
+
+namespace phosphor::power::regulators
+{
+
+void Chassis::addToIDMap(IDMap& idMap)
+{
+    // Add devices and their rails to the map
+    for (std::unique_ptr<Device>& device : devices)
+    {
+        device->addToIDMap(idMap);
+    }
+}
+
+} // namespace phosphor::power::regulators