w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11VirtStream.hpp
Go to the documentation of this file.
1// $Id: Rw11VirtStream.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2019-04-14 1131 1.1.1 add Error(),Eof()
8// 2018-12-02 1076 1.1 use unique_ptr for New()
9// 2017-04-07 868 1.0.1 Dump(): add detail arg
10// 2013-05-04 515 1.0 Initial version
11// 2013-05-01 513 0.1 First draft
12// ---------------------------------------------------------------------------
13
18#ifndef included_Retro_Rw11VirtStream
19#define included_Retro_Rw11VirtStream 1
20
21#include <stdio.h>
22
23#include <memory>
24
25#include "Rw11Virt.hpp"
26
27namespace Retro {
28
29 class Rw11VirtStream : public Rw11Virt {
30 public:
31
32 explicit Rw11VirtStream(Rw11Unit* punit);
34
35 virtual bool Open(const std::string& url, RerrMsg& emsg);
36 int Read(uint8_t* data, size_t count, RerrMsg& emsg);
37 bool Write(const uint8_t* data, size_t count, RerrMsg& emsg);
38 bool Flush(RerrMsg& emsg);
39 int Tell(RerrMsg& emsg);
40 bool Seek(int pos, RerrMsg& emsg);
41 bool Error() const;
42 bool Eof() const;
43
44 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
45 int detail=0) const;
46
47 static std::unique_ptr<Rw11VirtStream> New(const std::string& url,
48 Rw11Unit* punit,
49 RerrMsg& emsg);
50
51 // statistics counter indices
52 enum stats {
61 };
62
63 protected:
64 bool fIStream;
65 bool fOStream;
66 FILE* fFile;
67 };
68
69} // end namespace Retro
70
71//#include "Rw11VirtStream.ipp"
72
73#endif
FIXME_docs.
Definition: RerrMsg.hpp:25
FIXME_docs.
Definition: Rw11Unit.hpp:39
bool fIStream
is input (read only) stream
bool fOStream
is output (write only) stream
bool Write(const uint8_t *data, size_t count, RerrMsg &emsg)
FIXME_docs.
int Read(uint8_t *data, size_t count, RerrMsg &emsg)
FIXME_docs.
int Tell(RerrMsg &emsg)
FIXME_docs.
static std::unique_ptr< Rw11VirtStream > 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.
~Rw11VirtStream()
Destructor.
bool Flush(RerrMsg &emsg)
FIXME_docs.
bool Eof() const
FIXME_docs.
bool Error() const
FIXME_docs.
bool Seek(int pos, RerrMsg &emsg)
FIXME_docs.
virtual bool Open(const std::string &url, RerrMsg &emsg)
FIXME_docs.
FIXME_docs.
Definition: Rw11Virt.hpp:34
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47