C++ Server-Side SDK
LaunchDarkly SDK
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
launchdarkly::server_side::data_components::ChangeNotifier Class Referencefinal
Inheritance diagram for launchdarkly::server_side::data_components::ChangeNotifier:
Inheritance graph
[legend]
Collaboration diagram for launchdarkly::server_side::data_components::ChangeNotifier:
Collaboration graph
[legend]

Public Types

template<typename Storage >
using Collection = data_model::SDKDataSet::Collection< std::string, Storage >
 
template<typename Storage >
using SharedItem = std::shared_ptr< data_model::ItemDescriptor< Storage > >
 
template<typename Storage >
using SharedCollection = std::unordered_map< std::string, SharedItem< Storage > >
 
- Public Types inherited from launchdarkly::server_side::IChangeNotifier
using ChangeSet = std::set< std::string >
 
using ChangeHandler = std::function< void(std::shared_ptr< ChangeSet >)>
 

Public Member Functions

 ChangeNotifier (IDestination &sink, data_interfaces::IStore const &source)
 
std::unique_ptr< IConnectionOnFlagChange (ChangeHandler handler) override
 
void Init (data_model::SDKDataSet data_set) override
 Initialize the destination with a base set of data.
 
void Upsert (std::string const &key, data_model::FlagDescriptor flag) override
 Upsert a flag named by key.
 
void Upsert (std::string const &key, data_model::SegmentDescriptor segment) override
 Upsert a segment named by key.
 
std::string const & Identity () const override
 
 ChangeNotifier (ChangeNotifier const &item)=delete
 
 ChangeNotifier (ChangeNotifier &&item)=delete
 
ChangeNotifieroperator= (ChangeNotifier const &)=delete
 
ChangeNotifieroperator= (ChangeNotifier &&)=delete
 
- Public Member Functions inherited from launchdarkly::server_side::data_interfaces::IDestination
 IDestination (IDestination const &item)=delete
 
 IDestination (IDestination &&item)=delete
 
IDestinationoperator= (IDestination const &)=delete
 
IDestinationoperator= (IDestination &&)=delete
 
- Public Member Functions inherited from launchdarkly::server_side::IChangeNotifier
 IChangeNotifier (IChangeNotifier const &item)=delete
 
 IChangeNotifier (IChangeNotifier &&item)=delete
 
IChangeNotifieroperator= (IChangeNotifier const &)=delete
 
IChangeNotifieroperator= (IChangeNotifier &&)=delete
 

Member Function Documentation

◆ Identity()

std::string const & launchdarkly::server_side::data_components::ChangeNotifier::Identity ( ) const
overridevirtual
Returns
Identity of the destination. Used in logs.

Implements launchdarkly::server_side::data_interfaces::IDestination.

◆ Init()

void launchdarkly::server_side::data_components::ChangeNotifier::Init ( data_model::SDKDataSet  data_set)
overridevirtual

Initialize the destination with a base set of data.

Parameters
data_setThe initial data received by the SDK.

Implements launchdarkly::server_side::data_interfaces::IDestination.

◆ OnFlagChange()

std::unique_ptr< IConnection > launchdarkly::server_side::data_components::ChangeNotifier::OnFlagChange ( ChangeHandler  handler)
overridevirtual

Listen for changes to flag configuration. The change handler will be called with a set of affected flag keys. Changes include flags whose dependencies (either other flags, or segments) changed.

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

Implements launchdarkly::server_side::IChangeNotifier.

◆ Upsert() [1/2]

void launchdarkly::server_side::data_components::ChangeNotifier::Upsert ( std::string const &  key,
data_model::FlagDescriptor  flag 
)
overridevirtual

Upsert a flag named by key.

Parameters
keyFlag key.
flagFlag descriptor.

Implements launchdarkly::server_side::data_interfaces::IDestination.

◆ Upsert() [2/2]

void launchdarkly::server_side::data_components::ChangeNotifier::Upsert ( std::string const &  key,
data_model::SegmentDescriptor  segment 
)
overridevirtual

Upsert a segment named by key.

Parameters
keySegment key.
segmentSegment descriptor.

Implements launchdarkly::server_side::data_interfaces::IDestination.


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