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

#include <all_flags_state.hpp>

Classes

class  State
 

Public Types

enum class  Options : std::uint8_t { Default = 0 , IncludeReasons = (1 << 0) , DetailsOnlyForTrackedFlags = (1 << 1) , ClientSideOnly = (1 << 2) }
 

Public Member Functions

bool Valid () const
 
std::unordered_map< std::string, State > const & States () const
 
std::unordered_map< std::string, Value > const & Values () const
 
 AllFlagsState ()
 
 AllFlagsState (std::unordered_map< std::string, Value > evaluations, std::unordered_map< std::string, class State > flags_state)
 

Detailed Description

AllFlagsState is a snapshot of the state of multiple feature flags with regard to a specific evaluation context.

Serializing this object to JSON using boost::json::value_from will produce the appropriate data structure for bootstrapping the LaunchDarkly JavaScript client.

To do this, the header <launchdarkly/server_side/serialization/json_all_flags_state.hpp> must be included to make the appropriate tag_invoke implementations available to boost.

Member Enumeration Documentation

◆ Options

Enumerator
Default 

Default behavior.

IncludeReasons 

Include evaluation reasons in the state object. By default, they are not.

DetailsOnlyForTrackedFlags 

Include detailed flag metadata only for flags with event tracking or debugging turned on.

This reduces the size of the JSON data if you are passing the flag state to the front end.

ClientSideOnly 

Include only flags marked for use with the client-side SDK. By default, all flags are included.

Constructor & Destructor Documentation

◆ AllFlagsState() [1/2]

launchdarkly::server_side::AllFlagsState::AllFlagsState ( )

Constructs an invalid instance of AllFlagsState.

◆ AllFlagsState() [2/2]

launchdarkly::server_side::AllFlagsState::AllFlagsState ( std::unordered_map< std::string, Value evaluations,
std::unordered_map< std::string, class State flags_state 
)

Constructs a valid instance of AllFlagsState.

Parameters
evaluationsA map of evaluation results for each flag.
flags_stateA map of metadata for each flag.

Member Function Documentation

◆ States()

std::unordered_map< std::string, AllFlagsState::State > const & launchdarkly::server_side::AllFlagsState::States ( ) const
Returns
A map of metadata for each flag.

◆ Valid()

bool launchdarkly::server_side::AllFlagsState::Valid ( ) const
Returns
True if the call to AllFlagsState succeeded. False if there was an error, such as the data store being unavailable. When false, the other accessors will return empty maps.

◆ Values()

std::unordered_map< std::string, Value > const & launchdarkly::server_side::AllFlagsState::Values ( ) const
Returns
A map of evaluation results for each flag.

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