Add request id to event info 61/201861/4
authorhyunho <hhstark.kang@samsung.com>
Wed, 20 Mar 2019 07:17:04 +0000 (16:17 +0900)
committerhyunho <hhstark.kang@samsung.com>
Thu, 21 Mar 2019 04:18:39 +0000 (13:18 +0900)
Change-Id: I8faa05630da98f211b52ba967134577a99e161a2
Signed-off-by: hyunho <hhstark.kang@samsung.com>
44 files changed:
notification-ex/abstract_item.cc
notification-ex/abstract_item.h
notification-ex/app_control_action.h
notification-ex/chat_message_item.h
notification-ex/chat_message_item_implementation.h
notification-ex/checkbox_item.cc
notification-ex/checkbox_item.h
notification-ex/checkbox_item_implementation.h
notification-ex/dbus_connection_manager.cc
notification-ex/dbus_event_listener.cc
notification-ex/dbus_event_listener_implementation.h
notification-ex/dbus_sender.cc
notification-ex/dbus_sender_implementation.h
notification-ex/entry_item.h
notification-ex/event_info.cc
notification-ex/event_info_implementation.h
notification-ex/event_info_internal.h
notification-ex/ex_bundle.h
notification-ex/ex_util.cc
notification-ex/ex_util.h
notification-ex/icon_item.cc
notification-ex/icon_item.h
notification-ex/icon_item_implementation.h
notification-ex/icon_text_item.h
notification-ex/icon_text_item_implementation.h
notification-ex/ievent_info.h
notification-ex/ievent_info_internal.h
notification-ex/iitem_info.h
notification-ex/iitem_info_internal.h
notification-ex/image_item.h
notification-ex/image_item_implementation.h
notification-ex/item_info_internal.h
notification-ex/manager.cc
notification-ex/manager.h
notification-ex/manager_implementation.h
notification-ex/reporter.cc
notification-ex/reporter.h
notification-ex/reporter_implementation.h
notification-ex/text_item.h
notification-ex/time_item.cc
notification-ex/time_item.h
notification-ex/time_item_implementation.h
unittest/src/test_abstract_item.cc
unittest/src/test_bundle.cc

index f3a80a8..5c1f0f2 100644 (file)
@@ -414,9 +414,5 @@ void AbstractItem::SetUid(int uid) {
   impl_->uid_ = uid;
 }
 
-int AbstractItem::GetRequestId() {
-  return impl_->request_id_;
-}
-
 }  // namespace item
 }  // namespace notification
index 172b31b..dd8bf24 100644 (file)
@@ -258,7 +258,6 @@ class EXPORT_API AbstractItem {
   time_t GetTime();
   int GetUid();
   void SetUid(int uid);
-  int GetRequestId();
 
  private:
   class Impl;
index 6d53e92..875e27f 100644 (file)
@@ -48,4 +48,3 @@ class EXPORT_API AppControlAction : public AbstractAction {
 }  // namespace notification
 
 #endif  // NOTIFICATION_EX_APP_CONTROL_ACTION_H_
-
index 03899e3..4585035 100644 (file)
@@ -60,5 +60,5 @@ class EXPORT_API ChatMessageItem : public AbstractItem {
 };  // class ChatMessageItem
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_CHAT_MESSAGE_ITEM_H_
index 299a0a1..b6e0cc4 100644 (file)
@@ -48,5 +48,5 @@ class ChatMessageItem::Impl {
 };
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_CHAT_MESSAGE_ITEM_IMPLEMENTATION_H_
index ce2c5fe..ed5e99a 100644 (file)
@@ -82,4 +82,4 @@ CheckBoxItem::~CheckBoxItem() = default;
 CheckBoxItem::Impl::~Impl() = default;
 
 }  // namespace item
-}  // namespace notification_ex
+}  // namespace notification
index 6eab2ea..c71fdf5 100644 (file)
@@ -45,5 +45,5 @@ private:
 };  // class CheckBoxItem
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_CHECKBOX_ITEM_H_
index 83de751..1435fb6 100644 (file)
@@ -41,5 +41,5 @@ class CheckBoxItem::Impl {
 };
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_CHECKBOX_ITEM_IMPLEMENTATION_H_
index 736dfe9..2cf9297 100644 (file)
@@ -116,4 +116,4 @@ int DBusConnectionManager::Init() {
   return NOTIFICATION_ERROR_NONE;
 }
 
-}  // nampace notification
+}  // namespace notification
index 0ff42d1..c5f048b 100644 (file)
@@ -215,4 +215,4 @@ list<Bundle> DBusEventListener::NotifyObserver(const IEventInfo& info) {
   return impl_->observer_->OnRequest(info);
 }
 
-}  // nampace notification
+}  // namespace notification
index feff2a3..be2f58b 100644 (file)
@@ -59,5 +59,5 @@ class DBusEventListener::Impl {
   DBusEventListener* parent_;
 };
 
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_DBUS_EVENT_LISTENER_IMPLEMENTATION_H_
index 1e43ac7..33d99da 100644 (file)
@@ -151,4 +151,4 @@ std::list<Bundle> DBusSender::Request(const IEventInfo& info) {
   return ret_list;
 }
 
-}  // nampace notification
+}  // namespace notification
index e0b61c9..b82299b 100644 (file)
@@ -40,5 +40,5 @@ class DBusSender::Impl {
   DBusSender* parent_;
 };
 
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_DBUS_SENDER_IMPLEMENTATION_H_
\ No newline at end of file
index 38a32fb..e22af08 100644 (file)
@@ -50,5 +50,5 @@ class EXPORT_API EntryItem : public AbstractItem {
 };  // class EntryItem
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_ENTRY_ITEM_H_
\ No newline at end of file
index d6562fb..2853e6d 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "notification-ex/event_info_internal.h"
 #include "notification-ex/event_info_implementation.h"
+#include "notification-ex/ex_util.h"
 
 #ifdef LOG_TAG
 #undef LOG_TAG
 #define NOTIFICATION_EX_EVENT_ITEM_ID_KEY "__NOTIFICATION_EX_EVENT_ITEM_ID_KEY__"
 #define NOTIFICATION_EX_EVENT_TAG_KEY "__NOTIFICATION_EX_EVENT_TAG_KEY__"
 #define NOTIFICATION_EX_EVENT_UID_KEY "__NOTIFICATION_EX_EVENT_UID_KEY__"
+#define NOTIFICATION_EX_EVENT_REQUEST_ID_KEY "__NOTIFICATION_EX_EVENT_REQUEST_ID_KEY__"
 
 using namespace std;
 namespace notification {
 
-EventInfo::EventInfo(IEventInfo::EventType type, std::string owner,
-    std::string channel, std::string item_id, std::string tag)
+EventInfo::EventInfo(IEventInfo::EventType type,
+    std::string owner, std::string channel, std::string item_id, std::string tag)
     : impl_(new Impl(this, type, owner, channel, item_id, tag)) {
 }
 EventInfo::~EventInfo() = default;
 EventInfo::Impl::~Impl() = default;
 
-EventInfo::Impl::Impl(EventInfo* parent, IEventInfo::EventType type, std::string owner,
-    std::string channel, std::string item_id, std::string tag)
-    : type_(type), owner_(owner), channel_(channel), item_id_(item_id),
-    tag_(tag), parent_(parent) {
+EventInfo::Impl::Impl(EventInfo* parent,
+    IEventInfo::EventType type, std::string owner, std::string channel,
+    std::string item_id, std::string tag)
+    : type_(type), owner_(owner), channel_(channel),
+    item_id_(item_id), tag_(tag), parent_(parent) {
   uid_ = getuid();
+  request_id_ = util::GetRequestId();
   LOGI("EventInfo impl created");
 }
 
@@ -62,6 +66,9 @@ EventInfo::EventInfo(Bundle serialized)
   impl_->tag_ = serialized.GetString(NOTIFICATION_EX_EVENT_TAG_KEY);
   string uid_str = serialized.GetString(NOTIFICATION_EX_EVENT_UID_KEY);
   impl_->uid_ = (uid_t)strtol(uid_str.c_str(), NULL, 10);
+  string request_id_str =
+      serialized.GetString(NOTIFICATION_EX_EVENT_REQUEST_ID_KEY);
+  impl_->request_id_ = (int)strtol(request_id_str.c_str(), NULL, 10);
 }
 
 string EventInfo::GetString(IEventInfo::EventType type) {
@@ -90,6 +97,8 @@ Bundle EventInfo::Serialize() const {
   serialized.Add(NOTIFICATION_EX_EVENT_ITEM_ID_KEY, impl_->item_id_);
   serialized.Add(NOTIFICATION_EX_EVENT_TAG_KEY, impl_->tag_);
   serialized.Add(NOTIFICATION_EX_EVENT_UID_KEY, to_string((int)impl_->uid_));
+  serialized.Add(
+      NOTIFICATION_EX_EVENT_REQUEST_ID_KEY, to_string(impl_->request_id_));
 
   return serialized;
 }
@@ -122,4 +131,8 @@ void EventInfo::SetUid(uid_t uid) {
   impl_->uid_ = uid;
 }
 
+int EventInfo::GetRequestId() const {
+  return impl_->request_id_;
+}
+
 }  // namespace notification
index 5eeec29..5bd175f 100644 (file)
@@ -34,8 +34,9 @@ class EventInfo::Impl {
 
  private:
   friend class EventInfo;
-  Impl(EventInfo* parent, IEventInfo::EventType type, std::string owner,
-    std::string channel, std::string item_id, std::string tag);
+  Impl(EventInfo* parent, IEventInfo::EventType type,
+    std::string owner, std::string channel,
+    std::string item_id, std::string tag);
 
  private:
   EventType type_;
@@ -44,8 +45,9 @@ class EventInfo::Impl {
   std::string item_id_;
   std::string tag_;
   uid_t uid_;
+  int request_id_;
   EventInfo* parent_;
 };
 
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_EVENT_INFO_IMPLEMENTATION_H_
\ No newline at end of file
index 6cf8bbf..31b268e 100644 (file)
@@ -44,6 +44,7 @@ class EventInfo : public IEventInfoInternal {
   std::string GetChannel() const override;
   std::string GetItemId() const override;
   std::string GetTag() const override;
+  int GetRequestId() const override;
   Bundle Serialize() const override;
   static std::string GetString(EventType type);
 
index 4eaf47f..6587920 100644 (file)
@@ -155,7 +155,7 @@ class EXPORT_API Bundle final {
     return 0;
   }
 
-  int Remove(const std::string& key) {
+  int Delete(const std::string& key) {
     return bundle_del(handle_, key.c_str());
   }
 
index be5136f..975a6ee 100644 (file)
@@ -41,6 +41,12 @@ std::string GetQuarkToString(GQuark quark) {
   return g_quark_to_string(quark);
 }
 
+int GetRequestId() {
+  static int id = 0;
+  g_atomic_int_inc(&id);
+  return id;
+}
+
 string GetAppId() {
   static string appid = "";
   char appid_buf[MAX_PACKAGE_STR_SIZE] = {0, };
index dba3e82..958a348 100644 (file)
@@ -26,6 +26,7 @@ namespace util {
   std::string GetAppId();
   GQuark GetQuarkFromString(std::string str);
   std::string GetQuarkToString(GQuark quark);
+  int GetRequestId();
 }  // namespace util
 }  // namespace notification
 
index 2b3a0d6..bee8104 100644 (file)
@@ -51,5 +51,4 @@ int IconItem::GetType() const {
 }
 
 }  // namespace item
-}  // namespace notification_ex
-
+}  // namespace notification
index 4875316..35e9c56 100644 (file)
@@ -41,5 +41,5 @@ class EXPORT_API IconItem : public ImageItem {
 };  // class IconItem
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_ICON_ITEM_H_
index f80f539..4da0f01 100644 (file)
@@ -40,5 +40,5 @@ class IconItem::Impl {
 };
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_ICON_ITEM_IMPLEMENTATION_H_
index 2653076..9a3330e 100644 (file)
@@ -50,5 +50,5 @@ class EXPORT_API IconTextItem : public AbstractItem {
 };  // class IconTextItem
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_ICON_TEXT_ITEM_H_
index 87e23bc..7c74512 100644 (file)
@@ -42,5 +42,5 @@ class IconTextItem::Impl {
 };
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_ICON_TEXT_ITEM_IMPLEMENTATION_H_
index f7847ef..faf5cd0 100644 (file)
@@ -39,8 +39,9 @@ class EXPORT_API IEventInfo {
   virtual std::string GetChannel() const = 0;
   virtual std::string GetItemId() const = 0;
   virtual std::string GetTag() const = 0;
+  virtual int GetRequestId() const = 0;
   virtual Bundle Serialize() const = 0;
 };
 
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_IEVENT_INFO_H_
index 7ed5f3b..15ca6ec 100644 (file)
@@ -28,5 +28,5 @@ class IEventInfoInternal : public IEventInfo {
   virtual void SetUid(uid_t uid) = 0;
 };
 
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_IEVENT_INFO_INTERNAL_H_
index 049bf97..b6b096b 100644 (file)
@@ -28,5 +28,5 @@ class EXPORT_API IItemInfo {
 };
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_IITEM_INFO_H_
index 1fd215f..cf584e5 100644 (file)
@@ -39,5 +39,5 @@ class EXPORT_API IItemInfoInternal : public IItemInfo {
 };
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_IITEM_INFO_INTERNAL_H_
index ea53650..a17516d 100644 (file)
@@ -46,5 +46,5 @@ class EXPORT_API ImageItem : public AbstractItem {
 };  //class ImageItem
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_IMAGE_ITEM_H_
index 80396f1..367649f 100644 (file)
@@ -40,5 +40,5 @@ class ImageItem::Impl {
 };
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_IMAGE_ITEM_IMPLEMENTATION_H_
index 4f438d6..10b0c4f 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef NOTIFICATION_EX_ITEM_INFO_H_
-#define NOTIFICATION_EX_ITEM_INFO_H_
+#ifndef NOTIFICATION_EX_ITEM_INFO_INTERNAL_H_
+#define NOTIFICATION_EX_ITEM_INFO_INTERNAL_H_
 
 #include "notification-ex/abstract_item_implementation.h"
 #include "notification-ex/iitem_info_internal.h"
@@ -42,5 +42,5 @@ class AbstractItem::Impl::ItemInfo : public IItemInfoInternal {
 };
 
 }  // namespace item
-}  // nampace notification
-#endif  // NOTIFICATION_EX_ITEM_INFO_H_
+}  // namespace notification
+#endif  // NOTIFICATION_EX_ITEM_INFO_INTERNAL_H_
index 8ad885b..32fa971 100644 (file)
@@ -60,7 +60,7 @@ Manager::Impl::Impl(Manager* parent,
   listener_->RegisterObserver(parent_);
 }
 
-void Manager::Impl::SendNotify(shared_ptr<item::AbstractItem> noti,
+int Manager::Impl::SendNotify(shared_ptr<item::AbstractItem> noti,
     IEventInfo::EventType type) {
   Bundle serialized = noti->Serialize();
   EventInfo info(type, util::GetAppId(), noti->GetChannel());
@@ -68,19 +68,20 @@ void Manager::Impl::SendNotify(shared_ptr<item::AbstractItem> noti,
 
   /* Reply to Sender */
   sender_->Notify(info, serialized_list, noti->GetSenderAppId());
+  return info.GetRequestId();
 }
 
-void Manager::Update(shared_ptr<item::AbstractItem> noti) {
-  impl_->SendNotify(noti, EventInfo::Update);
+int Manager::Update(shared_ptr<item::AbstractItem> noti) {
+  return impl_->SendNotify(noti, EventInfo::Update);
 }
 
-void Manager::Remove(shared_ptr<item::AbstractItem> noti) {
-  impl_->SendNotify(noti, EventInfo::Delete);
+int Manager::Delete(shared_ptr<item::AbstractItem> noti) {
+  return impl_->SendNotify(noti, EventInfo::Delete);
 }
 
-void Manager::Hide(shared_ptr<item::AbstractItem> noti) {
+int Manager::Hide(shared_ptr<item::AbstractItem> noti) {
   ((IItemInfoInternal*)noti->GetInfo().get())->AddHideViewer(util::GetAppId());
-  impl_->SendNotify(noti, EventInfo::Update);
+  return impl_->SendNotify(noti, EventInfo::Update);
 }
 
 shared_ptr<item::AbstractItem> Manager::FindByRootID(string id) {
@@ -106,12 +107,13 @@ list<shared_ptr<item::AbstractItem>> Manager::Get() {
   return gen_list;
 }
 
-void Manager::SendEvent(const IEventInfo& info,
+int Manager::SendEvent(const IEventInfo& info,
     shared_ptr<item::AbstractItem> noti) {
   Bundle serialized = noti->Serialize();
   Bundle serialized_info = info.Serialize();
   list<Bundle> serialized_list {serialized};
   impl_->sender_->Notify(info, serialized_list, noti->GetSenderAppId());
+  return info.GetRequestId();
 }
 
 list<Bundle> Manager::OnRequest(const IEventInfo& info) {
@@ -179,4 +181,4 @@ string Manager::GetPath() {
   return NOTIFICATION_EX_MANAGER_OBJECT_PATH;
 }
 
-}  // nampace notification
+}  // namespace notification
index 65e802a..d3692ca 100644 (file)
@@ -21,6 +21,7 @@
 #include <list>
 #include <memory>
 
+#include "notification-ex/common.h"
 #include "notification-ex/abstract_item.h"
 #include "notification-ex/event_observer_interface.h"
 #include "notification-ex/event_sender_interface.h"
@@ -39,11 +40,11 @@ class EXPORT_API Manager : public IEventObserver {
   virtual ~Manager();
 
   std::list<std::shared_ptr<item::AbstractItem>> Get();
-  void Update(std::shared_ptr<item::AbstractItem> noti);
-  void Remove(std::shared_ptr<item::AbstractItem> noti);
-  void Hide(std::shared_ptr<item::AbstractItem> noti);
+  int Update(std::shared_ptr<item::AbstractItem> noti);
+  int Delete(std::shared_ptr<item::AbstractItem> noti);
+  int Hide(std::shared_ptr<item::AbstractItem> noti);
   std::shared_ptr<item::AbstractItem> FindByRootID(std::string id);
-  void SendEvent(const IEventInfo& info, std::shared_ptr<item::AbstractItem> noti);
+  int SendEvent(const IEventInfo& info, std::shared_ptr<item::AbstractItem> noti);
   void OnEvent(const IEventInfo& info, std::list<Bundle> serialized) override;
   std::list<Bundle> OnRequest(const IEventInfo& info) override;
   static std::string GetPath();
index 4b76ca6..5502822 100644 (file)
@@ -35,7 +35,7 @@ class Manager::Impl {
 
  private:
   friend class Manager;
-  void SendNotify(std::shared_ptr<item::AbstractItem> noti,
+  int SendNotify(std::shared_ptr<item::AbstractItem> noti,
       IEventInfo::EventType type);
   std::unique_ptr<IEventSender> sender_;
   std::unique_ptr<IEventListener> listener_;
index cfe5097..ef5d397 100644 (file)
@@ -55,20 +55,21 @@ Reporter::Impl::Impl(Reporter* parent,
   listener_->RegisterObserver(parent_);
 }
 
-void Reporter::Impl::SendNotify(shared_ptr<item::AbstractItem> noti,
+int Reporter::Impl::SendNotify(shared_ptr<item::AbstractItem> noti,
     IEventInfo::EventType type) {
   Bundle serialized = noti->Serialize();
   EventInfo info(type, util::GetAppId(), noti->GetChannel());
   list<Bundle> serialized_list {serialized};
   sender_->Notify(info, serialized_list);
+  return info.GetRequestId();
 }
 
-void Reporter::Post(std::shared_ptr<item::AbstractItem> noti) {
+int Reporter::Post(std::shared_ptr<item::AbstractItem> noti) {
   LOGI("Post noti");
-  impl_->SendNotify(noti, EventInfo::Post);
+  return impl_->SendNotify(noti, EventInfo::Post);
 }
 
-void Reporter::Post(std::list<std::shared_ptr<AbstractItem>> notiList) {
+int Reporter::Post(std::list<std::shared_ptr<AbstractItem>> notiList) {
   EventInfo info(EventInfo::Post, util::GetAppId(), "");
   list<Bundle> serialized_list;
   for (auto& i : notiList) {
@@ -76,14 +77,15 @@ void Reporter::Post(std::list<std::shared_ptr<AbstractItem>> notiList) {
     serialized_list.push_back(b);
   }
   impl_->sender_->Notify(info, serialized_list);
+  return info.GetRequestId();
 }
 
-void Reporter::Update(std::shared_ptr<AbstractItem> noti) {
-  impl_->SendNotify(noti, EventInfo::Update);
+int Reporter::Update(std::shared_ptr<AbstractItem> noti) {
+  return impl_->SendNotify(noti, EventInfo::Update);
 }
 
-void Reporter::Remove(std::shared_ptr<AbstractItem> noti) {
-  impl_->SendNotify(noti, EventInfo::Delete);
+int Reporter::Delete(std::shared_ptr<AbstractItem> noti) {
+  return impl_->SendNotify(noti, EventInfo::Delete);
 }
 
 std::shared_ptr<AbstractItem> Reporter::FindByRootID(std::string id) {
@@ -99,11 +101,12 @@ std::shared_ptr<AbstractItem> Reporter::FindByRootID(std::string id) {
   return gen_item;
 }
 
-void Reporter::SendEvent(const IEventInfo& info,
+int Reporter::SendEvent(const IEventInfo& info,
     shared_ptr<item::AbstractItem> noti) {
   Bundle serialized = noti->Serialize();
   list<Bundle> serialized_list {serialized};
   impl_->sender_->Notify(info, serialized_list);
+  return info.GetRequestId();
 }
 
 void Reporter::OnEvent(const IEventInfo& info, list<Bundle> serialized) {
@@ -136,4 +139,4 @@ string Reporter::GetPath() {
   return NOTIFICATION_EX_REPORTER_OBJECT_PATH;
 }
 
-}  // nampace notification
+}  // namespace notification
index d416aba..a087d17 100644 (file)
@@ -39,11 +39,11 @@ class EXPORT_API Reporter : public IEventObserver {
         std::unique_ptr<IEventListener> listener);
   virtual ~Reporter();
 
-  void SendEvent(const IEventInfo& info, std::shared_ptr<item::AbstractItem> noti);
-  void Post(std::shared_ptr<item::AbstractItem> noti);
-  void Post(std::list<std::shared_ptr<item::AbstractItem>> notiList);
-  void Update(std::shared_ptr<item::AbstractItem> noti);
-  void Remove(std::shared_ptr<item::AbstractItem> noti);
+  int SendEvent(const IEventInfo& info, std::shared_ptr<item::AbstractItem> noti);
+  int Post(std::shared_ptr<item::AbstractItem> noti);
+  int Post(std::list<std::shared_ptr<item::AbstractItem>> notiList);
+  int Update(std::shared_ptr<item::AbstractItem> noti);
+  int Delete(std::shared_ptr<item::AbstractItem> noti);
   std::shared_ptr<item::AbstractItem> FindByRootID(std::string id);
   virtual void OnEvent(const IEventInfo& info,
       std::list<std::shared_ptr<item::AbstractItem>> notiList);
index 4a0c41d..8628dcf 100644 (file)
@@ -35,7 +35,7 @@ class Reporter::Impl {
 
  private:
   friend class Reporter;
-  void SendNotify(std::shared_ptr<item::AbstractItem> noti,
+  int SendNotify(std::shared_ptr<item::AbstractItem> noti,
       IEventInfo::EventType type);
   std::unique_ptr<IEventSender> sender_;
   std::unique_ptr<IEventListener> listener_;
index 9f9a987..178d7c4 100644 (file)
@@ -49,5 +49,5 @@ class EXPORT_API TextItem : public AbstractItem {
 };  // class TextItem
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_TEXT_ITEM_H_
\ No newline at end of file
index e97cd91..f02e413 100644 (file)
@@ -101,4 +101,4 @@ TimeItem::~TimeItem() = default;
 TimeItem::Impl::~Impl() = default;
 
 }  // namespace item
-}  // namespace notification_ex
+}  // namespace notification
index 29a8d56..5322eb3 100644 (file)
@@ -50,5 +50,5 @@ class EXPORT_API TimeItem : public AbstractItem {
 };  // class TimeItem
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_TIME_ITEM_H_
index 9637fde..6330db0 100644 (file)
@@ -42,5 +42,5 @@ class TimeItem::Impl {
 };
 
 }  // namespace item
-}  // nampace notification
+}  // namespace notification
 #endif  // NOTIFICATION_EX_TIME_ITEM_IMPLEMENTATION_H_
index dfb5320..f66f1ec 100644 (file)
@@ -128,7 +128,6 @@ TEST_F(AbstractItemTest, SerializeDeserialize) {
   ASSERT_EQ(gen_test->GetId(), "test_id");
   ASSERT_EQ(gen_test->GetType(), MY_ITEM_TYPE);
   ASSERT_EQ(gen_test->GetUid(), 3);
-  ASSERT_EQ(gen_test->GetRequestId(), 0);
   ASSERT_EQ(gen_test->GetEnable(), false);
   ASSERT_EQ(gen_test->GetVisible(),false);
   ASSERT_EQ(gen_test->GetPolicy(), AbstractItem::Policy::OnBootClear);
index ab52838..a7e66cc 100644 (file)
@@ -93,12 +93,12 @@ TEST(Bundle, GetCount) {
   EXPECT_EQ(bundle.GetCount(), 2);
 }
 
-TEST(Bundle, Remove) {
+TEST(Bundle, Delete) {
   Bundle bundle;
   int r = bundle.Add("TestKey1", "TestVal1");
   EXPECT_EQ(r, 0);
 
-  r = bundle.Remove("TestKey1");
+  r = bundle.Delete("TestKey1");
   EXPECT_EQ(r, 0);
 
   EXPECT_EQ(bundle.GetString("TestKey1"), "");