2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 ////////////////////////////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_NPPService
19 /// \brief The file contains declaration of CPersistentAccesser class.
20 /// This is a abstract class. Derived classes of this class will store the data in different
24 ////////////////////////////////////////////////////////////////////////////////////////////////////
26 #ifndef NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSISTENT_ACCESSER_H_
27 #define NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSISTENT_ACCESSER_H_
29 #include <native_service/frameworkunified_types.h>
33 class CPersistentData;
34 class CNotificationsToPersist;
36 ////////////////////////////////////////////////////////////////////////////////////////////////////
37 /// vector of all available persistent notification and its data.
38 ////////////////////////////////////////////////////////////////////////////////////////////////////
39 typedef std::vector<CNotificationsToPersist *> Persistent_Notification_List_Type;
42 * This is a abstract class. Derived classes of this class will store the data in different
45 class CPersistentAccesser {
47 ////////////////////////////////////////////////////////////////////////////////////////////////
48 /// CPersistentAccesser
49 /// Constructor of CPersistentAccesser class
55 ////////////////////////////////////////////////////////////////////////////////////////////////
56 CPersistentAccesser() {}
58 ////////////////////////////////////////////////////////////////////////////////////////////////
59 /// ~CPersistentAccesser
60 /// Destructor of CPersistentAccesser class
66 ////////////////////////////////////////////////////////////////////////////////////////////////
67 virtual ~CPersistentAccesser() { // LCOV_EXCL_START 14: Resident process, global instance not released
68 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
72 ////////////////////////////////////////////////////////////////////////////////////////////////
74 /// Persist data in persistent memory depending on file format.
76 /// \param [IN] f_vpersistentnotificationlist
77 /// Persistent_Notification_List_Type - Data which has to be persisted.
79 /// \param [IN] f_cmemfilepath
80 /// std::string - Read data from this file.
82 /// \param [IN] f_epersistenttype
83 /// EFrameworkunifiedNotificationType - Type of persistent notification
85 /// \param [IN] f_epersistcategory
86 /// EFrameworkunifiedPersistCategory - persist category
88 /// \return EFrameworkunifiedStatus
89 // EFrameworkunifiedStatus - success or failure status
91 ////////////////////////////////////////////////////////////////////////////////////////////////
92 virtual EFrameworkunifiedStatus PersistData(std::string f_cmemfilepath,
93 Persistent_Notification_List_Type *f_vpersistentnotificationlist,
94 EFrameworkunifiedNotificationType f_epersistenttype,
95 EFrameworkunifiedPersistCategory f_epersistcategory = eFrameworkunifiedUserData) = 0;
97 ////////////////////////////////////////////////////////////////////////////////////////////////
99 /// Retrieve data in persistent memory depending on file format.
101 /// \param [IN] f_cmemfilepath
102 /// std::string - Write data from this file.
104 /// \param [IN] f_vpersistentnotificationlist
105 /// Persistent_Notification_List_Type* - Retrieved data.
107 /// \param [IN] f_epersistcategory
108 /// EFrameworkunifiedPersistCategory - persist category
110 /// \return EFrameworkunifiedStatus
111 // EFrameworkunifiedStatus - success or failure status
113 ////////////////////////////////////////////////////////////////////////////////////////////////
114 virtual EFrameworkunifiedStatus RetrieveData(std::string f_cmemfilepath,
115 Persistent_Notification_List_Type *&f_vpersistentnotificationlist, // NOLINT (runtime/references)
116 EFrameworkunifiedPersistCategory f_epersistcategory = eFrameworkunifiedUserData) = 0;
119 #endif // NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSISTENT_ACCESSER_H_