C++ Client-Side SDK
LaunchDarkly SDK
evaluation_detail.h
Go to the documentation of this file.
1 
2 // NOLINTBEGIN modernize-use-using
3 
4 #pragma once
5 
7 #include <stddef.h>
8 
9 #ifdef __cplusplus
10 extern "C" { // only need to export C interface if
11 // used by C++ source code
12 #endif
13 
14 typedef struct _LDEvalDetail* LDEvalDetail;
15 typedef struct _LDEvalReason* LDEvalReason;
16 
17 enum LDEvalReason_Kind {
18  // The flag was off and therefore returned its configured off value.
19  LD_EVALREASON_OFF = 0,
20  // The flag was on but the context did not match any targets or rules.
21  LD_EVALREASON_FALLTHROUGH = 1,
22  // The context key was specifically targeted for this flag.
23  LD_EVALREASON_TARGET_MATCH = 2,
24  // The context matched one of the flag's rules.
25  LD_EVALREASON_RULE_MATCH = 3,
26  // The flag was considered off because it had at least one prerequisite
27  // flag that either was off or did not return the desired variation.
28  LD_EVALREASON_PREREQUISITE_FAILED = 4,
29  // The flag could not be evaluated, e.g. because it does not exist or
30  // due to an unexpected error.
31  LD_EVALREASON_ERROR = 5
32 };
33 
34 enum LDEvalReason_ErrorKind {
35  // The SDK was not yet fully initialized and cannot evaluate flags.
36  LD_EVALREASON_ERROR_CLIENT_NOT_READY = 0,
37  // The application did not pass valid context attributes to the SDK
38  // evaluation method.
39  LD_EVALREASON_ERROR_USER_NOT_SPECIFIED = 1,
40  // No flag existed with the specified flag key.
41  LD_EVALREASON_ERROR_FLAG_NOT_FOUND = 2,
42  // The application requested an evaluation result of one type but the
43  // resulting flag variation value was of a different type.
44  LD_EVALREASON_ERROR_WRONG_TYPE = 3,
45  // The flag had invalid properties.
46  LD_EVALREASON_ERROR_MALFORMED_FLAG = 4,
47  // An unexpected error happened that stopped evaluation.
48  LD_EVALREASON_ERROR_EXCEPTION = 5,
49 };
50 
55 LD_EXPORT(void)
56 LDEvalDetail_Free(LDEvalDetail detail);
57 
64 LD_EXPORT(bool)
65 LDEvalDetail_VariationIndex(LDEvalDetail detail, size_t* out_variation_index);
66 
75 LD_EXPORT(bool)
76 LDEvalDetail_Reason(LDEvalDetail detail, LDEvalReason* out_reason);
77 
83 LD_EXPORT(enum LDEvalReason_Kind)
84 LDEvalReason_Kind(LDEvalReason reason);
85 
94 LD_EXPORT(bool)
95 LDEvalReason_ErrorKind(LDEvalReason reason,
96  enum LDEvalReason_ErrorKind* out_error_kind);
97 
105 LD_EXPORT(bool)
106 LDEvalReason_InExperiment(LDEvalReason reason);
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 // NOLINTEND modernize-use-using
LDEvalDetail_Free(LDEvalDetail detail)
Definition: evaluation_detail.cpp:17
LDEvalDetail_Reason(LDEvalDetail detail, LDEvalReason *out_reason)
Definition: evaluation_detail.cpp:30
LDEvalReason_ErrorKind(LDEvalReason reason, enum LDEvalReason_ErrorKind *out_error_kind)
Definition: evaluation_detail.cpp:45
LDEvalReason_InExperiment(LDEvalReason reason)
Definition: evaluation_detail.cpp:54
LDEvalReason_Kind(LDEvalReason reason)
Definition: evaluation_detail.cpp:38
LDEvalDetail_VariationIndex(LDEvalDetail detail, size_t *out_variation_index)
Definition: evaluation_detail.cpp:22
Export macros for C bindings.