2017-11-05 17:49:28 +00:00
|
|
|
//
|
|
|
|
// MachineForTarget.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 04/11/2017.
|
|
|
|
// Copyright © 2017 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef MachineForTarget_hpp
|
|
|
|
#define MachineForTarget_hpp
|
|
|
|
|
|
|
|
#include "../../StaticAnalyser/StaticAnalyser.hpp"
|
|
|
|
|
2017-11-18 04:02:00 +00:00
|
|
|
#include "../../Configurable/Configurable.hpp"
|
2017-11-05 17:49:28 +00:00
|
|
|
#include "../ConfigurationTarget.hpp"
|
|
|
|
#include "../CRTMachine.hpp"
|
|
|
|
#include "../JoystickMachine.hpp"
|
|
|
|
#include "../KeyboardMachine.hpp"
|
2017-11-22 02:44:29 +00:00
|
|
|
#include "Typer.hpp"
|
2017-11-05 17:49:28 +00:00
|
|
|
|
2017-11-21 02:55:32 +00:00
|
|
|
#include <map>
|
2017-11-06 01:12:01 +00:00
|
|
|
#include <string>
|
|
|
|
|
2017-11-05 17:49:28 +00:00
|
|
|
namespace Machine {
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Provides the structure for owning a machine and dynamically casting it as desired without knowledge of
|
|
|
|
the machine's parent class or, therefore, the need to establish a common one.
|
|
|
|
*/
|
|
|
|
struct DynamicMachine {
|
|
|
|
virtual ConfigurationTarget::Machine *configuration_target() = 0;
|
|
|
|
virtual CRTMachine::Machine *crt_machine() = 0;
|
|
|
|
virtual JoystickMachine::Machine *joystick_machine() = 0;
|
|
|
|
virtual KeyboardMachine::Machine *keyboard_machine() = 0;
|
2017-11-18 04:02:00 +00:00
|
|
|
virtual Configurable::Device *configurable_device() = 0;
|
2017-11-22 02:44:29 +00:00
|
|
|
virtual Utility::TypeRecipient *type_recipient() = 0;
|
2017-11-05 17:49:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Allocates an instance of DynamicMachine holding a machine that can
|
|
|
|
receive the supplied target. The machine has been allocated on the heap.
|
|
|
|
It is the caller's responsibility to delete the class when finished.
|
|
|
|
*/
|
|
|
|
DynamicMachine *MachineForTarget(const StaticAnalyser::Target &target);
|
|
|
|
|
2017-11-06 01:12:01 +00:00
|
|
|
/*!
|
|
|
|
Returns a short string name for the machine identified by the target,
|
|
|
|
which is guaranteed not to have any spaces or other potentially
|
|
|
|
filesystem-bothering contents.
|
|
|
|
*/
|
2017-11-21 02:55:32 +00:00
|
|
|
std::string ShortNameForTargetMachine(const StaticAnalyser::Target::Machine target);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Returns a long string name for the machine identified by the target,
|
|
|
|
usable for presentation to a human.
|
|
|
|
*/
|
|
|
|
std::string LongNameForTargetMachine(const StaticAnalyser::Target::Machine target);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Returns a map from machine name to the list of options that machine
|
|
|
|
exposes, for all machines.
|
|
|
|
*/
|
|
|
|
std::map<std::string, std::vector<std::unique_ptr<Configurable::Option>>> AllOptionsByMachineName();
|
2017-11-06 01:12:01 +00:00
|
|
|
|
2017-11-05 17:49:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* MachineForTarget_hpp */
|