w11 - cpp 0.794
Backend server for Rlink and w11
|
FIXME_docs. More...
#include <Rw11VirtTapeTap.hpp>
Public Member Functions | |
Rw11VirtTapeTap (Rw11Unit *punit) | |
Default constructor. | |
virtual bool | Open (const std::string &url, RerrMsg &emsg) |
FIXME_docs. | |
virtual bool | ReadRecord (size_t nbyt, uint8_t *data, size_t &ndone, int &opcode, RerrMsg &emsg) |
FIXME_docs. | |
virtual bool | WriteRecord (size_t nbyt, const uint8_t *data, int &opcode, RerrMsg &emsg) |
FIXME_docs. | |
virtual bool | WriteEof (RerrMsg &emsg) |
FIXME_docs. | |
virtual bool | SpaceForw (size_t nrec, size_t &ndone, int &opcode, RerrMsg &emsg) |
FIXME_docs. | |
virtual bool | SpaceBack (size_t nrec, size_t &ndone, int &opcode, RerrMsg &emsg) |
FIXME_docs. | |
virtual bool | Rewind (int &opcode, RerrMsg &emsg) |
FIXME_docs. | |
virtual void | Dump (std::ostream &os, int ind=0, const char *text=0, int detail=0) const |
FIXME_docs. | |
Public Member Functions inherited from Retro::Rw11VirtTape | |
Rw11VirtTape (Rw11Unit *punit) | |
Default constructor. | |
void | SetCapacity (size_t nbyte) |
FIXME_docs. | |
size_t | Capacity () const |
FIXME_docs. | |
virtual bool | ReadRecord (size_t nbyte, uint8_t *data, size_t &ndone, int &opcode, RerrMsg &emsg)=0 |
virtual bool | WriteRecord (size_t nbyte, const uint8_t *data, int &opcode, RerrMsg &emsg)=0 |
virtual bool | WriteEof (RerrMsg &emsg)=0 |
virtual bool | SpaceForw (size_t nrec, size_t &ndone, int &opcode, RerrMsg &emsg)=0 |
virtual bool | SpaceBack (size_t nrec, size_t &ndone, int &opcode, RerrMsg &emsg)=0 |
virtual bool | Rewind (int &opcode, RerrMsg &emsg)=0 |
void | SetPosFile (int posfile) |
FIXME_docs. | |
void | SetPosRecord (int posrec) |
FIXME_docs. | |
bool | Bot () const |
FIXME_docs. | |
bool | Eot () const |
FIXME_docs. | |
bool | Eom () const |
FIXME_docs. | |
int | PosFile () const |
FIXME_docs. | |
int | PosRecord () const |
FIXME_docs. | |
virtual void | Dump (std::ostream &os, int ind=0, const char *text=0, int detail=0) const |
FIXME_docs. | |
Public Member Functions inherited from Retro::Rw11Virt | |
Rw11Virt (Rw11Unit *punit) | |
Default constructor. | |
virtual | ~Rw11Virt () |
Destructor. | |
Rw11Virt (const Rw11Virt &)=delete | |
Rw11Virt & | operator= (const Rw11Virt &)=delete |
Rw11Unit & | Unit () const |
FIXME_docs. | |
Rw11Cntl & | Cntl () const |
FIXME_docs. | |
Rw11Cpu & | Cpu () const |
FIXME_docs. | |
Rw11 & | W11 () const |
FIXME_docs. | |
RlinkServer & | Server () const |
FIXME_docs. | |
RlogFile & | LogFile () const |
FIXME_docs. | |
virtual bool | WProt () const |
FIXME_docs. | |
const RparseUrl & | Url () const |
FIXME_docs. | |
virtual bool | Open (const std::string &url, RerrMsg &emsg)=0 |
Rstats & | Stats () |
FIXME_docs. | |
virtual void | Dump (std::ostream &os, int ind=0, const char *text=0, int detail=0) const |
FIXME_docs. | |
Static Public Attributes | |
static const uint32_t | kMetaEof = 0x00000000 |
EOF marker. | |
static const uint32_t | kMetaEom = 0xffffffff |
EOM marker. | |
static const uint32_t | kMeta_M_Perr = 0x80000000 |
static const uint32_t | kMeta_M_Mbz = 0x7fff0000 |
static const uint32_t | kMeta_B_Rlen = 0x0000ffff |
Protected Member Functions | |
bool | Seek (size_t seekpos, int dir, RerrMsg &emsg) |
FIXME_docs. | |
bool | Read (size_t nbyt, uint8_t *data, RerrMsg &emsg) |
FIXME_docs. | |
bool | Write (size_t nbyt, const uint8_t *data, bool back, RerrMsg &emsg) |
FIXME_docs. | |
bool | CheckSizeForw (size_t nbyt, const char *text, RerrMsg &emsg) |
FIXME_docs. | |
bool | CheckSizeBack (size_t nbyt, const char *text, RerrMsg &emsg) |
FIXME_docs. | |
void | UpdatePos (size_t nbyt, int dir) |
FIXME_docs. | |
bool | ParseMeta (uint32_t meta, size_t &rlen, bool &perr, RerrMsg &emsg) |
FIXME_docs. | |
size_t | BytePadding (size_t rlen) |
FIXME_docs. | |
bool | SetBad () |
FIXME_docs. | |
bool | BadTapeMsg (const char *meth, RerrMsg &emsg) |
FIXME_docs. | |
void | IncPosRecord (int delta) |
FIXME_docs. | |
Protected Attributes | |
RfileFd | fFd |
file number | |
size_t | fSize |
file size | |
size_t | fPos |
file position | |
bool | fBad |
BAD file format flag. | |
bool | fPadOdd |
do odd byte padding | |
bool | fTruncPend |
truncate on next write | |
Protected Attributes inherited from Retro::Rw11VirtTape | |
size_t | fCapacity |
capacity in byte (0=unlimited) | |
bool | fBot |
tape at bot | |
bool | fEot |
tape beyond eot | |
bool | fEom |
tape beyond medium | |
int | fPosFile |
tape pos: #files (-1=unknown) | |
int | fPosRecord |
tape pos: #record (-1=unknown) | |
Protected Attributes inherited from Retro::Rw11Virt | |
Rw11Unit * | fpUnit |
back ref to unit | |
RparseUrl | fUrl |
bool | fWProt |
write protected | |
Rstats | fStats |
statistics | |
Additional Inherited Members | |
Public Types inherited from Retro::Rw11VirtTape | |
enum | stats { kStatNVTReadRec = Rw11Virt::kDimStat , kStatNVTReadByt , kStatNVTReadEof , kStatNVTReadEom , kStatNVTReadPErr , kStatNVTReadLErr , kStatNVTWriteRec , kStatNVTWriteByt , kStatNVTWriteEof , kStatNVTSpaForw , kStatNVTSpaBack , kStatNVTRewind , kDimStat } |
enum | OpCode { kOpCodeOK = 0 , kOpCodeBot , kOpCodeEof , kOpCodeEom , kOpCodeRecLenErr , kOpCodeBadParity , kOpCodeBadFormat } |
Public Types inherited from Retro::Rw11Virt | |
enum | stats { kDimStat = 0 } |
Static Public Member Functions inherited from Retro::Rw11VirtTape | |
static std::unique_ptr< Rw11VirtTape > | New (const std::string &url, Rw11Unit *punit, RerrMsg &emsg) |
FIXME_docs. | |
FIXME_docs.
Definition at line 27 of file Rw11VirtTapeTap.hpp.
|
explicit |
Default constructor.
Definition at line 48 of file Rw11VirtTapeTap.cpp.
|
virtual |
FIXME_docs.
Implements Retro::Rw11Virt.
Definition at line 61 of file Rw11VirtTapeTap.cpp.
References Retro::Rfd::Close(), fBad, Retro::Rw11VirtTape::fBot, Retro::Rw11VirtTape::fCapacity, Retro::Rw11VirtTape::fEom, Retro::Rw11VirtTape::fEot, fFd, Retro::RparseUrl::FindOpt(), fPadOdd, fPos, Retro::Rw11VirtTape::fPosFile, Retro::Rw11VirtTape::fPosRecord, fSize, fTruncPend, Retro::Rw11Virt::fUrl, Retro::Rw11Virt::fWProt, Retro::RerrMsg::Init(), Retro::RfileFd::Open(), Retro::RparseUrl::Path(), Retro::RparseUrl::Set(), Retro::RfileFd::Stat(), and Retro::Rtools::String2Long().
|
virtual |
FIXME_docs.
Implements Retro::Rw11VirtTape.
Definition at line 134 of file Rw11VirtTapeTap.cpp.
References BadTapeMsg(), BytePadding(), CheckSizeForw(), fBad, Retro::Rw11VirtTape::fEom, fPos, Retro::Rw11VirtTape::fPosFile, Retro::Rw11VirtTape::fPosRecord, fSize, Retro::Rw11Virt::fStats, Retro::Rstats::Inc(), IncPosRecord(), Retro::RerrMsg::Init(), kMetaEof, kMetaEom, Retro::Rw11VirtTape::kOpCodeBadFormat, Retro::Rw11VirtTape::kOpCodeBadParity, Retro::Rw11VirtTape::kOpCodeEof, Retro::Rw11VirtTape::kOpCodeEom, Retro::Rw11VirtTape::kOpCodeOK, Retro::Rw11VirtTape::kOpCodeRecLenErr, Retro::Rw11VirtTape::kStatNVTReadByt, Retro::Rw11VirtTape::kStatNVTReadEof, Retro::Rw11VirtTape::kStatNVTReadEom, Retro::Rw11VirtTape::kStatNVTReadLErr, Retro::Rw11VirtTape::kStatNVTReadPErr, Retro::Rw11VirtTape::kStatNVTReadRec, ParseMeta(), Read(), Seek(), and SetBad().
|
virtual |
FIXME_docs.
Implements Retro::Rw11VirtTape.
Definition at line 214 of file Rw11VirtTapeTap.cpp.
References BadTapeMsg(), fBad, Retro::Rw11VirtTape::fEom, fPadOdd, Retro::Rw11Virt::fStats, Retro::Rstats::Inc(), IncPosRecord(), kMetaEom, Retro::Rw11VirtTape::kOpCodeBadFormat, Retro::Rw11VirtTape::kOpCodeOK, Retro::Rw11VirtTape::kStatNVTWriteByt, Retro::Rw11VirtTape::kStatNVTWriteRec, SetBad(), and Write().
|
virtual |
FIXME_docs.
Implements Retro::Rw11VirtTape.
Definition at line 251 of file Rw11VirtTapeTap.cpp.
References BadTapeMsg(), fBad, Retro::Rw11VirtTape::fEom, Retro::Rw11VirtTape::fPosFile, Retro::Rw11VirtTape::fPosRecord, Retro::Rw11Virt::fStats, Retro::Rstats::Inc(), kMetaEof, kMetaEom, Retro::Rw11VirtTape::kStatNVTWriteEof, SetBad(), and Write().
|
virtual |
FIXME_docs.
Implements Retro::Rw11VirtTape.
Definition at line 273 of file Rw11VirtTapeTap.cpp.
References BadTapeMsg(), BytePadding(), CheckSizeForw(), fBad, Retro::Rw11VirtTape::fEom, fPos, Retro::Rw11VirtTape::fPosFile, Retro::Rw11VirtTape::fPosRecord, fSize, Retro::Rw11Virt::fStats, Retro::Rstats::Inc(), IncPosRecord(), kMetaEof, kMetaEom, Retro::Rw11VirtTape::kOpCodeBadFormat, Retro::Rw11VirtTape::kOpCodeEof, Retro::Rw11VirtTape::kOpCodeEom, Retro::Rw11VirtTape::kOpCodeOK, Retro::Rw11VirtTape::kStatNVTSpaForw, ParseMeta(), Read(), Seek(), and SetBad().
|
virtual |
FIXME_docs.
Implements Retro::Rw11VirtTape.
Definition at line 332 of file Rw11VirtTapeTap.cpp.
References BadTapeMsg(), BytePadding(), CheckSizeBack(), fBad, Retro::Rw11VirtTape::fEom, fPos, Retro::Rw11VirtTape::fPosFile, Retro::Rw11VirtTape::fPosRecord, Retro::Rw11Virt::fStats, fTruncPend, Retro::Rstats::Inc(), IncPosRecord(), Retro::RerrMsg::Init(), kMetaEof, kMetaEom, Retro::Rw11VirtTape::kOpCodeBadFormat, Retro::Rw11VirtTape::kOpCodeBot, Retro::Rw11VirtTape::kOpCodeEof, Retro::Rw11VirtTape::kOpCodeOK, Retro::Rw11VirtTape::kStatNVTSpaBack, ParseMeta(), Read(), Seek(), and SetBad().
|
virtual |
FIXME_docs.
Implements Retro::Rw11VirtTape.
Definition at line 395 of file Rw11VirtTapeTap.cpp.
References fBad, Retro::Rw11VirtTape::fBot, Retro::Rw11VirtTape::fEom, Retro::Rw11VirtTape::fEot, Retro::Rw11VirtTape::fPosFile, Retro::Rw11VirtTape::fPosRecord, Retro::Rw11Virt::fStats, fTruncPend, Retro::Rstats::Inc(), Retro::Rw11VirtTape::kOpCodeBadFormat, Retro::Rw11VirtTape::kOpCodeOK, Retro::Rw11VirtTape::kStatNVTRewind, Seek(), and SetBad().
|
virtual |
FIXME_docs.
Reimplemented from Retro::Rw11VirtTape.
Definition at line 417 of file Rw11VirtTapeTap.cpp.
References Retro::Rw11VirtTape::Dump(), fBad, Retro::Rfd::Fd(), fFd, fPadOdd, fPos, fSize, fTruncPend, and Retro::RosPrintf().
|
protected |
FIXME_docs.
Definition at line 436 of file Rw11VirtTapeTap.cpp.
References fFd, Retro::RfileFd::Seek(), and UpdatePos().
Referenced by ReadRecord(), Rewind(), SpaceBack(), SpaceForw(), and Write().
|
protected |
FIXME_docs.
Definition at line 456 of file Rw11VirtTapeTap.cpp.
References fFd, Retro::RfileFd::Read(), and UpdatePos().
Referenced by ReadRecord(), SpaceBack(), and SpaceForw().
|
protected |
FIXME_docs.
Definition at line 467 of file Rw11VirtTapeTap.cpp.
References fFd, fPos, fSize, fTruncPend, Seek(), Retro::RfileFd::Truncate(), UpdatePos(), and Retro::RfileFd::WriteAll().
Referenced by WriteEof(), and WriteRecord().
|
protected |
FIXME_docs.
Definition at line 490 of file Rw11VirtTapeTap.cpp.
References fPos, fSize, and Retro::RerrMsg::Init().
Referenced by ReadRecord(), and SpaceForw().
|
protected |
FIXME_docs.
Definition at line 501 of file Rw11VirtTapeTap.cpp.
References fPos, and Retro::RerrMsg::Init().
Referenced by SpaceBack().
|
protected |
FIXME_docs.
Definition at line 512 of file Rw11VirtTapeTap.cpp.
References Retro::Rw11VirtTape::fBot, Retro::Rw11VirtTape::fCapacity, Retro::Rw11VirtTape::fEot, and fPos.
|
protected |
FIXME_docs.
Definition at line 531 of file Rw11VirtTapeTap.cpp.
References Retro::RerrMsg::Init(), kMeta_B_Rlen, kMeta_M_Mbz, and kMeta_M_Perr.
Referenced by ReadRecord(), SpaceBack(), and SpaceForw().
|
inlineprotected |
FIXME_docs.
Definition at line 21 of file Rw11VirtTapeTap.ipp.
References fPadOdd.
Referenced by ReadRecord(), SpaceBack(), and SpaceForw().
|
inlineprotected |
FIXME_docs.
Definition at line 29 of file Rw11VirtTapeTap.ipp.
References fBad.
Referenced by ReadRecord(), Rewind(), SpaceBack(), SpaceForw(), WriteEof(), and WriteRecord().
|
protected |
FIXME_docs.
Definition at line 546 of file Rw11VirtTapeTap.cpp.
References Retro::RerrMsg::Init().
Referenced by ReadRecord(), SpaceBack(), SpaceForw(), WriteEof(), and WriteRecord().
|
inlineprotected |
FIXME_docs.
Definition at line 38 of file Rw11VirtTapeTap.ipp.
References Retro::Rw11VirtTape::fPosRecord.
Referenced by ReadRecord(), SpaceBack(), SpaceForw(), and WriteRecord().
|
static |
EOF marker.
Definition at line 49 of file Rw11VirtTapeTap.hpp.
Referenced by ReadRecord(), SpaceBack(), SpaceForw(), and WriteEof().
|
static |
EOM marker.
Definition at line 50 of file Rw11VirtTapeTap.hpp.
Referenced by ReadRecord(), SpaceBack(), SpaceForw(), WriteEof(), and WriteRecord().
|
static |
Definition at line 51 of file Rw11VirtTapeTap.hpp.
Referenced by ParseMeta().
|
static |
Definition at line 52 of file Rw11VirtTapeTap.hpp.
Referenced by ParseMeta().
|
static |
Definition at line 53 of file Rw11VirtTapeTap.hpp.
Referenced by ParseMeta().
|
protected |
|
protected |
file size
Definition at line 72 of file Rw11VirtTapeTap.hpp.
Referenced by CheckSizeForw(), Dump(), Open(), ReadRecord(), SpaceForw(), and Write().
|
protected |
file position
Definition at line 73 of file Rw11VirtTapeTap.hpp.
Referenced by CheckSizeBack(), CheckSizeForw(), Dump(), Open(), ReadRecord(), SpaceBack(), SpaceForw(), UpdatePos(), and Write().
|
protected |
BAD file format flag.
Definition at line 74 of file Rw11VirtTapeTap.hpp.
Referenced by Dump(), Open(), ReadRecord(), Rewind(), SetBad(), SpaceBack(), SpaceForw(), WriteEof(), and WriteRecord().
|
protected |
do odd byte padding
Definition at line 75 of file Rw11VirtTapeTap.hpp.
Referenced by BytePadding(), Dump(), Open(), and WriteRecord().
|
protected |
truncate on next write
Definition at line 76 of file Rw11VirtTapeTap.hpp.
Referenced by Dump(), Open(), Rewind(), SpaceBack(), and Write().