openMSX
Public Member Functions | Protected Member Functions | Friends | List of all members
openmsx::Pluggable Class Referenceabstract

#include <Pluggable.hh>

Inheritance diagram for openmsx::Pluggable:
Inheritance graph
[legend]

Public Member Functions

virtual ~Pluggable ()=default
 
virtual std::string_view getName () const
 Name used to identify this pluggable.
 
virtual std::string_view getClass () const =0
 A pluggable belongs to a certain class.
 
virtual std::string_view getDescription () const =0
 Description for this pluggable.
 
void plug (Connector &connector, EmuTime::param time)
 This method is called when this pluggable is inserted in a connector.
 
void unplug (EmuTime::param time)
 This method is called when this pluggable is removed from a connector.
 
ConnectorgetConnector () const
 Get the connector this Pluggable is plugged into.
 
bool isPluggedIn () const
 Returns true if this pluggable is currently plugged into a connector.
 

Protected Member Functions

 Pluggable ()
 
virtual void plugHelper (Connector &newConnector, EmuTime::param time)=0
 
virtual void unplugHelper (EmuTime::param time)=0
 
void setConnector (Connector *conn)
 

Friends

class Connector
 

Detailed Description

Definition at line 11 of file Pluggable.hh.

Constructor & Destructor Documentation

◆ ~Pluggable()

virtual openmsx::Pluggable::~Pluggable ( )
virtualdefault

◆ Pluggable()

openmsx::Pluggable::Pluggable ( )
protected

Definition at line 9 of file Pluggable.cc.

References setConnector().

Member Function Documentation

◆ getClass()

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

A pluggable belongs to a certain class.

A pluggable only fits in connectors of the same class.

Implemented in openmsx::CassetteDevice, openmsx::JoystickDevice, openmsx::PrinterPortDevice, openmsx::MidiInDevice, openmsx::MidiOutDevice, openmsx::RS232Device, openmsx::AudioInputDevice, and openmsx::Y8950KeyboardDevice.

Referenced by plug().

◆ getConnector()

Connector * openmsx::Pluggable::getConnector ( ) const
inline

◆ getDescription()

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

◆ getName()

std::string_view openmsx::Pluggable::getName ( ) const
virtual

◆ isPluggedIn()

bool openmsx::Pluggable::isPluggedIn ( ) const
inline

◆ plug()

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

This method is called when this pluggable is inserted in a connector.

Exceptions
PlugException

Definition at line 19 of file Pluggable.cc.

References openmsx::Connector::getClass(), getClass(), openmsx::Connector::getName(), getName(), plugHelper(), and setConnector().

Referenced by openmsx::Connector::plug().

◆ plugHelper()

virtual void openmsx::Pluggable::plugHelper ( Connector newConnector,
EmuTime::param  time 
)
protectedpure virtual

◆ setConnector()

void openmsx::Pluggable::setConnector ( Connector conn)
inlineprotected

◆ unplug()

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

This method is called when this pluggable is removed from a connector.

Definition at line 31 of file Pluggable.cc.

References setConnector(), unplugHelper(), and UNREACHABLE.

Referenced by openmsx::Connector::unplug().

◆ unplugHelper()

virtual void openmsx::Pluggable::unplugHelper ( EmuTime::param  time)
protectedpure virtual

Friends And Related Symbol Documentation

◆ Connector

friend class Connector
friend

Definition at line 57 of file Pluggable.hh.


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