openMSX
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
[legend]

Public Member Functions

 Connector (const Connector &)=delete
 
 Connector (Connector &&)=delete
 
Connectoroperator= (const Connector &)=delete
 
Connectoroperator= (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/3]

openmsx::Connector::Connector ( const Connector )
delete

◆ Connector() [2/3]

openmsx::Connector::Connector ( Connector &&  )
delete

◆ Connector() [3/3]

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

Creates a new Connector.

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

Definition at line 10 of file Connector.cc.

References openmsx::PluggingController::registerConnector().

◆ ~Connector()

openmsx::Connector::~Connector ( )
protected

Definition at line 20 of file Connector.cc.

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
inline

◆ getPlugged()

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

◆ getPluggingController()

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ plug()

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

◆ serialize()

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

◆ unplug()

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

This unplugs the currently inserted Pluggable from this Connector.

It is replaced by the dummy Pluggable provided by the concrete Connector subclass.

Definition at line 31 of file Connector.cc.

References openmsx::Pluggable::unplug().

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


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