Public Member Functions | Protected Member Functions | List of all members
openmsx::Connector Class Referenceabstract

Represents something you can plug devices into. More...

#include <Connector.hh>

Inheritance diagram for openmsx::Connector:
Inheritance graph

Public Member Functions

 Connector (const Connector &)=delete
Connectoroperator= (const Connector &)=delete
const std::string & getName () const
 Name that identifies this connector.
virtual std::string_view getDescription () const =0
 Get a description for this connector.
virtual std::string_view getClass () const =0
 A Connector belong to a certain class.
virtual void plug (Pluggable &device, EmuTime::param time)
 This plugs a Pluggable in this Connector.
virtual void unplug (EmuTime::param time)
 This unplugs the currently inserted Pluggable from this Connector.
PluggablegetPlugged () const
 Returns the Pluggable currently plugged in.
PluggingControllergetPluggingController () 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.
 ~Connector ()

Detailed Description

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.

Constructor & Destructor Documentation

◆ Connector() [1/2]

openmsx::Connector::Connector ( const Connector )

◆ Connector() [2/2]

openmsx::Connector::Connector ( PluggingController pluggingController,
std::string  name,
std::unique_ptr< Pluggable dummy 

Creates a new Connector.

nameName that identifies this connector.
dummyDummy Pluggable whose class matches this Connector.

Definition at line 10 of file

References openmsx::PluggingController::registerConnector().

◆ ~Connector()

openmsx::Connector::~Connector ( )

Definition at line 20 of file

References openmsx::PluggingController::unregisterConnector().

Member Function Documentation

◆ getClass()

virtual std::string_view openmsx::Connector::getClass ( ) const
pure virtual

◆ getDescription()

virtual std::string_view openmsx::Connector::getDescription ( ) const
pure virtual

◆ getName()

const std::string & openmsx::Connector::getName ( ) const

◆ getPlugged()

Pluggable & openmsx::Connector::getPlugged ( ) const

◆ getPluggingController()

PluggingController & openmsx::Connector::getPluggingController ( ) const

◆ operator=()

Connector & openmsx::Connector::operator= ( const Connector )

◆ plug()

void openmsx::Connector::plug ( Pluggable device,
EmuTime::param  time 

◆ serialize()

template<typename Archive >
void openmsx::Connector::serialize ( Archive &  ar,
unsigned  version 

◆ unplug()

void openmsx::Connector::unplug ( EmuTime::param  time)

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

References openmsx::Pluggable::unplug().

Referenced by openmsx::CassettePort::unplug(), and openmsx::PluggingController::unregisterConnector().

The documentation for this class was generated from the following files: