48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "ports/audio_engine.h"
|
|
#include "ports/alert_ringer.h"
|
|
#include "ports/connectivity_manager.h"
|
|
#include "ports/device_platform.h"
|
|
#include "ports/effect_sink.h"
|
|
#include "ports/friend_service.h"
|
|
#include "ports/ota_service.h"
|
|
#include "ports/provisioning_service.h"
|
|
#include "ports/power_service.h"
|
|
#include "ports/realtime_protocol.h"
|
|
|
|
namespace borla {
|
|
|
|
// Composition boundary between the pure state machine and concrete drivers.
|
|
// It intentionally contains no product decisions: every operation here must
|
|
// be the direct execution of an AppEffect already decided by ReduceState.
|
|
class EffectRouter final : public IEffectSink {
|
|
public:
|
|
EffectRouter(
|
|
IAudioEngine& audio,
|
|
IConnectivityManager& connectivity,
|
|
IRealtimeProtocol& realtime,
|
|
IDevicePlatform& platform,
|
|
IFriendService& friend_service,
|
|
IProvisioningService& provisioning,
|
|
IOtaService& ota,
|
|
IAlertRinger& alert_ringer,
|
|
IPowerService& power);
|
|
|
|
void Handle(const AppEffect& effect,
|
|
const RuntimeState& resulting_state) override;
|
|
|
|
private:
|
|
IAudioEngine& audio_;
|
|
IConnectivityManager& connectivity_;
|
|
IRealtimeProtocol& realtime_;
|
|
IDevicePlatform& platform_;
|
|
IFriendService& friend_service_;
|
|
IProvisioningService& provisioning_;
|
|
IOtaService& ota_;
|
|
IAlertRinger& alert_ringer_;
|
|
IPowerService& power_;
|
|
};
|
|
|
|
} // namespace borla
|