GBTOlib: library for evaluation of molecular integrals in mixed Gaussian / B-spline basis  111
Public Member Functions | Public Attributes | List of all members
data_file_gbl::data_file_obj Module Reference

This object provides access to the data stored on the data file. The first record on the file is the identifier given by the constant data_file_obj_id. The next record is the number of data sets (headers) stored on the file. After that the header of the first (if any) data set follows. More...

Public Member Functions

procedure open => open_data_file
 Opens the file for stream access given its path. If the file does not exist then a new one is created, otherwise the file is opened in the append mode and the existing headers for the data sets are read-in and printed out on screen. More...
 
procedure get_unit_no => return_unit_no
 Returns the unit number associated with the file. More...
 
procedure get_file_name => return_path
 Returns the path associated with the file. More...
 
procedure start_record => start_header_record
 Writes a new header on the file and returns the value first_record which belongs to the new header. This value can be used by other routines to write the actual data to the file starting on the position first_record. Each record must be terminated by a call to close_record with the values corresponding to the starting and final positions of the actual data record. More...
 
procedure close_record => close_header_record
 Completes the given record given its header and the positions of the start and end of the data record. More...
 
procedure remove_last_record
 Removes the last header from the file: this can be useful when working with files that contain a broken last record. More...
 
procedure print_headers => print_header_records
 Prints on the screen the header data. More...
 
procedure find_header => find_data_start
 Attempts to find the specified header and returns the positions of start and end of the corresponding data record. More...
 
procedure get_header_containing => get_data_header_containing_strings
 Returns the header containing the specified strings. Returns 0 if a unique matching header has been found and returns a non-zero number (error number) if not. More...
 
procedure get_header => get_data_header
 Returns the header with the given sequence number. More...
 
procedure get_no_headers => get_headers
 Returns the number of headers on the file. More...
 
procedure close => close_data_file
 Closes the data file. More...
 

Public Attributes

character(len=line_len) identifier
 Data file version. More...
 

Detailed Description

This object provides access to the data stored on the data file. The first record on the file is the identifier given by the constant data_file_obj_id. The next record is the number of data sets (headers) stored on the file. After that the header of the first (if any) data set follows.

Warning
All read/write operations on the associated file are performed only by the master process. What the master has read-in is broadcast to the other processes. Any other routines added to this object in the future must work in the same way.

Member Function/Subroutine Documentation

◆ close()

procedure data_file_gbl::data_file_obj::close

Closes the data file.

◆ close_record()

procedure data_file_gbl::data_file_obj::close_record

Completes the given record given its header and the positions of the start and end of the data record.

◆ find_header()

procedure data_file_gbl::data_file_obj::find_header

Attempts to find the specified header and returns the positions of start and end of the corresponding data record.

◆ get_file_name()

procedure data_file_gbl::data_file_obj::get_file_name

Returns the path associated with the file.

◆ get_header()

procedure data_file_gbl::data_file_obj::get_header

Returns the header with the given sequence number.

◆ get_header_containing()

procedure data_file_gbl::data_file_obj::get_header_containing

Returns the header containing the specified strings. Returns 0 if a unique matching header has been found and returns a non-zero number (error number) if not.

◆ get_no_headers()

procedure data_file_gbl::data_file_obj::get_no_headers

Returns the number of headers on the file.

◆ get_unit_no()

procedure data_file_gbl::data_file_obj::get_unit_no

Returns the unit number associated with the file.

◆ open()

procedure data_file_gbl::data_file_obj::open

Opens the file for stream access given its path. If the file does not exist then a new one is created, otherwise the file is opened in the append mode and the existing headers for the data sets are read-in and printed out on screen.

Todo:
The unit number associated to the file should be returned by this function - this will allow me to get rid of get_unit_no below.

◆ print_headers()

procedure data_file_gbl::data_file_obj::print_headers

Prints on the screen the header data.

◆ remove_last_record()

procedure data_file_gbl::data_file_obj::remove_last_record

Removes the last header from the file: this can be useful when working with files that contain a broken last record.

◆ start_record()

procedure data_file_gbl::data_file_obj::start_record

Writes a new header on the file and returns the value first_record which belongs to the new header. This value can be used by other routines to write the actual data to the file starting on the position first_record. Each record must be terminated by a call to close_record with the values corresponding to the starting and final positions of the actual data record.

Member Data Documentation

◆ identifier

character(len=line_len) data_file_gbl::data_file_obj::identifier

Data file version.


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