C++ Client-Side SDK
LaunchDarkly SDK
Public Types | Public Member Functions | List of all members
launchdarkly::client_side::flag_manager::IFlagNotifier Class Referenceabstract

#include <flag_notifier.hpp>

Inheritance diagram for launchdarkly::client_side::flag_manager::IFlagNotifier:
Inheritance graph
[legend]

Public Types

using ChangeHandler = std::function< void(std::shared_ptr< FlagValueChangeEvent >)>
 

Public Member Functions

virtual std::unique_ptr< IConnectionOnFlagChange (std::string const &key, ChangeHandler handler)=0
 
 IFlagNotifier (IFlagNotifier const &item)=delete
 
 IFlagNotifier (IFlagNotifier &&item)=delete
 
IFlagNotifieroperator= (IFlagNotifier const &)=delete
 
IFlagNotifieroperator= (IFlagNotifier &&)=delete
 

Detailed Description

Interface to allow listening for flag changes. Notification events should be distributed after the store has been updated. Meaning that the "new" value will correspond to the current value in the store, and the "old" value will be what the value was before the update.

Member Function Documentation

◆ OnFlagChange()

virtual std::unique_ptr<IConnection> launchdarkly::client_side::flag_manager::IFlagNotifier::OnFlagChange ( std::string const &  key,
ChangeHandler  handler 
)
pure virtual

Listen for changes for the specific flag.

Parameters
keyThe flag to listen to changes for.
signalThe handler for the changes.
Returns
A connection which can be used to stop listening.

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