• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef API_CORE_OS_COMMON_EXTENSIONS_CREATE_INFO_H
17 #define API_CORE_OS_COMMON_EXTENSIONS_CREATE_INFO_H
18 
19 #include <base/namespace.h>
20 #include <base/util/uid.h>
21 #include <core/namespace.h>
22 #include <core/os/platform_trace_info.h>
23 
24 CORE_BEGIN_NAMESPACE()
25 constexpr const int32_t PLATFORM_EXTENSION_UNDEFINED = 0;
26 constexpr const int32_t PLATFORM_EXTENSION_TRACE_USER = 1;
27 constexpr const int32_t PLATFORM_EXTENSION_TRACE_EXTENSION = 2;
28 
29 class IPerformanceTrace;
30 
31 struct PlatformCreateExtensionInfo {
32     PlatformCreateExtensionInfo* next { nullptr };
33     int32_t type { PLATFORM_EXTENSION_UNDEFINED };
34 };
35 
36 /** could be used to expose settings for a user-defined tracing api */
37 struct PlatformTraceInfoUsr : public PlatformCreateExtensionInfo {
38     IPerformanceTrace* tracer;
39 };
40 
41 /** could be used to expose settings from an standard plugin */
42 struct PlatformTraceInfoExt : public PlatformCreateExtensionInfo {
43     BASE_NS::Uid plugin { "6151083a-d86f-4037-9059-97f8d0616161" };
44     BASE_NS::Uid type { GetDefaultTrace() };
45 };
46 CORE_END_NAMESPACE()
47 
48 #endif // API_CORE_OS_COMMON_PLATFORM_CREATE_INFO_H
49