Remove unused directories and files in video_in_hal
[staging/basesystem.git] / service / native / notification_persistent_service / server / include / ns_npp_persistent_data.h
1   /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 ////////////////////////////////////////////////////////////////////////////////////////////////////
18 /// \ingroup  tag_NPPService
19 /// \brief    The file conains declaration of CPersistentData, CNotificationsToPersist and CPersistDataHeader class.
20 ///       This class is used to hold the persistent data related to state and persistent
21 ///       notification.
22 ///
23 ////////////////////////////////////////////////////////////////////////////////////////////////////
24
25 #ifndef NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSISTENT_DATA_H_
26 #define NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSISTENT_DATA_H_
27
28 #include <native_service/frameworkunified_types.h>
29 #include <string>
30
31 #ifdef AGL_STUB
32 #include <cstring>
33 #endif
34 /**
35  *  This class holds the message and message length of notification data.
36  */
37 class CPersistentData {
38  private:
39   // no members in private
40
41  public:
42   PVOID m_pMessage;         ///< pointer to message structure
43
44   UI_32 m_uiMsgSize;          ///< length of message
45
46   ////////////////////////////////////////////////////////////////////////////////////////////////
47   /// CPersistentData
48   /// Constructor of CPersistentData class
49   ///
50   /// \param
51   ///
52   /// \return
53   ///
54   ////////////////////////////////////////////////////////////////////////////////////////////////
55   CPersistentData();
56
57   ////////////////////////////////////////////////////////////////////////////////////////////////
58   /// ~CPersistentData
59   /// Destructor of CPersistentData class
60   ///
61   /// \param
62   ///
63   /// \return
64   ///
65   ////////////////////////////////////////////////////////////////////////////////////////////////
66   ~CPersistentData();
67 };
68
69 class CNotificationsToPersist {
70  private:
71   // no members in private
72
73  public:
74   std::string m_cNotificationName;      ///< Name of Notification
75
76   UI_32 m_uiMaxMsgLength;           ///< Maximum data length of notification
77
78   EFrameworkunifiedNotificationType m_ePersistentType;   ///< type of notification
79
80   EFrameworkunifiedPersistCategory m_ePersistCategory;   ///< Persistent category
81
82   std::string m_cPublisherName;       ///< Service Name
83
84   CPersistentData *m_pPersistentData;     ///< Persistent data related to notification
85
86   UI_32 m_uiDelay;              ///< Maximum delay for persistence
87
88   ////////////////////////////////////////////////////////////////////////////////////////////////
89   /// CNotificationsToPersist
90   /// Constructor of CNotificationsToPersist class
91   ///
92   /// \param
93   ///
94   /// \return
95   ///
96   ////////////////////////////////////////////////////////////////////////////////////////////////
97   CNotificationsToPersist(): m_cNotificationName(""),
98     m_uiMaxMsgLength(0),
99     m_ePersistentType(eFrameworkunifiedUnknown),
100     m_ePersistCategory(eFrameworkunifiedUserData),
101     m_cPublisherName(""),
102     m_pPersistentData(NULL),
103     m_uiDelay(0) {
104   }
105
106   ////////////////////////////////////////////////////////////////////////////////////////////////
107   /// ~CNotificationsToPersist
108   /// Destructor of CNotificationsToPersist class
109   ///
110   /// \param
111   ///
112   /// \return
113   ///
114   ////////////////////////////////////////////////////////////////////////////////////////////////
115   ~CNotificationsToPersist() {
116     if (NULL != m_pPersistentData) {  // LCOV_EXCL_BR_LINE 6: m_pPersistentData can't be NULL
117       delete m_pPersistentData;
118       m_pPersistentData = NULL;
119     }
120   }
121 };
122
123 class CPersistDataHeader {
124  private:
125   // no members in private
126
127  public:
128   UI_32 m_uiSize;           ///< size of the associated data blob
129   UI_32 m_uiOffset;         ///< Offset at which the data blob starts
130   EFrameworkunifiedNotificationType m_ePersistentType;
131   CHAR  m_cPublisherName[MAX_QUEUE_NAME_SIZE];
132   CHAR  m_cNotificationName[MAX_STRING_SIZE_NOTIFICATION];
133   UI_32 m_uiMaxMsgLength;   ///< max size of the associated data
134
135   ////////////////////////////////////////////////////////////////////////////////////////////////
136   /// CPersistDataHeader
137   /// Constructor of CPersistDataHeader class
138   ///
139   /// \param
140   ///
141   /// \return
142   ///
143   ////////////////////////////////////////////////////////////////////////////////////////////////
144   CPersistDataHeader(): m_uiSize(0),
145     m_uiOffset(0),
146     m_ePersistentType(eFrameworkunifiedPersistedStateVar),
147     m_uiMaxMsgLength(0) {
148     std::memset(m_cPublisherName, 0, MAX_QUEUE_NAME_SIZE);
149     std::memset(m_cNotificationName, 0, MAX_STRING_SIZE_NOTIFICATION);
150   }
151
152   ////////////////////////////////////////////////////////////////////////////////////////////////
153   /// ~CPersistDataHeader
154   /// Destructor of CPersistDataHeader class
155   ///
156   /// \param
157   ///
158   /// \return
159   ///
160   ////////////////////////////////////////////////////////////////////////////////////////////////
161   ~CPersistDataHeader() {
162   }
163 };
164
165 #endif  // NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSISTENT_DATA_H_