Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / nsframework / framework_unified / client / include / native_service / ns_resource_controler.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  * @file ns_resource_controler.h
18  * @brief \~english This file provides api for operating Resource
19  *
20  */
21 /** @addtogroup BaseSystem
22  *  @{
23  */
24 /** @addtogroup native_service
25  *  @ingroup BaseSystem
26  *  @{
27  */
28 /** @addtogroup framework_unified
29  *  @ingroup native_service
30  *  @{
31  */
32 /** @addtogroup native
33  *  @ingroup framework_unified
34  *  @{
35  */
36 #ifndef _ns_resource_controler_h_  // NOLINT  (build/header_guard)
37 #define _ns_resource_controler_h_
38
39 #define FRAMEWORKUNIFIED_RES_ABNMLMON "FRAMEWORKUNIFIED_RES_ABNMLMON"
40 #define FRAMEWORKUNIFIED_RES_TIMER "FRAMEWORKUNIFIED_RES_TIMER"
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45   /////////////////////////////////////////////////////////////////////////////////////
46   /// \ingroup BaseSystem
47   /// \~english @par Summary
48   ///       This function is used to get the resourceid associated with the mod and the key.
49   /// \~english @param [IN] mod
50   ///        const char * - the mod of resource
51   /// \~english @param [IN] key
52   ///        const char * - the key of resource
53   /// \~english @param [OUT] resource
54   ///        long * - resource ID
55   /// \~english @retval -1 fail
56   /// \~english @retval 0  success
57   /// \~english @par Preconditions
58   ///       - None.
59   /// \~english @par Change of the internal state
60   ///       - Change of internal state according to the API does not occur.
61   /// \~english @par Causes of failures
62   ///       None
63   /// \~english @par Classification
64   ///       Public
65   /// \~english @par Type
66   ///          sync only
67   /// \~english @par Detail
68   ///       This function is used to get the resourceid associated with the mod and the key.
69   /// \~english @see
70   ////////////////////////////////////////////////////////////////////////////////////
71 int frameworkunifiedGetResource(const char *mod, const char *key, long *resource);  // NOLINT  (readability/nolint)
72
73   /////////////////////////////////////////////////////////////////////////////////////
74   /// \ingroup BaseSystem
75   /// \~english @par Summary
76   ///       This function is used to acquire the resourceid associated with the mod and the key.
77   /// \~english @param [IN] mod
78   ///        const char * - the mod of resource
79   /// \~english @param [IN] key
80   ///        const char * - the key of resource
81   /// \~english @param [OUT] resource
82   ///        long * - resource ID
83   /// \~english @retval ref_counter the counter of user
84   /// \~english @par Preconditions
85   ///       - None.
86   /// \~english @par Change of the internal state
87   ///       - Change of internal state according to the API does not occur.
88   /// \~english @par Causes of failures
89   ///       None
90   /// \~english @par Classification
91   ///       Public
92   /// \~english @par Type
93   ///          sync only
94   /// \~english @par Detail
95   ///       This function is used to acquire the resourceid associated with the mod and the key.
96   /// \~english @see
97   ////////////////////////////////////////////////////////////////////////////////////
98 int frameworkunifiedAcquireResouce(const char *mod, const char *key, long *resource);  // NOLINT  (readability/nolint)
99
100   /////////////////////////////////////////////////////////////////////////////////////
101   /// \ingroup BaseSystem
102   /// \~english @par Summary
103   ///       This function is used to release the resourceid associated with the mod and the key.
104   /// \~english @param [IN] mod
105   ///        const char * - the mod of resource
106   /// \~english @param [IN] key
107   ///        const char * - the key of resource
108   /// \~english @retval ref_counter the counter of user
109   /// \~english @par Preconditions
110   ///       - None.
111   /// \~english @par Change of the internal state
112   ///       - Change of internal state according to the API does not occur.
113   /// \~english @par Causes of failures
114   ///       None
115   /// \~english @par Classification
116   ///       Public
117   /// \~english @par Type
118   ///          sync only
119   /// \~english @par Detail
120   ///       This function is used to release the resourceid associated with the mod and the key.
121   /// \~english @see
122   ////////////////////////////////////////////////////////////////////////////////////
123 int frameworkunifiedReleaseResouce(const char *mod, const char *key);
124
125   /////////////////////////////////////////////////////////////////////////////////////
126   /// \ingroup BaseSystem
127   /// \~english @par Summary
128   ///       This function is used to get the key associated with the mod and the resourceid.
129   /// \~english @param [IN] mod
130   ///        const char * - the mod of resource
131   /// \~english @param [IN] resource
132   ///        long - resource ID
133   /// \~english @param [OUT] key
134   ///        const char * - the key of resource
135   /// \~english @retval -1 fail
136   /// \~english @retval 0  success
137   /// \~english @par Preconditions
138   ///       - None.
139   /// \~english @par Change of the internal state
140   ///       - Change of internal state according to the API does not occur.
141   /// \~english @par Causes of failures
142   ///       None
143   /// \~english @par Classification
144   ///       Public
145   /// \~english @par Type
146   ///          sync only
147   /// \~english @par Detail
148   ///       This function is used to get the key associated with the mod and the resourceid.
149   /// \~english @see
150   ////////////////////////////////////////////////////////////////////////////////////
151 int frameworkunifiedSearchResourseKey(const char *mod, long resource, const char **key);  // NOLINT  (readability/nolint)
152
153   /////////////////////////////////////////////////////////////////////////////////////
154   /// \ingroup BaseSystem
155   /// \~english @par Summary
156   ///       This function is used to register the resource associated with the mod and the key.
157   /// \~english @param [IN] mod
158   ///        const char * - the mod of resource
159   /// \~english @param [IN] key
160   ///        const char * - the key of resource
161   /// \~english @param [IN] resource
162   ///        const char * - resource ID
163   /// \~english @param [IN] init_counter
164   ///        long - resource user counter
165   /// \~english @retval -1 fail
166   /// \~english @retval 0  success
167   /// \~english @par Preconditions
168   ///       - None.
169   /// \~english @par Change of the internal state
170   ///       - Change of internal state according to the API does not occur.
171   /// \~english @par Causes of failures
172   ///       None
173   /// \~english @par Classification
174   ///       Public
175   /// \~english @par Type
176   ///          sync only
177   /// \~english @par Detail
178   ///       This function is used to register the resource associated with the mod and the key.init counter.
179   /// \~english @see
180   ////////////////////////////////////////////////////////////////////////////////////
181
182 int frameworkunifiedRegistResouce(const char *mod, const char *key, long resource, int init_counter);  // NOLINT  (readability/nolint)
183   /////////////////////////////////////////////////////////////////////////////////////
184   /// \ingroup BaseSystem
185   /// \~english @par Summary
186   ///       This function is used to unregister the resource associated with the mod and the key.
187   /// \~english @param [IN] mod
188   ///        const char * - the mod of resource
189   /// \~english @param [IN] key
190   ///        const char * - the key of resource
191   /// \~english @retval 0  success
192   /// \~english @par Preconditions
193   ///       - None.
194   /// \~english @par Change of the internal state
195   ///       - Change of internal state according to the API does not occur.
196   /// \~english @par Causes of failures
197   ///       None
198   /// \~english @par Classification
199   ///       Public
200   /// \~english @par Type
201   ///          sync only
202   /// \~english @par Detail
203   ///       This function is used to unregister the resource associated with the mod and the key.init counter.
204   /// \~english @see
205   ////////////////////////////////////////////////////////////////////////////////////
206 int frameworkunifiedUnregistResouce(const char *mod, const char *key);
207
208 #ifdef __cplusplus
209 }
210 #endif
211
212 #endif  // _ns_resource_controler_h_ NOLINT  (build/header_guard)
213 /** @}*/
214 /** @}*/
215 /** @}*/
216 /** @}*/