Skip to content
API Documentation
BastionGuard™
LeakAggregator Class Reference

#include <LeakAggregator.hpp>

Public Member Functions

void addProvider (std::unique_ptr< ILeakProvider > provider)
std::vector< LeakRecord > queryAll (const std::string &email)

Private Attributes

std::vector< std::unique_ptr< ILeakProvider > > providers

Detailed Description

Definition at line 30 of file LeakAggregator.hpp.

Member Function Documentation

◆ addProvider()

void LeakAggregator::addProvider ( std::unique_ptr< ILeakProvider > provider)

Definition at line 24 of file LeakAggregator.cpp.

26{
27 providers.push_back(std::move(provider));
28}
std::vector< std::unique_ptr< ILeakProvider > > providers

References providers.

Referenced by LeakMonitor::loop(), and LeakCheckWorker::run().

◆ queryAll()

std::vector< LeakRecord > LeakAggregator::queryAll ( const std::string & email)

Definition at line 31 of file LeakAggregator.cpp.

32{
33 std::vector<LeakRecord> all;
34
35 for (auto& provider : providers) {
36 try {
37 auto res = provider->checkEmail(email);
38 all.insert(all.end(), res.begin(), res.end());
39 }
40 catch (const std::exception&) {
41 }
42 }
43
44 return LeakNormalizer::normalize(all);
45}
static std::vector< LeakRecord > normalize(const std::vector< LeakRecord > &input)

References LeakNormalizer::normalize(), and providers.

Referenced by LeakMonitor::loop(), and LeakCheckWorker::run().

Member Data Documentation

◆ providers

std::vector<std::unique_ptr<ILeakProvider> > LeakAggregator::providers
private

Definition at line 38 of file LeakAggregator.hpp.

Referenced by addProvider(), and queryAll().


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