C++ Server-Side SDK
LaunchDarkly SDK
Public Member Functions | List of all members
launchdarkly::server_side::hooks::EvaluationSeriesDataBuilder Class Reference

#include <hook.hpp>

Public Member Functions

 EvaluationSeriesDataBuilder (EvaluationSeriesData const &data)
 
 EvaluationSeriesDataBuilder ()
 
EvaluationSeriesDataBuilderSet (std::string key, Value value)
 
EvaluationSeriesDataBuilderSetShared (std::string key, std::shared_ptr< std::any > value)
 
EvaluationSeriesData Build () const
 

Detailed Description

Builder for creating evaluation series data. Allows hook stages to add data to be passed to subsequent stages.

Constructor & Destructor Documentation

◆ EvaluationSeriesDataBuilder() [1/2]

launchdarkly::server_side::hooks::EvaluationSeriesDataBuilder::EvaluationSeriesDataBuilder ( EvaluationSeriesData const &  data)
explicit

Creates a new builder from existing data.

Parameters
dataThe existing data to copy.

◆ EvaluationSeriesDataBuilder() [2/2]

launchdarkly::server_side::hooks::EvaluationSeriesDataBuilder::EvaluationSeriesDataBuilder ( )
default

Creates a new empty builder.

Member Function Documentation

◆ Build()

EvaluationSeriesData launchdarkly::server_side::hooks::EvaluationSeriesDataBuilder::Build ( ) const

Builds the immutable series data.

Returns
The built data.

◆ Set()

EvaluationSeriesDataBuilder & launchdarkly::server_side::hooks::EvaluationSeriesDataBuilder::Set ( std::string  key,
Value  value 
)

Sets a Value in the series data.

Parameters
keyThe key to set.
valueThe value to associate with the key.
Returns
Reference to this builder for chaining.

◆ SetShared()

EvaluationSeriesDataBuilder & launchdarkly::server_side::hooks::EvaluationSeriesDataBuilder::SetShared ( std::string  key,
std::shared_ptr< std::any >  value 
)

Sets a shared_ptr to any type in the series data.

Use this for storing arbitrary objects like OpenTelemetry spans that need to be passed from beforeEvaluation to afterEvaluation.

Example:

auto span = std::make_shared<std::any>(MySpan{});
builder.SetShared("span", span);
Parameters
keyThe key to set.
valueThe shared_ptr to associate with the key.
Returns
Reference to this builder for chaining.

The documentation for this class was generated from the following files: