unit-test: Test deleting entry on name change

Breaking off into a separate function enables easier unit testing of the
specific function

Testing: 97% coverage of processing.cpp

Change-Id: I08f229657a8f44230b711fabbae20fb403792637
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/src/processing.hpp b/src/processing.hpp
index 00f8a6d..8ef6e48 100644
--- a/src/processing.hpp
+++ b/src/processing.hpp
@@ -1,5 +1,7 @@
 #pragma once
 
+#include "associations.hpp"
+
 #include <boost/container/flat_map.hpp>
 #include <boost/container/flat_set.hpp>
 #include <string>
@@ -7,6 +9,20 @@
 /** @brief Define white list and black list data structure */
 using WhiteBlackList = boost::container::flat_set<std::string>;
 
+/** @brief Dbus interface which contains org.openbmc Associations */
+constexpr const char* ASSOCIATIONS_INTERFACE = "org.openbmc.Associations";
+
+/** @brief interface_map_type is the underlying datastructure the mapper uses.
+ *
+ * The 3 levels of map are
+ * object paths
+ *   connection names
+ *      interface names
+ */
+using interface_map_type = boost::container::flat_map<
+    std::string, boost::container::flat_map<
+                     std::string, boost::container::flat_set<std::string>>>;
+
 /** @brief Get well known name of input unique name
  *
  * If user passes in well known name then that will be returned.
@@ -36,3 +52,21 @@
 bool needToIntrospect(const std::string& processName,
                       const WhiteBlackList& whiteList,
                       const WhiteBlackList& blackList);
+
+/** @brief Handle the removal of an existing name in objmgr data structures
+ *
+ * @param[in,out] nameOwners      - Map of unique name to well known name
+ * @param[in]     wellKnown       - Well known name that has new owner
+ * @param[in]     oldOwner        - Old unique name
+ * @param[in,out] interfaceMap    - Map of interfaces
+ * @param[in,out] assocOwners     - Owners of associations
+ * @param[in,out] assocInterfaces - Associations endpoints
+ * @param[in,out] server          - sdbus system object
+ *
+ */
+void processNameChangeDelete(
+    boost::container::flat_map<std::string, std::string>& nameOwners,
+    const std::string& wellKnown, const std::string& oldOwner,
+    interface_map_type& interfaceMap, AssociationOwnersType& assocOwners,
+    AssociationInterfaces& assocInterfaces,
+    sdbusplus::asio::object_server& server);