C++ Client-Side SDK
LaunchDarkly SDK
|
#include <context_index.hpp>
Classes | |
struct | IndexEntry |
Public Types | |
using | Index = std::vector< IndexEntry > |
Public Member Functions | |
ContextIndex (Index) | |
void | Notice (std::string id, std::chrono::time_point< std::chrono::system_clock > timestamp) |
Index const & | Entries () const |
std::vector< std::string > | Prune (std::size_t maxContexts) |
Used internally to track which contexts have flag data in the persistent store.
This exists because we can't assume that the persistent store mechanism has an "enumerate all the keys that exist under such-and-such prefix" capability, so we need a table of contents at a fixed location. The only information being tracked here is, for each flag data set that exists in storage,
void launchdarkly::client_side::flag_manager::ContextIndex::Notice | ( | std::string | id, |
std::chrono::time_point< std::chrono::system_clock > | timestamp | ||
) |
Indicate that a context was accessed. This will add it to the index if it was not already present. If it was present, then it will update the timestamp for the context.
id | The id of the context. |
timestamp | The time the context is noticed. |
std::vector< std::string > launchdarkly::client_side::flag_manager::ContextIndex::Prune | ( | std::size_t | maxContexts | ) |
Prune the index returning a list of the removed context keys
maxContexts | The maximum number of contexts to retain. |