openMSX
PrinterPortLogger.hh
Go to the documentation of this file.
1#ifndef MSXPRINTERPORTLOGGER_HH
2#define MSXPRINTERPORTLOGGER_HH
3
5#include "FilenameSetting.hh"
6#include "File.hh"
7
8namespace openmsx {
9
10class CommandController;
11
13{
14public:
15 explicit PrinterPortLogger(CommandController& commandController);
16
17 // PrinterPortDevice
18 [[nodiscard]] bool getStatus(EmuTime::param time) override;
19 void setStrobe(bool strobe, EmuTime::param time) override;
20 void writeData(uint8_t data, EmuTime::param time) override;
21
22 // Pluggable
23 [[nodiscard]] std::string_view getName() const override;
24 [[nodiscard]] std::string_view getDescription() const override;
25 void plugHelper(Connector& connector, EmuTime::param time) override;
26 void unplugHelper(EmuTime::param time) override;
27
28 template<typename Archive>
29 void serialize(Archive& ar, unsigned version);
30
31private:
32 FilenameSetting logFilenameSetting;
33 File file;
34 uint8_t toPrint = 0; // Initialize to avoid a static analysis (cppcheck) warning.
35 // For correctness it's not strictly needed to initialize
36 // this variable. But understanding why exactly it's not
37 // needed depends on the implementation details of a few
38 // other classes, so let's simplify stuff and just
39 // initialize.
40 bool prevStrobe = true;
41};
42
43} // namespace openmsx
44
45#endif
Represents something you can plug devices into.
Definition Connector.hh:21
void unplugHelper(EmuTime::param time) override
void setStrobe(bool strobe, EmuTime::param time) override
Sets the strobe signal: false = low, true = high.
void serialize(Archive &ar, unsigned version)
void plugHelper(Connector &connector, EmuTime::param time) override
std::string_view getName() const override
Name used to identify this pluggable.
void writeData(uint8_t data, EmuTime::param time) override
Sets the data signals.
bool getStatus(EmuTime::param time) override
Returns the STATUS signal: false = low = ready, true = high = not ready.
std::string_view getDescription() const override
Description for this pluggable.
This file implemented 3 utility functions:
Definition Autofire.cc:11