1 //******************************************************************
3 // Copyright 2017 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 provides C++ Wrapper APIs of Notification Service for accepted consumers.
27 #ifndef _NS_ACCEPTED_CONSUMERS_H_
28 #define _NS_ACCEPTED_CONSUMERS_H_
34 #include "NSConsumer.h"
41 * @class NSAcceptedConsumers
42 * @brief This class provides a set of C++APIs for managing accepted Consumers.
44 class NSAcceptedConsumers
48 * Constructor of NSAcceptedConsumers.
57 * Destructor of NSAcceptedConsumers.
59 ~NSAcceptedConsumers()
64 * request to get NSConsumer pointer
65 * @param id -id as string
67 * @return pointer to NSConsumer
69 std::shared_ptr<NSConsumer> getConsumer(const std::string &id);
72 * request to add NSConsumer pointer
73 * @param pointer to NSConsumer
76 void addConsumer(std::shared_ptr<NSConsumer> consumer);
79 * request to remove NSConsumer
80 * @param id -id as string
83 void removeConsumer(const std::string &id);
86 * request to check if NSConsumer is accepted
87 * @param id -id as string
89 * @return true if accepted else false
91 bool isAccepted(const std::string &id);
94 * get size of Consumers accepted.
95 * @return m_consumers size
100 * request to remove all NSConsumer
102 void removeConsumers();
105 * get the map of Consumers accepted.
106 * @return m_consumers -map of accepted Consumers
108 std::map<std::string, std::shared_ptr<NSConsumer> > getConsumers();
111 std::map<std::string, std::shared_ptr<NSConsumer> > m_consumers;
116 #endif /* _NS_ACCEPTED_CONSUMERS_H_ */