return ERROR_NONE;
}
-int DBManager::InsertNotification(list<shared_ptr<item::AbstractItem>> addedItem) {
+int DBManager::InsertNotification(list<shared_ptr<item::AbstractItem>> addedList) {
int ret = ERROR_NONE;
char* query;
int64_t priv_id = 0;
return ERROR_FROM_DB;
}
- for (auto& i : addedItem) {
+ for (auto& i : addedList) {
uid_t uid = static_pointer_cast<IItemInfoInternal>(i->GetInfo())->GetUid();
list<shared_ptr<item::AbstractItem>> item_list =
GetNotificationList(i->GetSenderAppId(), i->GetId(), uid);
}
if (ret == ERROR_NONE) {
- CheckLimit(*(addedItem.begin()), db);
+ CheckLimit(*(addedList.begin()), db);
if (sqlite3_exec(db, "END TRANSACTION", nullptr, nullptr, nullptr)) {
LOGE("end transaction error : %s", sqlite3_errmsg(db));
ret = ERROR_FROM_DB;
return ret;
}
-int DBManager::UpdateNotification(list<shared_ptr<item::AbstractItem>> updatedItem) {
+int DBManager::UpdateNotification(list<shared_ptr<item::AbstractItem>> updatedList) {
int ret = ERROR_NONE;
char* query;
sqlite3* db = OpenDB();
return ERROR_FROM_DB;
}
- for (auto& i : updatedItem) {
+ for (auto& i : updatedList) {
uid_t uid = static_pointer_cast<IItemInfoInternal>(i->GetInfo())->GetUid();
list<shared_ptr<item::AbstractItem>> item_list =
GetNotificationList(i->GetSenderAppId(), i->GetId(), uid);
}
int DBManager::DeleteNotification(
- list<shared_ptr<item::AbstractItem>> deletedItem) {
+ list<shared_ptr<item::AbstractItem>> deletedList) {
int ret = ERROR_NONE;
char* query;
sqlite3* db = OpenDB();
return ERROR_FROM_DB;
}
- for (auto& i : deletedItem) {
+ for (auto& i : deletedList) {
query = sqlite3_mprintf("DELETE FROM noti_ex_list WHERE priv_id = %" PRId64 "",
static_pointer_cast<IItemInfoInternal>(i->GetInfo())->GetPrivateId());
if (!query) {
public:
static int InitializeDB();
static void InitializeData();
- static int InsertNotification(std::list<std::shared_ptr<item::AbstractItem>> addedItem);
+ static int InsertNotification(std::list<std::shared_ptr<item::AbstractItem>> addedList);
static std::map<std::string, std::string> GetHideMap();
static int UpdateHideList(std::shared_ptr<item::AbstractItem> updatedItem, const std::string& hide_list);
- static int UpdateNotification(std::list<std::shared_ptr<item::AbstractItem>> updatedItem);
+ static int UpdateNotification(std::list<std::shared_ptr<item::AbstractItem>> updatedList);
static int GetCount(int64_t priv_id, const std::string& root_id, const std::string& app_id, uid_t uid, int* count);
static int GetCount(const std::string& app_id, uid_t uid, int* count);
- static int DeleteNotification(std::list<std::shared_ptr<item::AbstractItem>> deletedItem);
+ static int DeleteNotification(std::list<std::shared_ptr<item::AbstractItem>> deletedList);
static std::list<std::shared_ptr<item::AbstractItem>> GetNotificationList(uid_t uid, std::string channel = "");
static std::list<std::shared_ptr<item::AbstractItem>> GetNotificationList(std::string app_id, uid_t uid, std::string channel = "");
static std::list<std::shared_ptr<item::AbstractItem>> GetNotificationList(std::string app_id, std::string root_id, uid_t uid);
}
void Manager::OnAdd(const IEventInfo& info,
- list<shared_ptr<item::AbstractItem>> addedItem) {
+ list<shared_ptr<item::AbstractItem>> addedList) {
}
void Manager::OnUpdate(const IEventInfo& info,
- list<shared_ptr<item::AbstractItem>> updatedItem) {
+ list<shared_ptr<item::AbstractItem>> updatedList) {
}
void Manager::OnDelete(const IEventInfo& info,
- list<shared_ptr<item::AbstractItem>> deletedItem) {
+ list<shared_ptr<item::AbstractItem>> deletedList) {
}
void Manager::OnError(NotificationError error, int requestId) {
static std::string GetPath();
protected:
- virtual void OnAdd(const IEventInfo& info, std::list<std::shared_ptr<item::AbstractItem>> addedItem);
- virtual void OnUpdate(const IEventInfo& info, std::list<std::shared_ptr<item::AbstractItem>> updatedItem);
- virtual void OnDelete(const IEventInfo& info, std::list<std::shared_ptr<item::AbstractItem>> deletedItem);
+ virtual void OnAdd(const IEventInfo& info, std::list<std::shared_ptr<item::AbstractItem>> addedList);
+ virtual void OnUpdate(const IEventInfo& info, std::list<std::shared_ptr<item::AbstractItem>> updatedList);
+ virtual void OnDelete(const IEventInfo& info, std::list<std::shared_ptr<item::AbstractItem>> deletedList);
virtual void OnError(NotificationError error, int requestId);
virtual std::list<std::shared_ptr<item::AbstractItem>> OnRequestEvent(
const IEventInfo& info);
}
void InvokeAdded(Manager* manager, const IEventInfo& info,
- list<shared_ptr<AbstractItem>> addedItem) {
+ list<shared_ptr<AbstractItem>> addedList) {
if (cb_.added == nullptr)
return;
noti_ex_item_h* added_item =
- (noti_ex_item_h*)calloc(addedItem.size(), sizeof(noti_ex_item_h));
+ (noti_ex_item_h*)calloc(addedList.size(), sizeof(noti_ex_item_h));
if (added_item == nullptr) {
LOGE("Out of memory");
return;
}
int idx = 0;
- for (auto& i : addedItem) {
+ for (auto& i : addedList) {
added_item[idx++] =
static_cast<noti_ex_item_h>(new Handle(shared_ptr<AbstractItem>(i)));
}
IEventInfo* c_info = const_cast<IEventInfo*>(&info);
cb_.added(static_cast<noti_ex_manager_h>(manager),
static_cast<noti_ex_event_info_h>(c_info), added_item,
- addedItem.size(), user_data_);
+ addedList.size(), user_data_);
}
void InvokeUpdated(Manager* manager, const IEventInfo& info,
- list<shared_ptr<AbstractItem>> updatedItem) {
+ list<shared_ptr<AbstractItem>> updatedList) {
if (cb_.updated == nullptr)
return;
IEventInfo* c_info = const_cast<IEventInfo*>(&info);
- for (auto& i : updatedItem) {
+ for (auto& i : updatedList) {
cb_.updated(static_cast<noti_ex_manager_h>(manager),
static_cast<noti_ex_event_info_h>(c_info),
static_cast<noti_ex_item_h>(new Handle(shared_ptr<AbstractItem>(i))),
}
void InvokeDeleted(Manager* manager, const IEventInfo& info,
- list<shared_ptr<AbstractItem>> deletedItem) {
+ list<shared_ptr<AbstractItem>> deletedList) {
if (cb_.deleted == nullptr)
return;
IEventInfo* c_info = const_cast<IEventInfo*>(&info);
- for (auto& i : deletedItem) {
+ for (auto& i : deletedList) {
cb_.deleted(static_cast<noti_ex_manager_h>(manager),
static_cast<noti_ex_event_info_h>(c_info),
static_cast<noti_ex_item_h>(new Handle(shared_ptr<AbstractItem>(i))),
}
void OnAdd(const IEventInfo& info,
- list<shared_ptr<AbstractItem>> addedItem) override {
- cb_->InvokeAdded(this, info, addedItem);
+ list<shared_ptr<AbstractItem>> addedList) override {
+ cb_->InvokeAdded(this, info, addedList);
}
void OnUpdate(const IEventInfo& info,
- list<shared_ptr<AbstractItem>> updatedItem) override {
- cb_->InvokeUpdated(this, info, updatedItem);
+ list<shared_ptr<AbstractItem>> updatedList) override {
+ cb_->InvokeUpdated(this, info, updatedList);
}
void OnDelete(const IEventInfo& info,
- list<shared_ptr<AbstractItem>> deletedItem) override {
- cb_->InvokeDeleted(this, info, deletedItem);
+ list<shared_ptr<AbstractItem>> deletedList) override {
+ cb_->InvokeDeleted(this, info, deletedList);
}
void OnError(NotificationError error, int requestId) override {