OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librw11/] [Rw11VirtStream.hpp] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 21 wfjm
// $Id: Rw11VirtStream.hpp 515 2013-05-04 17:28:59Z mueller $
2
//
3
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
// 
14
// Revision History: 
15
// Date         Rev Version  Comment
16
// 2013-05-04   515   1.0    Initial version
17
// 2013-05-01   513   0.1    First draft
18
// ---------------------------------------------------------------------------
19
 
20
/*!
21
  \file
22
  \version $Id: Rw11VirtStream.hpp 515 2013-05-04 17:28:59Z mueller $
23
  \brief   Declaration of class Rw11VirtStream.
24
*/
25
 
26
#ifndef included_Retro_Rw11VirtStream
27
#define included_Retro_Rw11VirtStream 1
28
 
29
#include <stdio.h>
30
 
31
#include "Rw11Virt.hpp"
32
 
33
namespace Retro {
34
 
35
  class Rw11VirtStream : public Rw11Virt {
36
    public:
37
 
38
      explicit      Rw11VirtStream(Rw11Unit* punit);
39
                   ~Rw11VirtStream();
40
 
41
      bool          Open(const std::string& url, RerrMsg& emsg);
42
      int           Read(uint8_t* data, size_t count, RerrMsg& emsg);
43
      bool          Write(const uint8_t* data, size_t count, RerrMsg& emsg);
44
      bool          Flush(RerrMsg& emsg);
45
      int           Tell(RerrMsg& emsg);
46
      bool          Seek(int pos, RerrMsg& emsg);
47
 
48
      virtual void  Dump(std::ostream& os, int ind=0, const char* text=0) const;
49
 
50
      static Rw11VirtStream* New(const std::string& url, Rw11Unit* punit,
51
                                 RerrMsg& emsg);
52
 
53
    // statistics counter indices
54
      enum stats {
55
        kStatNVSRead = Rw11Virt::kDimStat,
56
        kStatNVSReadByt,
57
        kStatNVSWrite,
58
        kStatNVSWriteByt,
59
        kStatNVSFlush,
60
        kStatNVSTell,
61
        kStatNVSSeek,
62
        kDimStat
63
      };
64
 
65
    protected:
66
      bool          fIStream;               //<! is input (read only) stream
67
      bool          fOStream;               //<! is output (write only) stream
68
      FILE*         fFile;                  //<! file ptr
69
  };
70
 
71
} // end namespace Retro
72
 
73
//#include "Rw11VirtStream.ipp"
74
 
75
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.