C++ Server-Side SDK
LaunchDarkly SDK
|
#include <evaluation_reason.hpp>
Public Types | |
enum class | Kind { kOff = 0 , kFallthrough = 1 , kTargetMatch = 2 , kRuleMatch = 3 , kPrerequisiteFailed = 4 , kError = 5 } |
enum class | ErrorKind { kClientNotReady = 0 , kUserNotSpecified = 1 , kFlagNotFound = 2 , kWrongType = 3 , kMalformedFlag = 4 , kException = 5 } |
Public Member Functions | |
enum Kind const & | Kind () const |
std::optional< ErrorKind > | ErrorKind () const |
std::optional< std::size_t > | RuleIndex () const |
std::optional< std::string > | RuleId () const |
std::optional< std::string > | PrerequisiteKey () const |
bool | InExperiment () const |
std::optional< std::string > | BigSegmentStatus () const |
EvaluationReason (enum Kind kind, std::optional< enum ErrorKind > error_kind, std::optional< std::size_t > rule_index, std::optional< std::string > rule_id, std::optional< std::string > prerequisite_key, bool in_experiment, std::optional< std::string > big_segment_status) | |
EvaluationReason (enum ErrorKind error_kind) | |
Static Public Member Functions | |
static EvaluationReason | Off () |
static EvaluationReason | PrerequisiteFailed (std::string prerequisite_key) |
static EvaluationReason | TargetMatch () |
static EvaluationReason | Fallthrough (bool in_experiment) |
static EvaluationReason | RuleMatch (std::size_t rule_index, std::optional< std::string > rule_id, bool in_experiment) |
static EvaluationReason | MalformedFlag () |
Friends | |
std::ostream & | operator<< (std::ostream &out, Kind const &kind) |
std::ostream & | operator<< (std::ostream &out, ErrorKind const &kind) |
std::ostream & | operator<< (std::ostream &out, EvaluationReason const &reason) |
Describes the reason that a flag evaluation produced a particular value.
|
strong |
Do not change these values. They must remain stable for the C API.
|
strong |
Do not change these values. They must remain stable for the C API.
std::optional< std::string > launchdarkly::EvaluationReason::BigSegmentStatus | ( | ) | const |
Describes the validity of Big Segment information, if and only if the flag evaluation required querying at least one Big Segment.
"HEALTHY"
: The Big Segment query involved in the flag evaluation was successful, and the segment state is considered up to date."STALE"
: The Big Segment query involved in the flag evaluation was successful, but the segment state may not be up to date"NOT_CONFIGURED"
: Big Segments could not be queried for the flag evaluation because the SDK configuration did not include a Big Segment store."STORE_ERROR"
: The Big Segment query involved in the flag evaluation failed, for instance due to a database error. std::optional< enum EvaluationReason::ErrorKind > launchdarkly::EvaluationReason::ErrorKind | ( | ) | const |
A further description of the error condition, if the Kind was Kind::kError.
|
static |
The flag evaluated to its fallthrough value.
in_experiment | Whether the flag is part of an experiment. |
bool launchdarkly::EvaluationReason::InExperiment | ( | ) | const |
Whether the evaluation was part of an experiment.
This is true if the evaluation resulted in an experiment rollout and served one of the variations in the experiment. Otherwise it is false or undefined.
enum EvaluationReason::Kind const & launchdarkly::EvaluationReason::Kind | ( | ) | const |
|
static |
The flag data was malformed.
|
static |
The flag was off.
|
static |
The flag didn't return a variation due to a prerequisite failing.
std::optional< std::string > launchdarkly::EvaluationReason::PrerequisiteKey | ( | ) | const |
The key of the failed prerequisite flag, if the kind was "PREREQUISITE_FAILED"
.
std::optional< std::string > launchdarkly::EvaluationReason::RuleId | ( | ) | const |
The unique identifier of the matched rule, if the kind was "RULE_MATCH"
.
std::optional< std::size_t > launchdarkly::EvaluationReason::RuleIndex | ( | ) | const |
The index of the matched rule (0 for the first), if the kind was "RULE_MATCH"
.
|
static |
The flag evaluated to a particular variation because it matched a rule.
rule_index | Index of the rule. |
rule_id | ID of the rule. |
in_experiment | Whether the flag is part of an experiment. |
|
static |
The flag evaluated to a particular variation due to a target match.