|
C++ Server-Side SDK
LaunchDarkly SDK
|
Membership describes which Big Segments a single context belongs to, as reported by an IBigSegmentStore lookup. More...
#include <big_segment_store_types.hpp>
Public Member Functions | |
| std::optional< bool > | CheckMembership (std::string const &segment_ref) const |
| Returns the membership state for a single segment ref. More... | |
Static Public Member Functions | |
| static Membership | FromSegmentRefs (std::vector< std::string > const &included_segment_refs, std::vector< std::string > const &excluded_segment_refs) |
| Constructs a Membership from the lists of segment refs the context is included in / excluded from. More... | |
Membership describes which Big Segments a single context belongs to, as reported by an IBigSegmentStore lookup.
Implementations of IBigSegmentStore should construct a Membership using Membership::FromSegmentRefs and return it from IBigSegmentStore::GetMembership. The returned Membership is an immutable snapshot — once constructed it does not observe any later changes to the underlying store.
A "segment ref" is the string <segmentKey>.g<generation>; the SDK constructs that string when evaluating a flag and passes it to CheckMembership.
Implemented inline because integration libraries link against the server-sdk shared library, which only exports the C API — out-of-line symbols defined here would not be visible to consumers.
|
inline |
Returns the membership state for a single segment ref.
| segment_ref | The <segmentKey>.g<generation> ref to look up. |
true if the context is included, false if excluded, and std::nullopt if the segment ref has no entry in this membership.
|
inlinestatic |
Constructs a Membership from the lists of segment refs the context is included in / excluded from.
If the same segment ref appears in both lists, inclusion wins, matching the LaunchDarkly Big Segments spec.
| included_segment_refs | Segment refs the context is explicitly included in. |
| excluded_segment_refs | Segment refs the context is explicitly excluded from. |