Resource Tuner
Loading...
Searching...
No Matches
SignalConfigProcessor.h
1// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2// SPDX-License-Identifier: BSD-3-Clause-Clear
3
4#ifndef SIGNAL_CONFIG_PROCESSOR_H
5#define SIGNAL_CONFIG_PROCESSOR_H
6
7#include <iostream>
8#include <memory>
9#include <stack>
10
11#include "YamlParser.h"
12#include "SignalRegistry.h"
13#include "Extensions.h"
14#include "ExtFeaturesRegistry.h"
15
16#define SIGNAL_CONFIGS_ROOT "SignalConfigs"
17#define SIGNAL_CONFIGS_ELEM_SIGID "SigId"
18#define SIGNAL_CONFIGS_ELEM_CATEGORY "Category"
19#define SIGNAL_CONFIGS_ELEM_NAME "Name"
20#define SIGNAL_CONFIGS_ELEM_TIMEOUT "Timeout"
21#define SIGNAL_CONFIGS_ELEM_ENABLE "Enable"
22#define SIGNAL_CONFIGS_ELEM_TARGETS_ENABLED "TargetsEnabled"
23#define SIGNAL_CONFIGS_ELEM_TARGETS_DISABLED "TargetsDisabled"
24#define SIGNAL_CONFIGS_ELEM_PERMISSIONS "Permissions"
25#define SIGNAL_CONFIGS_ELEM_DERIVATIVES "Derivatives"
26#define SIGNAL_CONFIGS_ELEM_RESOURCES "Resources"
27
28#define SIGNAL_CONFIGS_ELEM_RESOURCE_CODE "ResCode"
29#define SIGNAL_CONFIGS_ELEM_RESOURCE_RESINFO "ResInfo"
30#define SIGNAL_CONFIGS_ELEM_RESOURCE_VALUES "Values"
31
32#define EXT_FEATURE_CONFIGS_ROOT "FeatureConfigs"
33#define EXT_FEATURE_CONFIGS_ELEM_ID "FeatId"
34#define EXT_FEATURE_CONFIGS_ELEM_LIB "LibPath"
35#define EXT_FEATURE_CONFIGS_ELEM_NAME "Name"
36#define EXT_FEATURE_CONFIGS_ELEM_DESCRIPTION "Description"
37#define EXT_FEATURE_CONFIGS_ELEM_SUBSCRIBER_LIST "Signals"
38
84class SignalConfigProcessor {
85private:
86 ErrCode parseSignalConfigYamlNode(const std::string& filePath, int8_t isBuSpecified);
87 ErrCode parseExtFeatureConfigYamlNode(const std::string& filePath);
88
89public:
90 ErrCode parseSignalConfigs(const std::string& filePath, int8_t isBuSpecified=false);
91 ErrCode parseExtFeaturesConfigs(const std::string& filePath);
92 ErrCode parse(ConfigType configType, const std::string& filePath, int8_t isBuSpecified);
93};
94
95#endif
ErrCode
Custom Error Codes used by Resource Tuner APIs and Internal Functions.
Definition ErrCodes.h:17
ConfigType
Different Config (via YAML) Types supported.
Definition Extensions.h:23