UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TapeRead.hpp
1 /* TapeRead.hpp */
2 /* $Id: TapeRead.hpp,v 1.1 2004/01/28 13:26:25 vlad Exp $ */
3 #ifndef __TapeRead_hpp
4 #define __TapeRead_hpp
5 
6 #include <mix/ErrCodes.h>
7 
8 
14 class TapeRead
15 {
16 public:
17 
19  TapeRead (const char* szPath);
20 
22  virtual ~TapeRead ();
23 
24  /*
25  * Setting tape read parameters.
26  */
27 
29  virtual void set_max_block_size (int nSize);
30 
32  virtual int get_max_block_size () const;
33 
35  virtual void set_max_errors (int nErrors);
36 
38  virtual int get_max_errors () const;
39 
40 
42  virtual const char* get_tape_name () const;
43 
45  virtual unsigned char* get_block_buffer () const;
46 
47 
48  /*
49  * Reading methods.
50  */
51 
54  virtual ErrCode observe ();
55 
57  virtual void finish ();
58 
59  /*
60  * Statistics is accessible at every stage of tape processing.
61  */
62 
64  virtual int files_on_tape () const;
65 
67  virtual int size_of_tape () const;
68 
69  /*
70  * Events to process. Order of actual calls.
71  */
72 
74  virtual void start_of_tape ();
75 
79  virtual void start_of_file (int iFile);
80 
83  virtual void block_of_file (int iFile, int iBlock,
84  const unsigned char* pBlockData,
85  int nBlockSize);
86 
89  virtual void end_of_block_sequence (int iFile,
90  int iBlock1, int iBlock2,
91  int nBlockSize);
92 
95  virtual void end_of_file (int iFile, int nBlocks, int nFileSize);
96 
98  virtual void end_of_tape ();
99 
105  virtual void final (bool bNormal);
106 
107 protected:
108 
111 
114 
117 
119  unsigned char *pBlockBuffer;
120 
123  int nFiles;
124 
127 
129  bool bFinish;
130 
131 };
132 
133 
134 #endif /* TapeRead.hpp */
int nMaxErrors
Definition: TapeRead.hpp:116
int nFiles
Definition: TapeRead.hpp:123
virtual void start_of_tape()
virtual void set_max_errors(int nErrors)
virtual int files_on_tape() const
virtual ErrCode observe()
virtual int get_max_errors() const
virtual void block_of_file(int iFile, int iBlock, const unsigned char *pBlockData, int nBlockSize)
virtual void set_max_block_size(int nSize)
int nTapeSize
Definition: TapeRead.hpp:126
int nMaxBlockSize
Definition: TapeRead.hpp:113
virtual void start_of_file(int iFile)
virtual void end_of_file(int iFile, int nBlocks, int nFileSize)
Definition: TapeRead.hpp:14
virtual int size_of_tape() const
virtual void finish()
virtual unsigned char * get_block_buffer() const
virtual const char * get_tape_name() const
virtual ~TapeRead()
unsigned char * pBlockBuffer
Definition: TapeRead.hpp:119
bool bFinish
Definition: TapeRead.hpp:129
TapeRead(const char *szPath)
virtual int get_max_block_size() const
char * szDataLocAddress
Definition: TapeRead.hpp:110
virtual void end_of_tape()
virtual void end_of_block_sequence(int iFile, int iBlock1, int iBlock2, int nBlockSize)