2018-01-29 21:49:49 -05:00
|
|
|
//
|
|
|
|
// DynamicMachine.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 29/01/2018.
|
2018-05-13 15:19:52 -04:00
|
|
|
// Copyright 2018 Thomas Harte. All rights reserved.
|
2018-01-29 21:49:49 -05:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef DynamicMachine_h
|
|
|
|
#define DynamicMachine_h
|
|
|
|
|
|
|
|
#include "../Configurable/Configurable.hpp"
|
2018-05-10 21:54:10 -04:00
|
|
|
#include "../Activity/Source.hpp"
|
2018-07-10 21:32:28 -04:00
|
|
|
#include "MediaTarget.hpp"
|
2018-01-29 21:49:49 -05:00
|
|
|
#include "CRTMachine.hpp"
|
|
|
|
#include "JoystickMachine.hpp"
|
|
|
|
#include "KeyboardMachine.hpp"
|
|
|
|
#include "Utility/Typer.hpp"
|
|
|
|
|
|
|
|
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 ~DynamicMachine() {}
|
2018-05-07 21:57:54 -04:00
|
|
|
|
2018-05-10 21:54:10 -04:00
|
|
|
virtual Activity::Source *activity_source() = 0;
|
2018-07-10 21:32:28 -04:00
|
|
|
virtual Configurable::Device *configurable_device() = 0;
|
2018-01-29 21:49:49 -05:00
|
|
|
virtual CRTMachine::Machine *crt_machine() = 0;
|
|
|
|
virtual JoystickMachine::Machine *joystick_machine() = 0;
|
|
|
|
virtual KeyboardMachine::Machine *keyboard_machine() = 0;
|
2018-07-10 21:32:28 -04:00
|
|
|
virtual MediaTarget::Machine *media_target() = 0;
|
2018-02-12 21:46:21 -05:00
|
|
|
|
|
|
|
/*!
|
|
|
|
Provides a raw pointer to the underlying machine if and only if this dynamic machine really is
|
|
|
|
only a single machine.
|
|
|
|
|
|
|
|
Very unsafe. Very temporary.
|
|
|
|
|
|
|
|
TODO: eliminate in favour of introspection for machine-specific inputs. This is here temporarily
|
|
|
|
only to permit continuity of certain features in the Mac port that have not yet made their way
|
|
|
|
to the SDL/console port.
|
|
|
|
*/
|
|
|
|
virtual void *raw_pointer() = 0;
|
2018-01-29 21:49:49 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* DynamicMachine_h */
|