7 #include <unordered_map>
9 #include <launchdarkly/context.hpp>
10 #include <launchdarkly/value.hpp>
12 #include <launchdarkly/client_side/data_source_status.hpp>
13 #include <launchdarkly/client_side/flag_notifier.hpp>
14 #include <launchdarkly/config/client.hpp>
15 #include <launchdarkly/data/evaluation_detail.hpp>
17 namespace launchdarkly::client_side {
90 [[nodiscard]]
virtual std::unordered_map<FlagKey, Value>
AllFlags()
104 virtual void Track(std::string event_name,
106 double metric_value) = 0;
124 virtual void Track(std::string event_name) = 0;
170 bool default_value) = 0;
181 std::string default_value) = 0;
193 std::string default_value) = 0;
204 double default_value) = 0;
216 double default_value) = 0;
237 int default_value) = 0;
259 Value default_value) = 0;
294 [[nodiscard]] std::unordered_map<FlagKey, Value>
AllFlags()
const override;
296 void Track(std::string event_name,
298 double metric_value)
override;
300 void Track(std::string event_name,
Value data)
override;
302 void Track(std::string event_name)
override;
311 bool default_value)
override;
314 std::string default_value)
override;
318 std::string default_value)
override;
324 double default_value)
override;
329 int default_value)
override;
334 Value default_value)
override;
344 [[nodiscard]]
static char const*
Version();
347 inline static char const*
const kVersion =
349 std::unique_ptr<IClient> client;
Definition: context.hpp:29
Definition: evaluation_detail.hpp:18
Definition: client.hpp:285
EvaluationDetail< Value > JsonVariationDetail(FlagKey const &key, Value default_value) override
Definition: client.cpp:86
flag_manager::IFlagNotifier & FlagNotifier() override
Definition: client.cpp:95
double DoubleVariation(FlagKey const &key, double default_value) override
Definition: client.cpp:64
EvaluationDetail< double > DoubleVariationDetail(FlagKey const &key, double default_value) override
Definition: client.cpp:68
bool BoolVariation(FlagKey const &key, bool default_value) override
Definition: client.cpp:44
EvaluationDetail< std::string > StringVariationDetail(FlagKey const &key, std::string default_value) override
Definition: client.cpp:58
std::future< bool > StartAsync() override
Definition: client.cpp:15
std::unordered_map< FlagKey, Value > AllFlags() const override
Definition: client.cpp:20
EvaluationDetail< int > IntVariationDetail(FlagKey const &key, int default_value) override
Definition: client.cpp:77
std::future< bool > IdentifyAsync(Context context) override
Definition: client.cpp:40
static char const * Version()
Definition: client.cpp:99
Value JsonVariation(FlagKey const &key, Value default_value) override
Definition: client.cpp:82
EvaluationDetail< bool > BoolVariationDetail(FlagKey const &key, bool default_value) override
Definition: client.cpp:48
std::string StringVariation(FlagKey const &key, std::string default_value) override
Definition: client.cpp:53
void FlushAsync() override
Definition: client.cpp:36
data_sources::IDataSourceStatusProvider & DataSourceStatus() override
Definition: client.cpp:91
void Track(std::string event_name, Value data, double metric_value) override
Definition: client.cpp:24
int IntVariation(FlagKey const &key, int default_value) override
Definition: client.cpp:73
bool Initialized() const override
Definition: client.cpp:11
Definition: client.hpp:26
virtual double DoubleVariation(FlagKey const &key, double default_value)=0
virtual Value JsonVariation(FlagKey const &key, Value default_value)=0
virtual EvaluationDetail< bool > BoolVariationDetail(FlagKey const &key, bool default_value)=0
virtual data_sources::IDataSourceStatusProvider & DataSourceStatus()=0
virtual void Track(std::string event_name)=0
virtual void Track(std::string event_name, Value data, double metric_value)=0
virtual EvaluationDetail< double > DoubleVariationDetail(FlagKey const &key, double default_value)=0
virtual std::unordered_map< FlagKey, Value > AllFlags() const =0
virtual std::string StringVariation(FlagKey const &key, std::string default_value)=0
virtual flag_manager::IFlagNotifier & FlagNotifier()=0
virtual int IntVariation(FlagKey const &key, int default_value)=0
virtual EvaluationDetail< Value > JsonVariationDetail(FlagKey const &key, Value default_value)=0
virtual bool Initialized() const =0
virtual EvaluationDetail< int > IntVariationDetail(FlagKey const &key, int default_value)=0
virtual bool BoolVariation(FlagKey const &key, bool default_value)=0
virtual std::future< bool > StartAsync()=0
virtual void FlushAsync()=0
virtual std::future< bool > IdentifyAsync(Context context)=0
virtual void Track(std::string event_name, Value data)=0
std::string FlagKey
Definition: client.hpp:31
virtual EvaluationDetail< std::string > StringVariationDetail(FlagKey const &key, std::string default_value)=0
Definition: data_source_status.hpp:83
Definition: flag_notifier.hpp:18
Definition: config.hpp:20