Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / nsframework / notification_persistent_service / server / include / ns_npp_persistent_accesser.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 contains declaration of CPersistentAccesser class.
20 ///       This is a abstract class. Derived classes of this class will store the data in different
21 ///       file formats.
22 ///
23 ///
24 ////////////////////////////////////////////////////////////////////////////////////////////////////
25
26 #ifndef NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSISTENT_ACCESSER_H_
27 #define NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSISTENT_ACCESSER_H_
28
29 #include <native_service/frameworkunified_types.h>
30 #include <string>
31 #include <vector>
32
33 class CPersistentData;
34 class CNotificationsToPersist;
35
36 ////////////////////////////////////////////////////////////////////////////////////////////////////
37 /// vector of all available persistent notification and its data.
38 ////////////////////////////////////////////////////////////////////////////////////////////////////
39 typedef std::vector<CNotificationsToPersist *> Persistent_Notification_List_Type;
40
41 /**
42  *  This is a abstract class. Derived classes of this class will store the data in different
43  *  file formats.
44  */
45 class CPersistentAccesser {
46  public:
47   ////////////////////////////////////////////////////////////////////////////////////////////////
48   /// CPersistentAccesser
49   /// Constructor of CPersistentAccesser class
50   ///
51   /// \param
52   ///
53   /// \return
54   ///
55   ////////////////////////////////////////////////////////////////////////////////////////////////
56   CPersistentAccesser() {}
57
58   ////////////////////////////////////////////////////////////////////////////////////////////////
59   /// ~CPersistentAccesser
60   /// Destructor of CPersistentAccesser class
61   ///
62   /// \param
63   ///
64   /// \return
65   ///
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
69   }
70   // LCOV_EXCL_STOP
71
72   ////////////////////////////////////////////////////////////////////////////////////////////////
73   /// PersistData
74   /// Persist data in persistent memory depending on file format.
75   ///
76   /// \param [IN] f_vpersistentnotificationlist
77   ///      Persistent_Notification_List_Type - Data which has to be persisted.
78   ///
79   /// \param [IN] f_cmemfilepath
80   ///      std::string - Read data from this file.
81   ///
82   /// \param [IN] f_epersistenttype
83   ///      EFrameworkunifiedNotificationType - Type of persistent notification
84   ///
85   /// \param [IN] f_epersistcategory
86   ///      EFrameworkunifiedPersistCategory - persist category
87   ///
88   /// \return EFrameworkunifiedStatus
89   //      EFrameworkunifiedStatus - success or failure status
90   ///
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;
96
97   ////////////////////////////////////////////////////////////////////////////////////////////////
98   /// RetrieveData
99   /// Retrieve data in persistent memory depending on file format.
100   ///
101   /// \param [IN] f_cmemfilepath
102   ///      std::string - Write data from this file.
103   ///
104   /// \param [IN] f_vpersistentnotificationlist
105   ///      Persistent_Notification_List_Type* - Retrieved data.
106   ///
107   /// \param [IN] f_epersistcategory
108   ///      EFrameworkunifiedPersistCategory - persist category
109   ///
110   /// \return EFrameworkunifiedStatus
111   //      EFrameworkunifiedStatus - success or failure status
112   ///
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;
117 };
118
119 #endif  // NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSISTENT_ACCESSER_H_