|
C++ Server-Side SDK
LaunchDarkly SDK
|
#include <hook.hpp>
Public Member Functions | |
| EvaluationSeriesContext (std::string flag_key, Context const &context, Value default_value, std::string method, HookContext const &hook_context, std::optional< std::string > environment_id) | |
| std::string_view | FlagKey () const |
| Context const & | EvaluationContext () const |
| Value const & | DefaultValue () const |
| std::string_view | Method () const |
| std::optional< std::string_view > | EnvironmentId () const |
| HookContext const & | HookCtx () const |
Context for evaluation series stages. Provides readonly information about the evaluation being performed.
Lifetime: Objects of this type are valid only during the execution of a hook stage. Do not store references, pointers, or string_views from this context. If you need any data beyond the stage execution, copy it to owned types (e.g., std::string, Value).
| launchdarkly::server_side::hooks::EvaluationSeriesContext::EvaluationSeriesContext | ( | std::string | flag_key, |
| Context const & | context, | ||
| Value | default_value, | ||
| std::string | method, | ||
| HookContext const & | hook_context, | ||
| std::optional< std::string > | environment_id | ||
| ) |
Constructs an evaluation series context.
| flag_key | The flag key being evaluated. |
| context | The context against which the flag is being evaluated. |
| default_value | The default value for the evaluation. |
| method | The method being executed. |
| hook_context | Additional context data provided by the caller. |
| environment_id | Optional environment ID. |
| Value const & launchdarkly::server_side::hooks::EvaluationSeriesContext::DefaultValue | ( | ) | const |
Returns the default value provided to the variation method.
Lifetime: The returned Value reference is valid only during the execution of the current hook stage. If you need the value beyond this call, make a copy.
| std::optional< std::string_view > launchdarkly::server_side::hooks::EvaluationSeriesContext::EnvironmentId | ( | ) | const |
Returns the environment ID if available. Only available once initialization has completed.
Lifetime: If present, the returned string_view is valid only during the execution of the current hook stage. If you need the environment ID beyond this call, copy it to a std::string.
| Context const & launchdarkly::server_side::hooks::EvaluationSeriesContext::EvaluationContext | ( | ) | const |
Returns the context against which the flag is being evaluated.
Lifetime: The returned Context reference is valid only during the execution of the current hook stage. If you need context data beyond this call, copy the necessary fields.
| std::string_view launchdarkly::server_side::hooks::EvaluationSeriesContext::FlagKey | ( | ) | const |
Returns the flag key being evaluated.
Lifetime: The returned string_view is valid only during the execution of the current hook stage. If you need the flag key beyond this call, copy it to a std::string.
| HookContext const & launchdarkly::server_side::hooks::EvaluationSeriesContext::HookCtx | ( | ) | const |
Returns the hook context provided by the caller.
This contains arbitrary data that the caller wants to pass through to hooks, such as OpenTelemetry span parents.
Lifetime: The returned reference is valid only during the execution of the current hook stage.
| std::string_view launchdarkly::server_side::hooks::EvaluationSeriesContext::Method | ( | ) | const |
Returns the method being executed. Examples: "BoolVariation", "StringVariationDetail"
Lifetime: The returned string_view is valid only during the execution of the current hook stage. If you need the method name beyond this call, copy it to a std::string.