openMSX
RS232Connector.cc
Go to the documentation of this file.
1 #include "RS232Connector.hh"
2 #include "RS232Device.hh"
3 #include "DummyRS232Device.hh"
4 #include "checked_cast.hh"
5 #include "serialize.hh"
6 #include <memory>
7 
8 namespace openmsx {
9 
11  std::string name_)
12  : Connector(pluggingController_, std::move(name_),
13  std::make_unique<DummyRS232Device>())
14 {
15 }
16 
17 std::string_view RS232Connector::getDescription() const
18 {
19  return "Serial RS232 connector";
20 }
21 
22 std::string_view RS232Connector::getClass() const
23 {
24  return "RS232";
25 }
26 
28 {
29  return *checked_cast<RS232Device*>(&getPlugged());
30 }
31 
32 template<typename Archive>
33 void RS232Connector::serialize(Archive& ar, unsigned /*version*/)
34 {
35  ar.template serializeBase<Connector>(*this);
36 }
38 
39 } // namespace openmsx
DummyRS232Device.hh
serialize.hh
openmsx::RS232Connector::getDescription
std::string_view getDescription() const final
Get a description for this connector.
Definition: RS232Connector.cc:17
openmsx::RS232Connector::getClass
std::string_view getClass() const final
A Connector belong to a certain class.
Definition: RS232Connector.cc:22
openmsx::RS232Connector::RS232Connector
RS232Connector(PluggingController &pluggingController, std::string name)
Definition: RS232Connector.cc:10
openmsx::RS232Connector::serialize
void serialize(Archive &ar, unsigned version)
Definition: RS232Connector.cc:33
INSTANTIATE_SERIALIZE_METHODS
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
Definition: serialize.hh:982
RS232Connector.hh
openmsx::RS232Device
Definition: RS232Device.hh:10
openmsx::RS232Connector::getPluggedRS232Dev
RS232Device & getPluggedRS232Dev() const
Definition: RS232Connector.cc:27
checked_cast.hh
RS232Device.hh
openmsx::DummyRS232Device
Definition: DummyRS232Device.hh:9
openmsx::RS232Connector
Definition: RS232Connector.hh:13
openmsx::Connector
Represents something you can plug devices into.
Definition: Connector.hh:21
openmsx::PluggingController
Central administration of Connectors and Pluggables.
Definition: PluggingController.hh:22
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::Connector::getPlugged
Pluggable & getPlugged() const
Returns the Pluggable currently plugged in.
Definition: Connector.hh:59