openMSX
RS232Connector.hh
Go to the documentation of this file.
1 #ifndef RS232CONNECTOR_HH
2 #define RS232CONNECTOR_HH
3 
4 #include "Connector.hh"
5 #include "SerialDataInterface.hh"
6 #include "serialize_meta.hh"
7 
8 namespace openmsx {
9 
10 class RS232Device;
11 
13 {
14 public:
15  [[nodiscard]] RS232Device& getPluggedRS232Dev() const;
16 
17  // Connector
18  [[nodiscard]] std::string_view getDescription() const final;
19  [[nodiscard]] std::string_view getClass() const final;
20 
21  // input (SerialDataInterface)
22  void setDataBits(DataBits bits) override = 0;
23  void setStopBits(StopBits bits) override = 0;
24  void setParityBit(bool enable, ParityBit parity) override = 0;
25  void recvByte(byte value, EmuTime::param time) override = 0;
26  [[nodiscard]] virtual bool ready() = 0;
27  [[nodiscard]] virtual bool acceptsData() = 0;
28 
29  template<typename Archive>
30  void serialize(Archive& ar, unsigned version);
31 
32 protected:
33  RS232Connector(PluggingController& pluggingController,
34  std::string name);
35  ~RS232Connector() = default;
36 };
37 
39 
40 } // namespace openmsx
41 
42 #endif
Represents something you can plug devices into.
Definition: Connector.hh:21
Central administration of Connectors and Pluggables.
virtual bool ready()=0
std::string_view getClass() const final
A Connector belong to a certain class.
void recvByte(byte value, EmuTime::param time) override=0
RS232Connector(PluggingController &pluggingController, std::string name)
void setParityBit(bool enable, ParityBit parity) override=0
virtual bool acceptsData()=0
RS232Device & getPluggedRS232Dev() const
std::string_view getDescription() const final
Get a description for this connector.
void serialize(Archive &ar, unsigned version)
void setDataBits(DataBits bits) override=0
void setStopBits(StopBits bits) override=0
This file implemented 3 utility functions:
Definition: Autofire.cc:5
REGISTER_BASE_CLASS(Connector, "Connector")