11 #include <unordered_set>
15 #define INTERNAL_KEY_NT_ET_AP_PORT "nt.et.ap_port"
16 #define INTERNAL_KEY_NT_ET_ET_PORT_LIST "nt.et.et_port_list"
17 #define INTERNAL_KEY_NT_ET_AP_LIST "nt.et.ap_list"
18 #define INTERNAL_KEY_NT_ET_ET_LIST "nt.et.et_list"
19 #define INTERNAL_KEY_NT_PT_PUBLIC_DOMAIN_LIST "nt.pt.public_domain_list"
20 #define INTERNAL_KEY_RTC_AUDIO_MUTE_ME "rtc.audio.mute_me"
21 #define INTERNAL_KEY_RTC_AUDIO_MUTE_PEERS "rtc.audio.mute_peers"
22 #define INTERNAL_KEY_RTC_AUDIO_SET_DEFAULT_MUTE_PEERS "rtc.audio.set_default_mute_peers"
23 #define INTERNAL_KEY_RTC_AUDIO_MUTE_PEER "rtc.audio.mute_peer"
24 #define INTERNAL_KEY_RTC_AUDIO_UPLINK_MAX_RETRY_TIMES "rtc.audio.uplink_max_retry_times"
25 #define INTERNAL_KEY_RTC_AUDIO_DOWNLINK_MAX_RETRY_TIMES "rtc.audio.downlink_max_retry_times"
26 #define INTERNAL_KEY_RTC_AUDIO_ENABLED "rtc.audio.enabled"
27 #define INTERNAL_KEY_RTC_AUDIO_PAUSED "rtc.audio.paused"
28 #define INTERNAL_KEY_RTC_AUDIO_CODEC "rtc.audio.codec"
29 #define INTERNAL_KEY_RTC_AUDIO_DTX "rtc.audio.dtx"
30 #define INTERNAL_KEY_RTC_AUDIO_OPTIONS "rtc.audio.options"
31 #define INTERNAL_KEY_RTC_AUDIO_FRAMES_PER_PACKET "rtc.audio.frames_per_packet"
32 #define INTERNAL_KEY_RTC_AUDIO_INTERLEAVES_PER_PACKET "rtc.audio.interleaves_per_packet"
33 #define INTERNAL_KEY_RTC_AUDIO_HIGH_QUALITY_MODE "rtc.audio.high.quality.mode"
34 #define INTERNAL_KEY_RTC_AUDIO_NETWORK_OPTIMIZED "rtc.audio.network_optimized"
35 #define INTERNAL_KEY_RTC_AUDIO_INSTANT_JOIN_OPTIMIZED "rtc.audio.instant_join_optimized"
36 #define INTERNAL_KEY_RTC_AUDIO_START_CALL "rtc.audio.start_call"
37 #define INTERNAL_KEY_RTC_AUDIO_APM_DUMP "rtc.audio.apm_dump"
38 #define INTERNAL_KEY_RTC_AUDIO_FRAME_DUMP "rtc.audio.frame_dump"
39 #define INTERNAL_KEY_RTC_VIDEO_MUTE_ME "rtc.video.mute_me"
40 #define INTERNAL_KEY_RTC_VIDEO_MUTE_PEERS "rtc.video.mute_peers"
41 #define INTERNAL_KEY_RTC_VIDEO_SET_DEFAULT_MUTE_PEERS "rtc.video.set_default_mute_peers"
42 #define INTERNAL_KEY_RTC_VIDEO_MUTE_PEER "rtc.video.mute_peer"
43 #define INTERNAL_KEY_RTC_VIDEO_SET_REMOTE_VIDEO_STREAM "rtc.video.set_remote_video_stream"
44 #define INTERNAL_KEY_RTC_VIDEO_SET_REMOTE_DEFAULT_VIDEO_STREAM_TYPE "rtc.video.set_remote_default_video_stream_type"
45 #define INTERNAL_KEY_RTC_VIDEO_CAPTURE "rtc.video.capture"
46 #define INTERNAL_KEY_RTC_VIDEO_ENABLED "rtc.video.enabled"
47 #define INTERNAL_KEY_RTC_VIDEO_PREVIEW "rtc.video.preview"
48 #define INTERNAL_KEY_RTC_VIDEO_AUDIENCE_PREVIEW "rtc.video.audience_preview"
49 #define INTERNAL_KEY_RTC_VIDEO_LOCAL_MIRRORED "rtc.video.local_mirrored"
50 #define INTERNAL_KEY_RTC_VIDEO_BITRATE_LIMIT "rtc.video.bitrate_limit"
51 #define INTERNAL_KEY_RTC_VIDEO_PROFILE "rtc.video.profile"
52 #define INTERNAL_KEY_RTC_VIDEO_ENGINE_PROFILE "rtc.video.engine_profile"
53 #define INTERNAL_KEY_RTC_VIDEO_CACHE "rtc.video.cache"
54 #define INTERNAL_KEY_RTC_VIDEO_CODEC "rtc.video.codec"
55 #define INTERNAL_KEY_RTC_VIDEO_PREFER_FRAME_RATE "rtc.video.prefer_frame_rate"
56 #define INTERNAL_KEY_RTC_VIDEO_WEB_H264_INTEROP_ENABLE "rtc.video.web_h264_interop_enable"
57 #define INTERNAL_KEY_RTC_VIDEO_CUSTOM_PROFILE "rtc.video.custom_profile"
58 #define INTERNAL_KEY_RTC_VIDEO_UPLINK_MAX_RETRY_TIMES "rtc.video.uplink_max_retry_times"
59 #define INTERNAL_KEY_RTC_VIDEO_DOWNLINK_MAX_RETRY_TIMES "rtc.video.downlink_max_retry_times"
60 #define INTERNAL_KEY_RTC_VIDEO_RSFEC_MIN_LEVEL "rtc.video.rsfec_min_level"
61 #define INTERNAL_KEY_RTC_PEER_OFFLINE_PERIOD "rtc.peer.offline_period"
62 #define INTERNAL_KEY_RTC_CONNECTION_TIMEOUT_PERIOD "rtc.connection_timeout_period"
63 #define INTERNAL_KEY_RTC_CHANNEL_MODE "rtc.channel_mode"
64 #define INTERNAL_KEY_RTC_AP_PORT "rtc.ap_port"
65 #define INTERNAL_KEY_RTC_VOCS_PORT "rtc.vocs_port"
66 #define INTERNAL_KEY_RTC_STUN_PORT "rtc.stun_port"
67 #define INTERNAL_KEY_RTC_LASTMILE_PROBE_TEST "rtc.lastmile_probe_test"
68 #define INTERNAL_KEY_RTC_AP_LIST "rtc.ap_list"
69 #define INTERNAL_KEY_RTC_VOCS_LIST "rtc.vocs_list"
70 #define INTERNAL_KEY_RTC_VOS_IP_PORT_LIST "rtc.vos_list"
71 #define INTERNAL_KEY_RTC_PRIORITY_VOS_IP_PORT_LIST "rtc.priority_vos_list"
72 #define INTERNAL_KEY_RTC_STUN_PORT "rtc.stun_port"
73 #define INTERNAL_KEY_RTC_ICE_LIST "rtc.ice_list"
74 #define INTERNAL_KEY_RTC_STUN_LIST "rtc.stun_list"
75 #define INTERNAL_KEY_RTC_ICE_LIST2 "rtc.ice_list2"
76 #define INTERNAL_KEY_RTC_RENEW_TOKEN "rtc.renew_token"
77 #define INTERNAL_KEY_RTC_NETOB "rtc.netob"
78 #define INTERNAL_KEY_RTC_PROXY_SERVER "rtc.proxy_server"
79 #define INTERNAL_KEY_RTC_ENABLE_PROXY_SERVER "rtc.enable_proxy"
80 #define INTERNAL_KEY_RTC_CROSS_CHANNEL_PARAM "rtc.cross_channel_param"
81 #define INTERNAL_KEY_RTC_CROSS_CHANNEL_ENABLED "rtc.cross_channel_enabled"
82 #define INTERNAL_KEY_RTC_ACTIVE_VOS_LIST "rtc.active_vos_list"
83 #define INTERNAL_KEY_RTC_JOINED_VOS "rtc.joined.vos"
84 #define INTERNAL_KEY_RTC_LOCAL_PUBLISH_FALLBACK_OPTION "rtc.local_publish_fallback_option"
85 #define INTERNAL_KEY_RTC_REMOTE_SUBSCRIBE_FALLBACK_OPTION "rtc.remote_subscribe_fallback_option"
86 #define INTERNAL_KEY_RTC_PUBLIC_DOMAIN_LIST "rtc.public_domain_list"
87 #define INTERNAL_KEY_RTC_VOET_LIST "rtc.voet_list"
88 #define INTERNAL_KEY_RTC_VOET_PORT_LIST "rtc.voet_port_list"
89 #define INTERNAL_KEY_RTC_SIGNAL_DEBUG "rtc.signal_debug"
90 #define INTERNAL_KEY_RTC_AUDIO_QUALITY_INDICATION "rtc.audio_quality_indication"
91 #define INTERNAL_KEY_RTC_TRANSPORT_QUALITY_INDICATION "rtc.transport_quality_indication"
92 #define INTERNAL_KEY_RTC_COMPATIBLE_MODE "rtc.compatible_mode"
93 #define INTERNAL_KEY_RTC_CLIENT_TYPE "rtc.client_type"
94 #define INTERNAL_KEY_RTC_EXTENSIONID "rtc.extension_id"
95 #define INTERNAL_KEY_RTC_REPORT_LEVEL "rtc.report_level"
96 #define INTERNAL_KEY_RTC_CHANNEL_PROFILE "rtc.channel_profile"
97 #define INTERNAL_KEY_RTC_CLIENT_ROLE "rtc.client_role"
98 #define INTERNAL_KEY_RTC_DUAL_STREAM_MODE "rtc.dual_stream_mode"
99 #define INTERNAL_KEY_RTC_ENCRYPTION_MASTER_KEY "rtc.encryption.master_key"
100 #define INTERNAL_KEY_RTC_ENCRYPTION_MODE "rtc.encryption.mode"
101 #define INTERNAL_KEY_RTC_FORCE_UNIFIED_COMMUNICATION_MODE "rtc.force_unified_communication_mode"
102 #define INTERNAL_KEY_RTC_TRY_P2P_ONLY_ONCE "rtc.try_p2p_only_once"
103 #define INTERNAL_KEY_RTC_APPLY_DEFAULT_CONFIG "rtc.apply_default_config"
104 #define INTERNAL_KEY_RTC_CACHE_CONFIG "rtc.cache_config"
105 #define INTERNAL_KEY_RTC_DUAL_SIGNALING_MODE "rtc.dual_signaling_mode"
106 #define INTERNAL_KEY_RTC_LIVE_DUAL_LBS_MODE "rtc.live_dual_lbs_mode"
107 #define INTERNAL_KEY_RTC_GEN_NOTIFICATION_WITH_ID "rtc.gen_notification_with_id"
108 #define INTERNAL_KEY_RTC_UPLOAD_LOG "rtc.upload_log"
109 #define INTERNAL_KEY_RTC_EXTENSION_LIST "rtc.extension_list"
110 #define INTERNAL_KEY_RTC_REQ_JOIN_PUBLISHER "rtc.req.join_publisher"
111 #define INTERNAL_KEY_RTC_RES_JOIN_PUBLISHER "rtc.res.join_publisher"
112 #define INTERNAL_KEY_RTC_REQ_REMOVE_PUBLISHER "rtc.req.remove_publisher"
113 #define INTERNAL_KEY_RTC_ENABLE_API_TRACER "rtc.enable_api_tracer"
114 #define INTERNAL_KEY_RTC_RECORDING_CONFIG "rtc.recording.config"
115 #define INTERNAL_KEY_RTC_AUDIO_FEC "rtc.audio_fec"
116 #define INTERNAL_KEY_RTC_CAPABILITIES "rtc.capabilities"
117 #define INTERNAL_KEY_RTC_USER_ACCOUNT_SERVER_LIST "rtc.user_account_server_list"
118 #define INTERNAL_KEY_RTC_WORK_MANAGER_ACCOUNT_LIST "rtc.work_manager_account_list"
119 #define INTERNAL_KEY_RTC_WORK_MANAGER_ADDR_LIST "rtc.work_manager_addr_list"
120 #define INTERNAL_KEY_RTC_REPORT_TYPE "rtc.report_type"
121 #define INTERNAL_KEY_RTC_AUDIO_FROZEN_TYPE_IN_API "rtc.audio.frozen_type_in_api"
122 #define CONFIGURABLE_KEY_RTC_VIDEO_PLAYOUT_DELAY_MAX "rtc.video.playout_delay_max"
123 #define CONFIGURABLE_KEY_RTC_VIDEO_PLAYOUT_DELAY_MIN "rtc.video.playout_delay_min"
124 #define INTERNAL_KEY_RTC_DISABLE_INTRA_REQUEST "rtc.disable_intra_request"
125 #define CONFIGURABLE_KEY_RTC_UPLOAD_LOG_REQUEST "rtc.upload_log_request"
126 #define CONFIGURABLE_KEY_RTC_WIN_ALLOW_MAGNIFICATION "rtc.win_allow_magnification"
127 #define CONFIGURABLE_KEY_RTC_WIN_ALLOW_DIRECTX "rtc.win_allow_directx"
128 #define CONFIGURABLE_KEY_SDK_DEBUG_ENABLE "rtc.debug.enable"
129 #define INTERNAL_KEY_SDK_DEBUG_COMMAND "rtc.debug.command"
130 #define INTERNAL_KEY_RTC_TEST_CONFIG_SERVICE "rtc.test_config_service"
131 #define CONFIGURABLE_KEY_RTC_AEC3_ENABLE "rtc.aec3.enable"
132 #define CONFIGURABLE_KEY_RTC_AUDIO_ENABLE_OPENSL "rtc.audio.opensl"
133 #define CONFIGURABLE_KEY_RTC_AUDIO_BANNED_SL_LEVEL "rtc.audio.banned_sl_level"
134 #define CONFIGURABLE_KEY_RTC_AUDIO_HIGH_QUALITY_ENABLE_OPENSL_WITH_HEADSET "rtc.audio.highQuality.enableOpenSL.withHeadset"
135 #define CONFIGURABLE_KEY_RTC_AUDIO_IO_BUFFER_PERIOD_WITH_OPENSL "rtc.audio.io_buffer_period.withOpenSL"
136 #define CONFIGURABLE_KEY_RTC_AUDIO_ADM_LAYER "rtc.audio.admlayer"
137 #define CONFIGURABLE_KEY_RTC_REPORT_CONFIG "rtc.report_config"
138 #define CONFIGURABLE_KEY_RTC_AUDIO_PLAYBUFSIZE_FACTOR "rtc.audio.playbufsize_factor"
139 #define CONFIGURABLE_KEY_RTC_AUDIO_MAX_BUFFERED_RECORDED_FRAMES "rtc.audio.max_buffered_recorded_frames"
140 #define INTERNAL_KEY_CHE_AUDIO_PROFILE "che.audio.profile"
141 #define CONFIGURABLE_KEY_RTC_IP_AREACODE "rtc.ip_area_code"
142 #define CONFIGURABLE_KEY_RTC_IP_AREACODE_CN "rtc.ip_cn_area"
143 #define CONFIGURABLE_KEY_RTC_IP_AREACODE_NA "rtc.ip_na_area"
144 #define CONFIGURABLE_KEY_RTC_IP_AREACODE_EUR "rtc.ip_eur_area"
145 #define CONFIGURABLE_KEY_RTC_IP_AREACODE_AS "rtc.ip_as_area"
146 #define CONFIGURABLE_KEY_RTC_IP_AREACODE_JP "rtc.ip_jp_area"
147 #define CONFIGURABLE_KEY_RTC_IP_AREACODE_IN "rtc.ip_india_area"
148 #define CONFIGURABLE_KEY_RTC_IP_AREACODE_OCEANIA "rtc.ip_oceania_area"
149 #define CONFIGURABLE_KEY_RTC_IP_AREACODE_SA "rtc.ip_south_america_area"
150 #define CONFIGURABLE_KEY_RTC_IP_AREACODE_AFRICA "rtc.ip_africa_area"
151 #define CONFIGURABLE_KEY_RTC_IP_AREACODE_OVERSEA "rtc.ip_oversea_area"
152 #define CONFIGURABLE_KEY_RTC_IP_TLS_AREACODE_CN "rtc.ip_tls_cn_area"
153 #define CONFIGURABLE_KEY_RTC_IP_TLS_AREACODE_NA "rtc.ip_tls_na_area"
154 #define CONFIGURABLE_KEY_RTC_IP_TLS_AREACODE_EUR "rtc.ip_tls_eur_area"
155 #define CONFIGURABLE_KEY_RTC_IP_TLS_AREACODE_AS "rtc.ip_tls_as_area"
156 #define CONFIGURABLE_KEY_RTC_IP_TLS_AREACODE_JP "rtc.ip_tls_jp_area"
157 #define CONFIGURABLE_KEY_RTC_IP_TLS_AREACODE_IN "rtc.ip_tls_indian_area"
158 #define CONFIGURABLE_KEY_RTC_IP_TLS_AREACODE_OC "rtc.ip_tls_oceania_area"
159 #define CONFIGURABLE_KEY_RTC_IP_TLS_AREACODE_SA "rtc.ip_tls_south_america_area"
160 #define CONFIGURABLE_KEY_RTC_IP_TLS_AREACODE_AF "rtc.ip_tls_africa_area"
161 #define CONFIGURABLE_KEY_RTC_IP_TLS_AREACODE_OVS "rtc.ip_tls_oversea_area"
162 #define CONFIGURABLE_KEY_RTC_PROXY_IP_AREACODE_CN "rtc.proxy.ip_cn_area"
163 #define CONFIGURABLE_KEY_RTC_PROXY_IP_AREACODE_NA "rtc.proxy.ip_na_area"
164 #define CONFIGURABLE_KEY_RTC_PROXY_IP_AREACODE_EUR "rtc.proxy.ip_eur_area"
165 #define CONFIGURABLE_KEY_RTC_PROXY_IP_AREACODE_AS "rtc.proxy.ip_as_area"
166 #define CONFIGURABLE_KEY_RTC_PROXY_IP_TLS_AREACODE_CN "rtc.proxy.ip_tls_cn_area"
167 #define CONFIGURABLE_KEY_RTC_PROXY_IP_TLS_AREACODE_NA "rtc.proxy.ip_tls_na_area"
168 #define CONFIGURABLE_KEY_RTC_PROXY_IP_TLS_AREACODE_EUR "rtc.proxy.ip_tls_eur_area"
169 #define CONFIGURABLE_KEY_RTC_PROXY_IP_TLS_AREACODE_AS "rtc.proxy.ip_tls_as_area"
170 #define CONFIGURABLE_KEY_RTC_ENABLE_DNS "rtc.enable_dns"
171 #define INTERNAL_KEY_RTC_PROXY_AP_PORTS "rtc.proxy.ap_ports"
172 #define INTERNAL_KEY_RTC_PROXY_AP_AUT_PORTS "rtc.proxy.ap_aut_ports"
173 #define INTERNAL_KEY_RTC_PROXY_AP_TLS_PORTS "rtc.proxy.ap_tls_ports"
174 #define INTERNAL_KEY_RTC_PROXY_AP_TLS_443_PORTS "rtc.proxy.tls_443_ports"
175 #define INTERNAL_KEY_RTC_ENABLE_CRYPTO_ACCESS "rtc.enable_crypto_access"
176 #define INTERNAL_KEY_RTC_JOIN_CHANNEL_TIMEOUT "rtc.join_channel_timeout"
177 #define CONFIGURABLE_KEY_RTC_FIRST_FRAME_DECODED_TIMEOUT "rtc.first_frame_decoded_timeout"
178 #define CONFIGURABLE_KEY_RTC_JOIN_TO_FIRST_DECODED_TIMEOUT "rtc.join_to_first_decoded_timeout"
179 #define CONFIGURABLE_KEY_RTC_VIDEO_ENABLED_HW_ENCODER KEY_RTC_VIDEO_ENABLED_HW_ENCODER
180 #define CONFIGURABLE_KEY_RTC_VIDEO_ENABLE_HW_DECODER KEY_RTC_VIDEO_ENABLED_HW_DECODER
181 #define INTERNAL_KEY_RTC_ENABLE_DEBUG_LOG "rtc.enable_debug_log"
182 #define CONFIGURABLE_KEY_RTC_P2P_SWITCH "rtc.enable_p2p"
183 #define INTERNAL_KEY_RTC_ENABLE_TWO_BYTE_RTP_EXTENSION "rtc.enable_two_byte_rtp_extension"
184 #define CONFIGURABLE_KEY_RTC_ENABLE_DUMP "rtc.enable_xdump"
185 #define CONFIGURABLE_KEY_RTC_ENABLE_DUMP_FILE "rtc.enable_xdump_file"
186 #define CONFIGURABLE_KEY_RTC_ENABLE_DUMP_UPLOAD "rtc.enable_xdump_upload"
187 #define INTERNAL_KEY_RTC_CRASH_FOR_TEST_PURPOSE "rtc.crash_for_test_purpose"
188 #define CONFIGURABLE_KEY_BITRATE_ADJUST_RATIO KEY_RTC_VIDEO_BITRATE_ADJUST_RATIO
189 #define CONFIGURABLE_KEY_MINBITRATE_RATIO KEY_RTC_VIDEO_MINBITRATE_RATIO
190 #define CONFIGURABLE_KEY_RTC_ENABLE_CAMERA_CAPTURE_YUV "rtc.enable_camera_capture_yuv"
191 #define CONFIGURABLE_KEY_ENABLE_WEBRTC_PACER "rtc.enable_webrtc_pacer"
192 #define INTERNAL_KEY_RTC_GATEWAY_RTT "rtc.gateway_rtt"
193 #define INTERNAL_KEY_RTC_ENABLE_USERINFO_HIDDEN "rtc.enable_userinfo_hidden"
194 #define CONFIGURABLE_KEY_VIDEO_DEGRADATION_PREFERENCE KEY_RTC_VIDEO_DEGRADATION_PREFERENCE
195 #define CONFIGURABLE_KEY_VIDEO_DEGRADATION_FPS_DOWN_STEP KEY_RTC_VIDEO_DEGRADATION_FPS_DOWN_STEP
196 #define CONFIGURABLE_KEY_VIDEO_DEGRADATION_FPS_UP_STEP KEY_RTC_VIDEO_DEGRADATION_FPS_UP_STEP
197 #define CONFIGURABLE_KEY_RTC_VIDEO_CODEC_TYPE KEY_RTC_VIDEO_CODEC_TYPE
198 #define CONFIGURABLE_KEY_VIDEO_VQC_VERSION "rtc.video.vqc_version"
199 #define INTERNAL_KEY_RTC_NEW_VOS "rtc.new_vos"
200 #define CONFIGURABLE_KEY_AUDIO_PROCESS_BLACK_LIST "rtc.audio.process.black_list"
201 #define CONFIGURABLE_KEY_VIDEO_HAS_INTRA_REQUEST "che.video.has_intra_request"
202 #define CONFIGURABLE_KEY_ENABLE_VIDEO_SENDER_FRAME_DROPPER "che.video.enable_video_sender_frame_dropper"
203 #define CONFIGURABLE_KEY_RTC_VIDEO_QUALITY_SCALE_ONLY_ON_AVERAGE_QP KEY_RTC_VIDEO_QUALITY_SCALE_ONLY_ON_AVERAGE_QP
204 #define CONFIGURABLE_KEY_RTC_VIDEO_H264_QP_THRESHOLD_LOW KEY_RTC_VIDEO_H264_QP_THRESHOLD_LOW
205 #define CONFIGURABLE_KEY_RTC_VIDEO_H264_QP_THRESHOLD_HIGH KEY_RTC_VIDEO_H264_QP_THRESHOLD_HIGH
206 #define KEY_RTC_VIDEO_RATE_CONTROL_MODE "che.video.rate_control_mode"
207 #define INTERNAL_KEY_RTC_PRIMARY_FORCED_USING_SCREEN_CAPTURE "rtc.primary_screen.forced_using_screen_capture"
208 #define INTERNAL_KEY_RTC_SECONDARY_FORCED_USING_SCREEN_CAPTURE "rtc.secondary_screen.forced_using_screen_capture"
209 #define INTERNAL_KEY_RTC_DESENSITISE_IP "rtc.desensitize.Ip"
210 #define CONFIGURABLE_KEY_RTC_NEW_VOS INTERNAL_KEY_RTC_NEW_VOS
220 UNSIGNED_INTEGER = 1,
228 unsigned int val_uint;
231 const char* val_cstr;
232 const void* val_cjson;
238 static const config::AnyValue::Type AnyValueType = config::AnyValue::UNSPEC;
242 static const config::AnyValue::Type AnyValueType = config::AnyValue::INTEGER;
243 static int getValue(
const AnyValue& value) {
return value.val_int; }
244 static void setValue(
int from,
AnyValue& to) {
245 to.type = AnyValueType;
251 static const config::AnyValue::Type AnyValueType =
252 config::AnyValue::UNSIGNED_INTEGER;
253 static unsigned int getValue(
const AnyValue& value) {
return value.val_uint; }
254 static void setValue(
unsigned int from,
AnyValue& to) {
255 to.type = AnyValueType;
261 static const config::AnyValue::Type AnyValueType =
262 config::AnyValue::UNSIGNED_INTEGER;
263 static uint16_t getValue(
const AnyValue& value) {
return value.val_uint; }
264 static void setValue(uint16_t from,
AnyValue& to) {
265 to.type = AnyValueType;
271 static const config::AnyValue::Type AnyValueType = config::AnyValue::DOUBLE;
272 static double getValue(
const AnyValue& value) {
return value.val_double; }
273 static void setValue(
double from,
AnyValue& to) {
274 to.type = AnyValueType;
275 to.val_double = from;
280 static const config::AnyValue::Type AnyValueType = config::AnyValue::BOOLEAN;
281 static bool getValue(
const AnyValue& value) {
return value.val_bool; }
282 static void setValue(
bool from,
AnyValue& to) {
283 to.type = AnyValueType;
289 static const config::AnyValue::Type AnyValueType = config::AnyValue::CSTR;
290 static std::string getValue(
const AnyValue& value) {
return value.val_cstr; }
291 static void setValue(
const std::string& from,
AnyValue& to) {
292 to.type = AnyValueType;
293 to.val_cstr = from.c_str();
298 static const config::AnyValue::Type AnyValueType = config::AnyValue::CSTR;
299 static const char* getValue(
const AnyValue& value) {
return value.val_cstr; }
300 static void setValue(
const char* from,
AnyValue& to) {
301 to.type = AnyValueType;
308 static const config::AnyValue::Type AnyValueType = config::AnyValue::JSON;
309 static const void* getValue(
const AnyValue& value) {
return value.val_cjson; }
310 static void setValue(
const void* from,
AnyValue& to) {
311 to.type = AnyValueType;
318 virtual bool toUserId(
unsigned int uid, std::string& userId)
const = 0;
319 virtual bool toInternalUid(
const char* userId,
unsigned int& uid)
const = 0;
320 virtual bool hasUser(
unsigned int uid)
const = 0;
321 virtual bool hasUser(
const char* userId)
const = 0;
327 virtual bool onSetValue(
const AnyValue& value) = 0;
328 virtual bool onGetValue(
AnyValue& value) {
return false; }
333 virtual bool onSetValue(
const AnyValue& value) = 0;
334 virtual bool onGetValue(
AnyValue& value) {
return false; }
340 virtual void release() = 0;
341 virtual bool getValue(
AnyValue& value)
const = 0;
342 virtual bool setValue(
346 virtual bool getOriginalValue(
AnyValue& value)
const = 0;
347 virtual bool setOriginalValue(
const AnyValue& value) = 0;
348 virtual bool connectExternalObserver(
IObserver* observer,
349 bool triggerOnConnect) = 0;
350 virtual bool disconnectExternalObserver() = 0;
351 virtual bool connectExternalFilter(
IFilter* filter,
352 bool triggerOnConnect) = 0;
353 virtual bool disconnectExternalFilter() = 0;
359 virtual void release() = 0;
365 enum PARAMETER_TYPE {
367 HAS_EXTERNAL_FILTER = 1,
368 HAS_EXTERNAL_OBSERVER = 2,
369 HAS_EXTERNAL_TRIGGER = 3,
370 HAS_ORIGINAL_VALUE = 4,
372 virtual IParameter* createParameter(
const char* key, AnyValue::Type valueType,
373 PARAMETER_TYPE paramType) = 0;
374 virtual IParameter* getParameter(
const char* key) = 0;
375 virtual int setParameters(
const char* parameters) = 0;
383 const T& value()
const {
return value_; }
384 bool setValue(
const T& value) {
400 AnyValue::Type valueType,
401 IConfigEngine::PARAMETER_TYPE paramType)
402 : parameter_(engine.createParameter(key, valueType, paramType)) {}
404 if (parameter_) parameter_->release();
406 operator bool() {
return parameter_ !=
nullptr; }
417 AnyValue::Type valueType =
419 IConfigEngine::PARAMETER_TYPE paramType = IConfigEngine::VALUE_ONLY)
421 setValue(defValue,
true);
425 if (parameter_ && parameter_->getValue(val)) {
430 bool setValue(
const AnyValue& value,
bool storeValue =
true) {
432 return parameter_->setValue(value, storeValue);
436 bool setValue(T value,
bool storeValue =
true) {
439 return setValue(v, storeValue);
449 AnyValue::Type valueType =
451 IConfigEngine::PARAMETER_TYPE paramType = IConfigEngine::VALUE_ONLY)
454 setOriginalValue(defValue);
456 bool getOriginalValue(T& v)
const {
458 if (this->parameter_ && this->parameter_->getOriginalValue(val)) {
466 bool setOriginalValue(
const T& value) {
467 if (this->parameter_) {
470 return this->parameter_->setOriginalValue(v);
479 void disconnectAll() {
480 for (
auto& param : parameters_) {
481 param->disconnectExternalObserver();
482 param->disconnectExternalFilter();
487 if (param) parameters_.insert(param);
491 std::unordered_set<IParameter*> parameters_;
497 typedef std::function<int(
const T&)> setter_type;
498 typedef std::function<int(T&)> getter_type;
503 AnyValue::Type valueType =
506 IConfigEngine::HAS_EXTERNAL_OBSERVER) {}
508 getter_type&& getter =
nullptr,
bool triggerOnConnect =
false) {
509 if (this->parameter_) {
510 this->setter_ = std::move(setter);
511 this->getter_ = std::move(getter);
512 if (om) om->addParameter(this->parameter_);
513 return this->parameter_->connectExternalObserver(
this, triggerOnConnect);
517 virtual bool onSetValue(
const AnyValue& value)
override {
519 return this->setter_(
524 virtual bool onGetValue(
AnyValue& value)
override {
527 if (this->getter_(tmp) == 0) {
543 typedef std::function<int(
const T&)> setter_type;
544 typedef std::function<int(T&)> getter_type;
549 AnyValue::Type valueType =
552 IConfigEngine::HAS_EXTERNAL_FILTER) {}
554 getter_type&& getter =
nullptr,
bool triggerOnConnect =
false) {
555 if (this->parameter_) {
556 this->setter_ = std::move(setter);
557 this->getter_ = std::move(getter);
558 if (om) om->addParameter(this->parameter_);
559 return this->parameter_->connectExternalFilter(
this, triggerOnConnect);
563 virtual bool onSetValue(
const AnyValue& value)
override {
564 return this->setter_ &&
568 virtual bool onGetValue(
AnyValue& value)
override {
571 if (this->getter_(tmp) == 0) {
588 typedef std::function<int(
const T&)> setter_type;
589 typedef std::function<int(T&)> getter_type;
594 AnyValue::Type valueType =
597 IConfigEngine::HAS_EXTERNAL_TRIGGER) {}
599 getter_type&& getter =
nullptr,
bool triggerOnConnect =
false) {
600 if (this->parameter_) {
601 this->setter_ = std::move(setter);
602 this->getter_ = std::move(getter);
603 if (om) om->addParameter(this->parameter_);
604 return this->parameter_->connectExternalObserver(
this, triggerOnConnect);
608 virtual bool onSetValue(
const AnyValue& value)
override {
610 return this->setter_(
615 virtual bool onGetValue(
AnyValue& value)
override {
618 if (this->getter_(tmp) == 0) {
631 enum CONFIG_POLICY_TYPE{
632 CONFIG_POLICY_CDS = 0x1,
633 CONFIG_POLICY_TDS = 0x2,
634 CONFIG_POLICY_ALL = CONFIG_POLICY_CDS|CONFIG_POLICY_TDS