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
16
#include "
Rw11VirtDiskBuffer.hpp
"
17
18
using namespace
std;
19
25
// all method definitions in namespace Retro
26
namespace
Retro
{
27
28
//------------------------------------------+-----------------------------------
30
31
Rw11VirtDiskBuffer::Rw11VirtDiskBuffer
(
size_t
blksize)
32
: fBuf(blksize, 0),
33
fNWrite(0)
34
{}
35
36
//------------------------------------------+-----------------------------------
38
39
Rw11VirtDiskBuffer::~Rw11VirtDiskBuffer
()
40
{}
41
42
//------------------------------------------+-----------------------------------
44
45
void
Rw11VirtDiskBuffer::Read
(uint8_t* data)
46
{
47
::memcpy(data,
fBuf
.data(),
fBuf
.size());
48
return
;
49
}
50
51
//------------------------------------------+-----------------------------------
53
54
void
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.hpp
Retro::Rw11VirtDiskBuffer::Rw11VirtDiskBuffer
Rw11VirtDiskBuffer(size_t blksize)
Default constructor.
Definition:
Rw11VirtDiskBuffer.cpp:31
Retro::Rw11VirtDiskBuffer::Read
void Read(uint8_t *data)
FIXME_docs.
Definition:
Rw11VirtDiskBuffer.cpp:45
Retro::Rw11VirtDiskBuffer::fBuf
std::vector< uint8_t > fBuf
Definition:
Rw11VirtDiskBuffer.hpp:38
Retro::Rw11VirtDiskBuffer::Write
void Write(const uint8_t *data)
FIXME_docs.
Definition:
Rw11VirtDiskBuffer.cpp:54
Retro::Rw11VirtDiskBuffer::~Rw11VirtDiskBuffer
~Rw11VirtDiskBuffer()
Destructor.
Definition:
Rw11VirtDiskBuffer.cpp:39
Retro::Rw11VirtDiskBuffer::fNWrite
uint32_t fNWrite
Definition:
Rw11VirtDiskBuffer.hpp:39
Retro
Declaration of class ReventLoop.
Definition:
ReventLoop.cpp:47
librw11
Rw11VirtDiskBuffer.cpp
Generated on Thu Feb 9 2023 12:40:57 for w11 - cpp by
1.9.6