IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NSSyncInfo.h
Go to the documentation of this file.
1 //******************************************************************
2 //
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
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
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
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.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20 
27 #ifndef _NS_SYNC_INFO_H_
28 #define _NS_SYNC_INFO_H_
29 
30 #include <string>
31 #include "NSCommon.h"
32 
33 namespace OIC
34 {
35  namespace Service
36  {
41  class NSSyncInfo
42  {
43  public:
45  enum class NSSyncType
46  {
47  NS_SYNC_UNREAD = 0,
48  NS_SYNC_READ = 1,
49  NS_SYNC_DELETED = 2,
50  };
51 
55  NSSyncInfo(): m_messageId(0), m_state(NSSyncType::NS_SYNC_UNREAD)
56  {
57  }
58 
64  NSSyncInfo(::NSSyncInfo *syncInfo);
65 
66 
74  NSSyncInfo(const uint64_t &messageId, const std::string &providerId,
75  const NSSyncType &state)
76  : m_messageId(messageId), m_providerId(providerId), m_state(state)
77  {
78  }
79 
83  ~NSSyncInfo() = default;
84 
90  uint64_t getMessageId() const;
91 
97  std::string getProviderId() const;
98 
104  NSSyncType getState() const;
105 
106  private:
107  uint64_t m_messageId;
108  std::string m_providerId;
109  NSSyncType m_state;
110  };
111  }
112 }
113 #endif /* _NS_SYNC_INFO_H_ */
NSSyncType
NSSyncType - enumeration for Notification service SyncType.
Definition: NSSyncInfo.h:45
Definition: NSCommon.h:65
uint64_t getMessageId() const
This method is for getting Message Id from the Notification service sync info.
NSSyncType getState() const
This method is for getting state from the Notification service sync info.
std::string getProviderId() const
This method is for getting Provider Id from the Notification service sync info.
NSSyncInfo()
Constructor of NSSyncInfo.
Definition: NSSyncInfo.h:55
NSSyncInfo(const uint64_t &messageId, const std::string &providerId, const NSSyncType &state)
Constructor of NSSyncInfo.
Definition: NSSyncInfo.h:74
This class provides a set of APIs for Notification service SyncInfo .
Definition: NSSyncInfo.h:41
NSSyncType
Notification message status to synchronize.
Definition: NSCommon.h:63
~NSSyncInfo()=default
Destructor of NSSyncInfo.
This file provides APIs of Notification Service for common functions.