openMSX
Public Member Functions | Protected Member Functions | List of all members
openmsx::Connector Class Reference

Represents something you can plug devices into. More...

#include <Connector.hh>

Inheritance diagram for openmsx::Connector:
Inheritance graph
[legend]
Collaboration diagram for openmsx::Connector:
Collaboration graph
[legend]

Public Member Functions

const std::string & getName () const
 Name that identifies this connector.
virtual const std::string getDescription () const =0
 Get a description for this connector.
virtual string_ref 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, string_ref name, std::unique_ptr< Pluggable > dummy)
 Creates a new Connector.
virtual ~Connector ()

Additional Inherited Members

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 21 of file Connector.hh.

Constructor & Destructor Documentation

openmsx::Connector::Connector ( PluggingController pluggingController,
string_ref  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 9 of file Connector.cc.

References openmsx::PluggingController::registerConnector().

openmsx::Connector::~Connector ( )
protectedvirtual

Definition at line 19 of file Connector.cc.

References openmsx::PluggingController::unregisterConnector().

Member Function Documentation

virtual string_ref openmsx::Connector::getClass ( ) const
pure virtual
virtual const std::string openmsx::Connector::getDescription ( ) const
pure virtual
const std::string & openmsx::Connector::getName ( ) const

Name that identifies this connector.

Definition at line 24 of file Connector.cc.

Referenced by openmsx::Pluggable::plug(), openmsx::PluggingController::registerConnector(), and openmsx::PluggingController::unregisterConnector().

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

Definition at line 59 of file Connector.hh.

Referenced by openmsx::CassettePort::CassettePort().

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

This plugs a Pluggable in this Connector.

The default implementation is ok.

Exceptions
PlugException

Reimplemented in openmsx::JoystickPort, and openmsx::Y8950KeyboardConnector.

Definition at line 29 of file Connector.cc.

References openmsx::Pluggable::plug().

template<typename Archive >
void openmsx::Connector::serialize ( Archive &  ar,
unsigned  version 
)
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 35 of file Connector.cc.

References openmsx::Pluggable::unplug().

Referenced by openmsx::UnplugCmd::execute().


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