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. More...
virtual const std::string getDescription () const =0
 Get a description for this connector. More...
virtual string_ref 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 )

Referenced by getPluggingController().

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

Referenced by getPluggingController().

Member Function Documentation

◆ getClass()

virtual string_ref 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

◆ getPlugged()

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

Returns the Pluggable currently plugged in.

Definition at line 59 of file Connector.hh.

◆ 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 getName(), openmsx::CassettePort::unplug(), and openmsx::PluggingController::unregisterConnector().

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