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 
18 {
19  return "Serial RS232 connector";
20 }
21 
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
RS232Device & getPluggedRS232Dev() const
Represents something you can plug devices into.
Definition: Connector.hh:20
void serialize(Archive &ar, unsigned version)
string_view getClass() const final override
A Connector belong to a certain class.
STL namespace.
Central administration of Connectors and Pluggables.
string_view getDescription() const final override
Get a description for this connector.
RS232Connector(PluggingController &pluggingController, std::string name)
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
This class implements a (close approximation) of the std::string_view class.
Definition: string_view.hh:16
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
Definition: serialize.hh:1006
Pluggable & getPlugged() const
Returns the Pluggable currently plugged in.
Definition: Connector.hh:59