openMSX
|
Represents something you can plug devices into. More...
#include <Connector.hh>
Public Member Functions | |
Connector (const Connector &)=delete | |
Connector & | operator= (const Connector &)=delete |
const std::string & | getName () const |
Name that identifies this connector. More... | |
virtual std::string_view | getDescription () const =0 |
Get a description for this connector. More... | |
virtual std::string_view | getClass () const =0 |
A Connector belong to a certain class. More... | |
virtual void | plug (Pluggable &device, EmuTime::param time) |
This plugs a Pluggable in this Connector. More... | |
virtual void | unplug (EmuTime::param time) |
This unplugs the currently inserted Pluggable from this Connector. More... | |
Pluggable & | getPlugged () const |
Returns the Pluggable currently plugged in. More... | |
PluggingController & | getPluggingController () const |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Protected Member Functions | |
Connector (PluggingController &pluggingController, std::string name, std::unique_ptr< Pluggable > dummy) | |
Creates a new Connector. More... | |
~Connector () | |
Represents something you can plug devices into.
Examples are a joystick port, a printer port, a MIDI port etc. When there is not an actual Pluggable plugged in, a dummy Pluggable is used.
Definition at line 20 of file Connector.hh.
|
delete |
|
protected |
Creates a new Connector.
pluggingController | PluggingController. |
name | Name that identifies this connector. |
dummy | Dummy Pluggable whose class matches this Connector. |
Definition at line 10 of file Connector.cc.
References openmsx::PluggingController::registerConnector().
|
protected |
Definition at line 20 of file Connector.cc.
References openmsx::PluggingController::unregisterConnector().
|
pure virtual |
A Connector belong to a certain class.
Only Pluggables of this class can be plugged in this Connector.
Implemented in openmsx::MidiInConnector, openmsx::MidiOutConnector, openmsx::RS232Connector, openmsx::AudioInputConnector, openmsx::Y8950KeyboardConnector, openmsx::CassettePort, openmsx::JoystickPort, openmsx::MSXPrinterPort, openmsx::SVIPrinterPort, and openmsx::YamahaSKW01PrinterPort.
Referenced by openmsx::Pluggable::plug().
|
pure virtual |
Get a description for this connector.
Implemented in openmsx::MidiInConnector, openmsx::MidiOutConnector, openmsx::RS232Connector, openmsx::AudioInputConnector, openmsx::Y8950KeyboardConnector, openmsx::CassettePort, openmsx::JoystickPort, openmsx::MSXPrinterPort, openmsx::SVIPrinterPort, and openmsx::YamahaSKW01PrinterPort.
|
inline |
Name that identifies this connector.
Definition at line 29 of file Connector.hh.
Referenced by openmsx::PluggingController::findConnector(), openmsx::Pluggable::plug(), openmsx::PluggingController::registerConnector(), and openmsx::PluggingController::unregisterConnector().
|
inline |
Returns the Pluggable currently plugged in.
Definition at line 59 of file Connector.hh.
Referenced by openmsx::AudioInputConnector::getPluggedAudioDev(), openmsx::JoystickPort::getPluggedJoyDev(), openmsx::Y8950KeyboardConnector::getPluggedKeyb(), openmsx::MidiInConnector::getPluggedMidiInDev(), openmsx::MidiOutConnector::getPluggedMidiOutDev(), openmsx::SVIPrinterPort::getPluggedPrintDev(), and openmsx::RS232Connector::getPluggedRS232Dev().
|
inline |
Definition at line 61 of file Connector.hh.
Referenced by openmsx::CassettePort::CassettePort(), and openmsx::JoystickPort::serialize().
|
virtual |
This plugs a Pluggable in this Connector.
The default implementation is ok.
PlugException |
Reimplemented in openmsx::MSXPrinterPort, openmsx::Y8950KeyboardConnector, openmsx::SVIPrinterPort, openmsx::YamahaSKW01PrinterPort, and openmsx::JoystickPort.
Definition at line 25 of file Connector.cc.
References openmsx::Pluggable::plug().
Referenced by openmsx::MSXPrinterPort::plug(), openmsx::Y8950KeyboardConnector::plug(), openmsx::SVIPrinterPort::plug(), openmsx::YamahaSKW01PrinterPort::plug(), and openmsx::JoystickPort::plug().
void openmsx::Connector::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 38 of file Connector.cc.
References Math::e, openmsx::PluggingController::findPluggable(), openmsx::PluggingController::getCliComm(), openmsx::Pluggable::getName(), openmsx::CliComm::printWarning(), and openmsx::Pluggable::setConnector().
|
virtual |
This unplugs the currently inserted Pluggable from this Connector.
It is replaced by the dummy Pluggable provided by the concrete Connector subclass.
Reimplemented in openmsx::CassettePort.
Definition at line 31 of file Connector.cc.
References openmsx::Pluggable::unplug().
Referenced by openmsx::CassettePort::unplug(), and openmsx::PluggingController::unregisterConnector().