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 ()
 
virtual const std::string & getName () const
 Name used to identify this pluggable. More...
 
virtual string_ref getClass () const =0
 A pluggable belongs to a certain class. More...
 
virtual string_ref getDescription () const =0
 Description for this pluggable. More...
 
void plug (Connector &connector, EmuTime::param time)
 This method is called when this pluggable is inserted in a connector. More...
 
void unplug (EmuTime::param time)
 This method is called when this pluggable is removed from a conector. More...
 
ConnectorgetConnector () const
 Get the connector this Pluggable is plugged into. More...
 
bool isPluggedIn () const
 Returns true if this pluggable is currently plugged into a connector. More...
 

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

Definition at line 14 of file Pluggable.hh.

References getClass(), getDescription(), getName(), plug(), and unplug().

◆ Pluggable()

openmsx::Pluggable::Pluggable ( )
protected

Definition at line 11 of file Pluggable.cc.

References setConnector().

Referenced by isPluggedIn().

Member Function Documentation

◆ getClass()

virtual string_ref 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::PrinterPortDevice, openmsx::JoystickDevice, openmsx::Y8950KeyboardDevice, openmsx::CassetteDevice, openmsx::MidiOutDevice, openmsx::AudioInputDevice, openmsx::RS232Device, and openmsx::MidiInDevice.

Referenced by plug(), and ~Pluggable().

◆ getConnector()

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

◆ getDescription()

virtual string_ref openmsx::Pluggable::getDescription ( ) const
pure virtual

◆ getName()

const string & 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 22 of file Pluggable.cc.

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

Referenced by openmsx::Connector::plug(), and ~Pluggable().

◆ 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 conector.

Definition at line 34 of file Pluggable.cc.

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

Referenced by openmsx::Connector::unplug(), and ~Pluggable().

◆ unplugHelper()

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

Friends And Related Function 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: