w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11VirtDisk.hpp
Go to the documentation of this file.
1// $Id: Rw11VirtDisk.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2019-06-21 1167 1.3.1 remove dtor
8// 2018-12-02 1076 1.3 use unique_ptr for New()
9// 2018-10-27 1061 1.2 add fNCyl,fNHead,fNSect,NCylinder(),...
10// 2017-04-07 868 1.1.1 Dump(): add detail arg
11// 2017-04-02 866 1.1 add default scheme handling
12// 2013-03-03 494 1.0 Initial version
13// 2013-02-13 488 0.1 First draft
14// ---------------------------------------------------------------------------
15
16
21#ifndef included_Retro_Rw11VirtDisk
22#define included_Retro_Rw11VirtDisk 1
23
24#include <string>
25#include <memory>
26
27#include "Rw11Virt.hpp"
28
29namespace Retro {
30
31 class Rw11VirtDisk : public Rw11Virt {
32 public:
33 explicit Rw11VirtDisk(Rw11Unit* punit);
34
35 void Setup(size_t blksize, size_t nblock,
36 size_t ncyl, size_t nhead, size_t nsect);
37 size_t BlockSize() const;
38 size_t NBlock() const;
39 size_t NCylinder() const;
40 size_t NHead() const;
41 size_t NSector() const;
42
43 virtual bool Read(size_t lba, size_t nblk, uint8_t* data,
44 RerrMsg& emsg) = 0;
45 virtual bool Write(size_t lba, size_t nblk, const uint8_t* data,
46 RerrMsg& emsg) = 0;
47
48 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
49 int detail=0) const;
50
51 static std::unique_ptr<Rw11VirtDisk> New(const std::string& url,
52 Rw11Unit* punit, RerrMsg& emsg);
53
54 static const std::string& DefaultScheme();
55 static void SetDefaultScheme(const std::string& scheme);
56
57 // statistics counter indices
58 enum stats {
64 };
65
66 protected:
67 size_t fBlkSize;
68 size_t fNBlock;
69 size_t fNCyl;
70 size_t fNHead;
71 size_t fNSect;
72
73 protected:
74 static std::string sDefaultScheme;
75 };
76
77} // end namespace Retro
78
79#include "Rw11VirtDisk.ipp"
80
81#endif
FIXME_docs.
Definition: RerrMsg.hpp:25
FIXME_docs.
Definition: Rw11Unit.hpp:39
static void SetDefaultScheme(const std::string &scheme)
FIXME_docs.
static std::string sDefaultScheme
default scheme
size_t NSector() const
FIXME_docs.
virtual bool Read(size_t lba, size_t nblk, uint8_t *data, RerrMsg &emsg)=0
virtual bool Write(size_t lba, size_t nblk, const uint8_t *data, RerrMsg &emsg)=0
static std::unique_ptr< Rw11VirtDisk > New(const std::string &url, Rw11Unit *punit, RerrMsg &emsg)
FIXME_docs.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
size_t fNBlock
disk size in blocks
size_t fBlkSize
block size in byte
size_t NHead() const
FIXME_docs.
size_t NCylinder() const
FIXME_docs.
void Setup(size_t blksize, size_t nblock, size_t ncyl, size_t nhead, size_t nsect)
FIXME_docs.
static const std::string & DefaultScheme()
FIXME_docs.
size_t BlockSize() const
FIXME_docs.
size_t NBlock() const
FIXME_docs.
FIXME_docs.
Definition: Rw11Virt.hpp:34
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47