casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
casacore::BlockInput Class Reference

fixed-length blocked sequential input base class More...

#include <blockio.h>

Inheritance diagram for casacore::BlockInput:
casacore::BlockIO casacore::FitsDiskInput casacore::FitsStdInput casacore::FitsTape9Input

Public Member Functions

 BlockInput (const char *, int, int=1, FITSErrorHandler errhandler=FITSError::defaultHandler)
 Construction can be done either from a filename or from a file descriptor. More...
 
 BlockInput (int, int, int=1, FITSErrorHandler errhandler=FITSError::defaultHandler)
 
virtual ~BlockInput ()
 
virtual char * read ()
 read the next logical record or first skip N logical records and then read the next one. More...
 
virtual char * skip (int)
 
- Public Member Functions inherited from casacore::BlockIO
int err () const
 
int blockno () const
 number of physical blocks read/written More...
 
void reset_iosize ()
 reset the m_iosize data member More...
 
int iosize () const
 get the total bytes of data in m_buffer More...
 
int current () const
 get the current read position within m_buffer More...
 
char * buffer () const
 get m_buffer More...
 
int recno () const
 number of logical records read/written More...
 
const char * fname () const
 name of file associated with I/O stream, if applicable More...
 
int close_file (fitsfile *fptr, int *status)
 fits_close_file() does not work for reasons that the file pointer does not have the knowledge of chdu which were written with write_hdr() not write_***_hdr(). More...
 
int fdes () const
 file descriptor associated with I/O stream, if applicable More...
 
fitsfile * getfptr () const
 get the fitsfile pointer More...
 
void setfptr (fitsfile *ffp)
 

Additional Inherited Members

- Public Types inherited from casacore::BlockIO
enum  IOErrs {
  OK,
  NOSUCHFILE,
  NOMEM,
  OPENERR,
  CLOSEERR,
  READERR,
  WRITEERR
}
 error return code More...
 
- Protected Member Functions inherited from casacore::BlockIO
 BlockIO (const char *, int, int, int=1, FITSErrorHandler errhandler=FITSError::defaultHandler)
 Construction can be done either from a filename with open options or from a file descriptor. More...
 
 BlockIO (int, int, int=1, FITSErrorHandler errhandler=FITSError::defaultHandler)
 
virtual ~BlockIO ()
 
void errmsg (IOErrs, const char *)
 set the error message and error number for later recovery More...
 
- Protected Attributes inherited from casacore::BlockIO
char * m_filename
 
int m_options
 
const int m_recsize
 
const int m_nrec
 
const int m_blocksize
 
FITSErrorHandler m_errfn
 
IOErrs m_err_status
 
int m_fd
 
char * m_buffer
 
int m_block_no
 
int m_rec_no
 
int m_current
 
int m_iosize
 size of record in buffer More...
 
fitsfile * m_fptr
 using fitsfile structure from cfitsio of NASA More...
 

Detailed Description

fixed-length blocked sequential input base class

Prerequisite

Definition at line 139 of file blockio.h.

Constructor & Destructor Documentation

casacore::BlockInput::BlockInput ( const char *  ,
int  ,
int  = 1,
FITSErrorHandler  errhandler = FITSError::defaultHandler 
)

Construction can be done either from a filename or from a file descriptor.

The remaining arguments are the the logical record size and number of records that make up a physical record followed by the output stream that is used to write error messages to.

casacore::BlockInput::BlockInput ( int  ,
int  ,
int  = 1,
FITSErrorHandler  errhandler = FITSError::defaultHandler 
)
virtual casacore::BlockInput::~BlockInput ( )
virtual

Member Function Documentation

virtual char* casacore::BlockInput::read ( )
virtual

read the next logical record or first skip N logical records and then read the next one.

(note it is not possible to skip a record without reading a record).
Caution: these functions return a pointer to an internal record; The user must make sure that after destruction of this class no dangling pointers are left;

virtual char* casacore::BlockInput::skip ( int  )
virtual

Reimplemented in casacore::FitsDiskInput.


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