w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11VirtTape.hpp
Go to the documentation of this file.
1// $Id: Rw11VirtTape.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2015-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2019-07-08 1180 1.2.1 remove dtor
8// 2018-12-02 1076 1.2 use unique_ptr for New()
9// 2017-04-07 868 1.1.1 Dump(): add detail arg
10// 2017-04-02 864 1.1 move fWProt,WProt() to Rw11Virt base
11// 2015-06-04 686 1.0 Initial version
12// 2015-05-17 683 0.1 First draft
13// ---------------------------------------------------------------------------
14
15
20#ifndef included_Retro_Rw11VirtTape
21#define included_Retro_Rw11VirtTape 1
22
23#include <memory>
24
25#include "Rw11Virt.hpp"
26
27namespace Retro {
28
29 class Rw11VirtTape : public Rw11Virt {
30 public:
31 explicit Rw11VirtTape(Rw11Unit* punit);
32
33 void SetCapacity(size_t nbyte);
34 size_t Capacity() const;
35
36 virtual bool ReadRecord(size_t nbyte, uint8_t* data, size_t& ndone,
37 int& opcode, RerrMsg& emsg) = 0;
38 virtual bool WriteRecord(size_t nbyte, const uint8_t* data,
39 int& opcode, RerrMsg& emsg) = 0;
40 virtual bool WriteEof(RerrMsg& emsg) = 0;
41 virtual bool SpaceForw(size_t nrec, size_t& ndone,
42 int& opcode, RerrMsg& emsg) = 0;
43 virtual bool SpaceBack(size_t nrec, size_t& ndone,
44 int& opcode, RerrMsg& emsg) = 0;
45 virtual bool Rewind(int& opcode, RerrMsg& emsg) = 0;
46
47 void SetPosFile(int posfile);
48 void SetPosRecord(int posrec);
49
50 bool Bot() const;
51 bool Eot() const;
52 bool Eom() const;
53
54 int PosFile() const;
55 int PosRecord() const;
56
57 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
58 int detail=0) const;
59
60 static std::unique_ptr<Rw11VirtTape> New(const std::string& url,
61 Rw11Unit* punit, RerrMsg& emsg);
62
63 // statistics counter indices
64 enum stats {
78 };
79
80 // operation code
81 enum OpCode {
89 };
90
91 protected:
92 size_t fCapacity;
93 bool fBot;
94 bool fEot;
95 bool fEom;
98 };
99
100} // end namespace Retro
101
102#include "Rw11VirtTape.ipp"
103
104#endif
FIXME_docs.
Definition: RerrMsg.hpp:25
FIXME_docs.
Definition: Rw11Unit.hpp:39
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
@ kOpCodeRecLenErr
record length error
@ kOpCodeBot
ended at BOT
@ kOpCodeBadFormat
file format error
@ kOpCodeOK
operation OK
@ kOpCodeEof
ended at EOF
@ kOpCodeEom
ended at EOM
@ kOpCodeBadParity
record with parity error
void SetPosFile(int posfile)
FIXME_docs.
virtual bool SpaceForw(size_t nrec, size_t &ndone, int &opcode, RerrMsg &emsg)=0
bool Eom() const
FIXME_docs.
void SetCapacity(size_t nbyte)
FIXME_docs.
int PosFile() const
FIXME_docs.
size_t Capacity() const
FIXME_docs.
int fPosRecord
tape pos: #record (-1=unknown)
int PosRecord() const
FIXME_docs.
void SetPosRecord(int posrec)
FIXME_docs.
size_t fCapacity
capacity in byte (0=unlimited)
static std::unique_ptr< Rw11VirtTape > New(const std::string &url, Rw11Unit *punit, RerrMsg &emsg)
FIXME_docs.
virtual bool Rewind(int &opcode, RerrMsg &emsg)=0
bool Eot() const
FIXME_docs.
virtual bool WriteRecord(size_t nbyte, const uint8_t *data, int &opcode, RerrMsg &emsg)=0
bool fBot
tape at bot
virtual bool ReadRecord(size_t nbyte, uint8_t *data, size_t &ndone, int &opcode, RerrMsg &emsg)=0
virtual bool SpaceBack(size_t nrec, size_t &ndone, int &opcode, RerrMsg &emsg)=0
bool Bot() const
FIXME_docs.
bool fEom
tape beyond medium
int fPosFile
tape pos: #files (-1=unknown)
bool fEot
tape beyond eot
virtual bool WriteEof(RerrMsg &emsg)=0
FIXME_docs.
Definition: Rw11Virt.hpp:34
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47