1 //******************************************************************
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
24 * This file contains Notification service topics linked list representation.
27 #ifndef _NS_TOPICS_LIST_H_
28 #define _NS_TOPICS_LIST_H_
41 * @brief This class provides a set of APIs for Notification service Topics Linked list.
47 * Constructor of NSTopicsList.
49 NSTopicsList() : m_modifiable(true) { }
52 * Constructor of NSTopicsList.
54 * @param topics - pointer to NSTopicLL struct to initialize.
56 NSTopicsList(::NSTopicLL *topics, bool modify);
59 * Copy Constructor of NSTopicsList.
61 * @param topicsList - NSTopicsList to initialize.
63 NSTopicsList(const NSTopicsList &topicsList);
66 * Copy assignment operator of NSTopicsList.
68 * @param topicsList - NSTopicsList to initialize.
69 * @return NSTopicsList object reference
71 NSTopicsList &operator=(const NSTopicsList &topicsList);
74 * Destructor of NSTopicsList.
79 * This method is for adding topic for the Notification service Topics Linked list.
81 * @param topicName as string.
82 * @param state - as NSTopicState.
84 void addTopic(const std::string &topicName, NSTopic::NSTopicState state);
87 * This method is for removing topic from the Notification service Topics Linked list.
89 * @param topicName as string.
91 void removeTopic(const std::string &topicName);
94 * This method is for getting topic LL from the Notification service Topics Linked list.
96 * @return topic as NSTopics Linked list.
98 std::list<NSTopic> getTopicsList() const;
101 * This method is for preventing for add/remove Topic from Topicslist.
102 * Below method restricts the application from illegally modifying Topics when
103 * Provider is in Invalid state. By calling the API, the service prevents and protects
104 * the integrity of TopicsList updation when the associated object is Invalid.
107 void unsetModifiability();
110 std::list<NSTopic *> m_topicsList;
116 #endif /* _NS_TOPICS_LIST_H_ */