UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Attributes | List of all members
TapeRead Class Reference

#include <TapeRead.hpp>

Public Member Functions

 TapeRead (const char *szPath)
 
virtual ~TapeRead ()
 
virtual void set_max_block_size (int nSize)
 
virtual int get_max_block_size () const
 
virtual void set_max_errors (int nErrors)
 
virtual int get_max_errors () const
 
virtual const char * get_tape_name () const
 
virtual unsigned char * get_block_buffer () const
 
virtual ErrCode observe ()
 
virtual void finish ()
 
virtual int files_on_tape () const
 
virtual int size_of_tape () const
 
virtual void start_of_tape ()
 
virtual void start_of_file (int iFile)
 
virtual void block_of_file (int iFile, int iBlock, const unsigned char *pBlockData, int nBlockSize)
 
virtual void end_of_block_sequence (int iFile, int iBlock1, int iBlock2, int nBlockSize)
 
virtual void end_of_file (int iFile, int nBlocks, int nFileSize)
 
virtual void end_of_tape ()
 
virtual void final (bool bNormal)
 

Protected Attributes

char * szDataLocAddress
 
int nMaxBlockSize
 
int nMaxErrors
 
unsigned char * pBlockBuffer
 
int nFiles
 
int nTapeSize
 
bool bFinish
 

Detailed Description

Abstraction for magnetic tape reader device access.

Constructor & Destructor Documentation

TapeRead::TapeRead ( const char *  szPath)

Create object for reading given tape (or other medium).

virtual TapeRead::~TapeRead ( )
virtual

Destroy the object and release all catched resources.

Member Function Documentation

virtual void TapeRead::block_of_file ( int  iFile,
int  iBlock,
const unsigned char *  pBlockData,
int  nBlockSize 
)
virtual

Called on tape block was read. At least one block must exist in the file.

virtual void TapeRead::end_of_block_sequence ( int  iFile,
int  iBlock1,
int  iBlock2,
int  nBlockSize 
)
virtual

Called on the end of tape block sequence iBlock1..iBlock2 with the same length nBlockSize.

virtual void TapeRead::end_of_file ( int  iFile,
int  nBlocks,
int  nFileSize 
)
virtual

Called just after the last file's block was read. At least one tape file must exist on the tape.

virtual void TapeRead::end_of_tape ( )
virtual

Called just after the last file on the tape was read.

virtual int TapeRead::files_on_tape ( ) const
virtual

Number of files on the tape.

virtual void TapeRead::final ( bool  bNormal)
virtual

Called just after end_of_tape() but is called even if finish() caused break of the observation process. True is passed in case of normal finish (after end_of_tape()) and false is passed in case of abnormal one (caoused by finish() call in any of event processing methods).

virtual void TapeRead::finish ( )
virtual

Break the observation method.

virtual unsigned char* TapeRead::get_block_buffer ( ) const
virtual

Get the pointer to block buffer.

virtual int TapeRead::get_max_block_size ( ) const
virtual

Get maximum tape block size.

virtual int TapeRead::get_max_errors ( ) const
virtual

Get maximum number of reading errors.

virtual const char* TapeRead::get_tape_name ( ) const
virtual

Get the data location (path).

virtual ErrCode TapeRead::observe ( )
virtual

Iterate trough the whole tape contents raising events on the way. Statistics is reset at the start of observe() method.

virtual void TapeRead::set_max_block_size ( int  nSize)
virtual

Setup maximum tape block size.

virtual void TapeRead::set_max_errors ( int  nErrors)
virtual

Setup maximum number of reading errors.

virtual int TapeRead::size_of_tape ( ) const
virtual

Total size of files on the tape.

virtual void TapeRead::start_of_file ( int  iFile)
virtual

Called just before new tape file is read. At least one tape file must exist on the tape. Index of file on the tape is passed as an argument.

virtual void TapeRead::start_of_tape ( )
virtual

Called just before tape is read.

Member Data Documentation

bool TapeRead::bFinish
protected

Break the observing method.

int TapeRead::nFiles
protected

Total number of files on the tape. Before observer() is equal to 0.

int TapeRead::nMaxBlockSize
protected

Maximum length of tape record.

int TapeRead::nMaxErrors
protected

Maximum allowed number of read errors.

int TapeRead::nTapeSize
protected

Total tape size. Before observer() is equal to 0.

unsigned char* TapeRead::pBlockBuffer
protected

Preallocated buffer for the most long tape record.

char* TapeRead::szDataLocAddress
protected

Data location address. Usually path to the tape device.


The documentation for this class was generated from the following file: