Resource Tuner
Loading...
Searching...
No Matches
Extensions.h
Go to the documentation of this file.
1// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2// SPDX-License-Identifier: BSD-3-Clause-Clear
3
8#ifndef RESOURCE_TUNER_EXTENSIONS_H
9#define RESOURCE_TUNER_EXTENSIONS_H
10
11#include <iostream>
12#include <vector>
13#include <unordered_map>
14
15typedef void (*ResourceLifecycleCallback)(void*);
16
24 RESOURCE_CONFIG,
25 PROPERTIES_CONFIG,
26 SIGNALS_CONFIG,
27 EXT_FEATURES_CONFIG,
28 TARGET_CONFIG,
29 INIT_CONFIG,
30 TOTAL_CONFIGS_COUNT
31};
32
40private:
41 static std::vector<std::string> mModifiedConfigFiles;
42 static std::unordered_map<uint32_t, ResourceLifecycleCallback> mResourceApplierCallbacks;
43 static std::unordered_map<uint32_t, ResourceLifecycleCallback> mResourceTearCallbacks;
44
45public:
46 Extensions(uint32_t resCode, int8_t callbackType, ResourceLifecycleCallback callback);
47 Extensions(ConfigType configType, std::string yamlFile);
48
49 static std::vector<std::pair<uint32_t, ResourceLifecycleCallback>> getResourceApplierCallbacks();
50 static std::vector<std::pair<uint32_t, ResourceLifecycleCallback>> getResourceTearCallbacks();
51
52 static std::string getResourceConfigFilePath();
53 static std::string getPropertiesConfigFilePath();
54 static std::string getSignalsConfigFilePath();
55 static std::string getExtFeaturesConfigFilePath();
56 static std::string getTargetConfigFilePath();
57 static std::string getInitConfigFilePath();
58};
59
60#define CONCAT(a, b) a ## b
61
70#define RESTUNE_REGISTER_APPLIER_CB(resCode, resourceApplierCallback) \
71 static Extensions CONCAT(_resourceApplier, resCode)(resCode, 0, resourceApplierCallback);
72
81#define RESTUNE_REGISTER_TEAR_CB(resCode, resourceTearCallback) \
82 static Extensions CONCAT(_resourceTear, resCode)(resCode, 1, resourceTearCallback);
83
93#define RESTUNE_REGISTER_CONFIG(configType, yamlFile) \
94 static Extensions CONCAT(_regConfig, configType)(configType, yamlFile);
95
96#endif
ConfigType
Different Config (via YAML) Types supported.
Definition Extensions.h:23
Extensions.
Definition Extensions.h:39