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
 
Connectoroperator= (const Connector &)=delete
 
const std::string & getName () const
 Name that identifies this connector. More...
 
virtual const std::string getDescription () const =0
 Get a description for this connector. More...
 
virtual 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...
 
PluggablegetPlugged () const
 Returns the Pluggable currently plugged in. More...
 
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. More...
 
 ~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 )
delete

Referenced by getPluggingController().

◆ Connector() [2/2]

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().

Referenced by getPluggingController().

Member Function Documentation

◆ getClass()

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

◆ getDescription()

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

◆ getName()

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

◆ getPlugged()

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

Returns the Pluggable currently plugged in.

Definition at line 59 of file Connector.hh.

◆ getPluggingController()

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

◆ operator=()

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.

Reimplemented in openmsx::CassettePort.

Definition at line 31 of file Connector.cc.

References openmsx::Pluggable::unplug().

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


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