2018-01-29 03:22:21 +00:00
|
|
|
//
|
|
|
|
// MultiMachine.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 28/01/2018.
|
|
|
|
// Copyright © 2018 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef MultiMachine_hpp
|
|
|
|
#define MultiMachine_hpp
|
|
|
|
|
2018-01-30 02:49:49 +00:00
|
|
|
#include "../../../Machines/DynamicMachine.hpp"
|
|
|
|
|
|
|
|
#include "Implementation/MultiConfigurationTarget.hpp"
|
2018-01-31 03:23:06 +00:00
|
|
|
#include "Implementation/MultiCRTMachine.hpp"
|
2018-01-29 03:22:21 +00:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace Analyser {
|
|
|
|
namespace Dynamic {
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Provides the same interface as to a single machine, while multiplexing all
|
|
|
|
underlying calls to an array of real dynamic machines.
|
|
|
|
|
|
|
|
Calls to crt_machine->get_crt will return that for the first machine.
|
|
|
|
|
|
|
|
Following each crt_machine->run_for, reorders the supplied machines by
|
|
|
|
confidence.
|
|
|
|
|
|
|
|
If confidence for any machine becomes disproportionately low compared to
|
|
|
|
the others in the set, that machine is removed from the array.
|
|
|
|
*/
|
2018-02-01 12:53:52 +00:00
|
|
|
class MultiMachine: public ::Machine::DynamicMachine, public MultiCRTMachine::Delegate {
|
2018-01-29 03:22:21 +00:00
|
|
|
public:
|
|
|
|
MultiMachine(std::vector<std::unique_ptr<DynamicMachine>> &&machines);
|
|
|
|
|
|
|
|
ConfigurationTarget::Machine *configuration_target() override;
|
|
|
|
CRTMachine::Machine *crt_machine() override;
|
|
|
|
JoystickMachine::Machine *joystick_machine() override;
|
|
|
|
KeyboardMachine::Machine *keyboard_machine() override;
|
|
|
|
Configurable::Device *configurable_device() override;
|
|
|
|
Utility::TypeRecipient *type_recipient() override;
|
|
|
|
|
2018-02-01 12:53:52 +00:00
|
|
|
void multi_crt_did_run_machines() override;
|
|
|
|
|
2018-01-29 03:22:21 +00:00
|
|
|
private:
|
|
|
|
std::vector<std::unique_ptr<DynamicMachine>> machines_;
|
2018-01-30 02:49:49 +00:00
|
|
|
|
|
|
|
MultiConfigurationTarget configuration_target_;
|
2018-01-31 03:23:06 +00:00
|
|
|
MultiCRTMachine crt_machine_;
|
2018-01-29 03:22:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* MultiMachine_hpp */
|