Add generic IO (#3)
Reviewed-on: #3 Co-authored-by: Persson-dev <sim16.prib@gmail.com> Co-committed-by: Persson-dev <sim16.prib@gmail.com>
This commit was merged in pull request #3.
This commit is contained in:
23
include/sp/io/Memory.h
Normal file
23
include/sp/io/Memory.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <sp/io/IOInterface.h>
|
||||
|
||||
namespace sp {
|
||||
namespace io {
|
||||
|
||||
struct MemoryTag {};
|
||||
|
||||
template <>
|
||||
class IOInterface<MemoryTag> {
|
||||
private:
|
||||
sp::DataBuffer m_VirtualIO;
|
||||
|
||||
public:
|
||||
sp::DataBuffer Read(std::size_t a_Amount);
|
||||
void Write(const sp::DataBuffer& a_Data);
|
||||
};
|
||||
|
||||
using Memory = IOInterface<MemoryTag>;
|
||||
|
||||
} // namespace io
|
||||
} // namespace sp
|
||||
Reference in New Issue
Block a user