Make UserSubscription as shared_ptr in Subscription

Currently UserSubscription are used as value in Subscription. This
causes the copy of the object between subscriptionsMap and
subscriptionConfigMap when doing PATCH.

Using a shared_ptr for UserSubscription avoids the memory copy of it.

Tested:

- Using Redfish Event Listener, test subscriptions and eventing.
- Redfish Service Validator passes

Change-Id: I5821b72f28ba737a5c9b75288d377766c84c6a6a
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/include/event_service_store.hpp b/include/event_service_store.hpp
index bf4e545..b0a1d97 100644
--- a/include/event_service_store.hpp
+++ b/include/event_service_store.hpp
@@ -310,7 +310,7 @@
 class EventServiceStore
 {
   public:
-    boost::container::flat_map<std::string, UserSubscription>
+    boost::container::flat_map<std::string, std::shared_ptr<UserSubscription>>
         subscriptionsConfigMap;
     EventServiceConfig eventServiceConfig;
 
@@ -324,18 +324,6 @@
     {
         return eventServiceConfig;
     }
-
-    void updateUserSubscriptionConfig(const UserSubscription& userSub)
-    {
-        const std::string& id = userSub.id;
-        auto obj = subscriptionsConfigMap.find(id);
-        if (obj == subscriptionsConfigMap.end())
-        {
-            BMCWEB_LOG_INFO("No UserSubscription exist with ID:{}", id);
-            return;
-        }
-        obj->second = userSub;
-    }
 };
 
 } // namespace persistent_data