mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
Initial commit for GitHub migration based on spice2x-25-03-03
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <array>
|
||||
#include <queue>
|
||||
#include <memory> // std::unique_ptr
|
||||
#include <cstdint>
|
||||
|
||||
#include "acio2emu/packet.h"
|
||||
#include "acio2emu/node.h"
|
||||
|
||||
#include "hooks/devicehook.h"
|
||||
|
||||
namespace acio2emu {
|
||||
class IOBHandle : public CustomHandle {
|
||||
private:
|
||||
std::wstring device_;
|
||||
|
||||
std::array<std::unique_ptr<Node>, 17> nodes_;
|
||||
// the first node is reserved for the "master" node
|
||||
int number_of_nodes_ = 1;
|
||||
|
||||
PacketDecoder decoder_;
|
||||
std::queue<uint8_t> output_;
|
||||
|
||||
void forward_packet_(const Packet &packet);
|
||||
|
||||
public:
|
||||
IOBHandle(std::wstring device);
|
||||
|
||||
bool register_node(std::unique_ptr<Node> node);
|
||||
int number_of_nodes() const;
|
||||
|
||||
/*
|
||||
* CustomHandle
|
||||
*/
|
||||
|
||||
bool open(LPCWSTR lpFileName) override;
|
||||
int read(LPVOID lpBuffer, DWORD nNumberOfBytesToRead) override;
|
||||
int write(LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite) override;
|
||||
int device_io(DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize) override;
|
||||
bool close() override;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user