w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11VirtDiskBuffer.cpp
Go to the documentation of this file.
1// $Id: Rw11VirtDiskBuffer.cpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2017- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2017-03-10 859 1.0 Initial version
8// ---------------------------------------------------------------------------
9
14#include <string.h>
15
17
18using namespace std;
19
25// all method definitions in namespace Retro
26namespace Retro {
27
28//------------------------------------------+-----------------------------------
30
32 : fBuf(blksize, 0),
33 fNWrite(0)
34{}
35
36//------------------------------------------+-----------------------------------
38
40{}
41
42//------------------------------------------+-----------------------------------
44
45void Rw11VirtDiskBuffer::Read(uint8_t* data)
46{
47 ::memcpy(data, fBuf.data(), fBuf.size());
48 return;
49}
50
51//------------------------------------------+-----------------------------------
53
54void Rw11VirtDiskBuffer::Write(const uint8_t* data)
55{
56 ::memcpy(fBuf.data(), data, fBuf.size());
57 fNWrite += 1;
58 if (fNWrite == 0) fNWrite -= 1; // stop at max
59 return;
60}
61
62} // end namespace Retro
Rw11VirtDiskBuffer(size_t blksize)
Default constructor.
void Read(uint8_t *data)
FIXME_docs.
std::vector< uint8_t > fBuf
void Write(const uint8_t *data)
FIXME_docs.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47