common_library: gettid is multiple declaration in cl_error
[staging/basesystem.git] / video_in_hal / nsframework / notification_persistent_service / server / include / ns_npp_persist_file.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 CFilePersistence class.
20 ///           This class is responsible for persisting and retrieving of files.
21 ///
22 ///
23 ////////////////////////////////////////////////////////////////////////////////////////////////////
24
25 #ifndef NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSIST_FILE_H_
26 #define NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSIST_FILE_H_
27
28 #include <native_service/ns_np_service.h>
29 #include <string>
30 #include <map>
31 #include "ns_npp_persistence.h"
32
33 // Forward declaration of classes.
34 class CPersistence;
35 class CRegistryEntry;
36
37 /**
38  *  This class is responsible for persisting and retrieving of files..
39  */
40 class CFilePersistence : public CPersistence {
41  private:
42   TSourceRegistryList m_mPersistFileRegistry;
43
44  public:
45   ////////////////////////////////////////////////////////////////////////////////////////////////
46   /// CFilePersistence
47   /// Constructor of CFilePersistence class
48   ///
49   /// \param
50   ///
51   /// \return
52   ///
53   ////////////////////////////////////////////////////////////////////////////////////////////////
54   CFilePersistence();
55
56   ////////////////////////////////////////////////////////////////////////////////////////////////
57   /// ~CFilePersistence
58   /// Destructor of CFilePersistence class
59   ///
60   /// \param
61   ///
62   /// \return
63   ///
64   ////////////////////////////////////////////////////////////////////////////////////////////////
65   ~CFilePersistence();
66
67   ////////////////////////////////////////////////////////////////////////////////////////////////
68   /// Release
69   /// Request for release file to persistent storage. File persist will be done at shutdown.
70   ///
71   /// \param [IN] f_cappname
72   ///      string - Name of the application requesting for persistence
73   ///
74   /// \param [IN] f_ctag
75   ///      string - File will be persist against this tag.
76   ///
77   /// \param [IN] f_cmempath
78   ///      string - File which needs to persist.
79   ///
80   /// \param [IN] enotificationpersistentservicereleasetype
81   ///      EFrameworkunifiedReleaseType - eFrameworkunifiedNotOnRelease = 0  :not on release
82   ///                        eFrameworkunifiedPersistOnShutdown :persist on shutdown
83   ///                        eFrameworkunifiedPersistInstantly  :persist instantly
84   ///
85   /// \param [IN] f_cusername
86   ///      std::string - If tag is registered as user, then f_cusername holds the name of user,
87   ///            else an empty string
88   ///
89   /// \return EFrameworkunifiedStatus
90   //      EFrameworkunifiedStatus - success or failure status
91   ///
92   ////////////////////////////////////////////////////////////////////////////////////////////////
93   EFrameworkunifiedStatus Release(std::string f_cappname, std::string f_ctag, std::string f_cmempath,
94                      EFrameworkunifiedReleaseType enotificationpersistentservicereleasetype, std::string f_cusername);
95
96   ////////////////////////////////////////////////////////////////////////////////////////////////
97   /// Load
98   ///  Load file from persistent memory to the specified location.
99   ///
100   /// \param [IN] f_cappname
101   ///      string - Name of the application requesting for persistence
102   ///
103   /// \param [IN] f_ctag
104   ///      string - File corresponding to this tag will be retrieved.
105   ///
106   /// \param [IN] f_cretrievepath
107   ///      string - Filepath for retrieved file.
108   ///
109   /// \param [IN] f_cusername
110   ///      std::string - If tag is registered as user, then f_cusername holds the name of user,
111   ///            else an empty string
112   ///
113   /// \return EFrameworkunifiedStatus
114   //      EFrameworkunifiedStatus - success or failure status
115   ///
116   ////////////////////////////////////////////////////////////////////////////////////////////////
117   EFrameworkunifiedStatus Load(std::string f_cappname, std::string f_ctag, std::string f_cretrievepath,
118                   std::string f_cusername);
119 };
120
121 #endif  // NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSIST_FILE_H_