Add a printer factory to simplify construction of printer drivers (#11)
All checks were successful
Build ptprnt / build (push) Successful in 1m1s
All checks were successful
Build ptprnt / build (push) Successful in 1m1s
Co-authored-by: Moritz Martinius <mm@cloudprinters.de> Reviewed-on: #11
This commit is contained in:
22
src/PrinterDriverFactory.hpp
Normal file
22
src/PrinterDriverFactory.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <memory>
|
||||
#include "interface/IPrinterDriver.hpp"
|
||||
#include "libusbwrap/LibUsbTypes.hpp"
|
||||
|
||||
namespace ptprnt {
|
||||
|
||||
class PrinterDriverFactory {
|
||||
public:
|
||||
PrinterDriverFactory() = default;
|
||||
~PrinterDriverFactory() = default;
|
||||
|
||||
PrinterDriverFactory(const PrinterDriverFactory&) = delete;
|
||||
PrinterDriverFactory& operator=(const PrinterDriverFactory&) = delete;
|
||||
PrinterDriverFactory(PrinterDriverFactory&&) = delete;
|
||||
PrinterDriverFactory& operator=(PrinterDriverFactory&&) = delete;
|
||||
|
||||
std::shared_ptr<IPrinterDriver> create(libusbwrap::usbId id);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user