NeoPZ
Public Member Functions | Protected Attributes | List of all members
TDatafile Class Referenceabstract

TDatafile is a virtual class from which classes with different data formats can be derived. Getting Data. More...

#include <pzdatafi.h>

Public Member Functions

 TDatafile (char *fn)
 Constructor with filename of the data to import. More...
 
int Error ()
 Returns if could opening or not the data file. More...
 
virtual ~TDatafile ()
 Destructor. More...
 
virtual short Read (TCompGrid &malha)=0
 To import data into computational mesh. More...
 

Protected Attributes

filebuf fBuffer
 File from import data. More...
 
istream fData
 Data. More...
 
char fFilename [256]
 File name. More...
 
int fFileError
 Flag to report if the file is opening. More...
 

Detailed Description

TDatafile is a virtual class from which classes with different data formats can be derived. Getting Data.

Author
Jose Sergio Rodrigues Alves Filho
Philippe Remy Bernard Devloo The purpose of the datafile class is to facilitate the opening of an input stream and defines the methods used to read a grid.
ERRORS:
The length of the parameter fn in the constructor is not checked before being copied into filename. This may lead to system crashes...
Warning
If the input stream could not be opened, the file_error parameter is set to TRUE.
It is up to the programmer of the derived class to check this data when writing the read method.
IMPROVEMENTS:
The filename variable could be allocated dynamically to fit any filename length (Who? When?)

Definition at line 39 of file pzdatafi.h.

Constructor & Destructor Documentation

◆ TDatafile()

TDatafile::TDatafile ( char *  fn)
inline

Constructor with filename of the data to import.

Definition at line 54 of file pzdatafi.h.

◆ ~TDatafile()

virtual TDatafile::~TDatafile ( )
inlinevirtual

Destructor.

Definition at line 66 of file pzdatafi.h.

References Read().

Member Function Documentation

◆ Error()

int TDatafile::Error ( )
inline

Returns if could opening or not the data file.

Definition at line 64 of file pzdatafi.h.

References fFileError.

◆ Read()

virtual short TDatafile::Read ( TCompGrid &  malha)
pure virtual

To import data into computational mesh.

Referenced by ~TDatafile().

Member Data Documentation

◆ fBuffer

filebuf TDatafile::fBuffer
protected

File from import data.

Definition at line 43 of file pzdatafi.h.

◆ fData

istream TDatafile::fData
protected

Data.

Definition at line 45 of file pzdatafi.h.

◆ fFileError

int TDatafile::fFileError
protected

Flag to report if the file is opening.

Definition at line 49 of file pzdatafi.h.

Referenced by Error().

◆ fFilename

char TDatafile::fFilename[256]
protected

File name.

Definition at line 47 of file pzdatafi.h.


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