PAL CARD CATALOG ENTRY

SHORT DESCRIPTION

Sequential access to records


MOVEMENT WITHIN THE PAL CARD CATALOG
Move to top-level taxonomy
Move to keyword list

ASSET PROFILE

UNIT NAME
Sequential_File_Manager
VERSION
1
REVIEW CODE
C1 1.0 A
INET ADDRESS
sun1.disacim.osd.mil (134.152.9.140)
AUTHOR
Retired Army Personnel Systems
Software Development Center
Washington, D.C.
RIGHTS
Approved for Public Release; Distribution Unlimited
COPYRIGHT
None -- Public Domain.
DATE CREATED
July 2, 1991
DATE RELEASED
January 17, 1994
DATE LAST UPDATED
January 17, 1994
LOCATION
DSRS Library
PAL
ENVIRONMENT
DEC MICROVAX II with DEC Ada Version 2.0.
LIMITATIONS
Not documented in PAL database
CERTIFICATION
Ada System Certifier_1 1.0
Date/Time of Processing: Wednesday 25 May       1994 02:28:59Pm
Overall Assessment of System: OK
Classification of System: A
Basis of Classification --
Syntax Errors                               PASS
Completeness                                PASS
Independence from External Libraries        PASS
Independence from a Specific Ada Compiler   PASS

Number of ...
Files               1
Library Units       2
Lines             730
Statements         60
Comments          563

FILE LISTING

Directory Display


languages/ada/swcomps/dsrs/seqfile:
  File Name                 Size
  ---------                 ----
  seqfile.zip             44,150


Totals
  ==============  ==============
    1 Files               44,150

ABSTRACT

                        Sequential_File_Manager
                              01D001P0.1
                          (Old ID: WIA0001A)
PURPOSE/INTENDED USE:
Sequential_File_Manager is an Ada generic package that provides
subprograms for creating and maintaining files of sequential access. 
The subprograms of this package support read or write access to a
sequential file, with the data format and file name provided by the
user.  The user instantiates the package for the set of generic actual
parameters, file name, access mode and record type, needed for the
application.  Any additional operations needed can be built out of the
operations provided in this package. 

EXAMPLE APPLICATIONS:
Reuse of this package would be valuable to any application that needs to
perform basic sequential I/O against a single file.  There is only one
file associated with the instantiation of Sequential_File_Manager. 
Unlike the Ada predefined package Sequential_Io, this package
protects/constrains the sequential file to be either read or write
access throughout the application. Another feature is the exception
names.  The exceptions are more explanatory than Sequential_Io
exceptions, and reflect the particular error. 

An example of an instantiation of this package for an application that
stores a list of names and addresses is as follows: 

   Let the types be defined as follows:
      type Address_Record is 
         record
            Last_Name: STRING (1..20);
            First_Name   : STRING (1..15);
            Address_1: STRING (1..20);
            Address_2: STRING (1..20);
            City : STRING (1..15);
            State: STRING (1..10);
            Zip_Code : INTEGER range 01000..70000 := 01000;
       end record;
   Instantiate Sequential_File_Manager as follows:
      package Basic_IO is new Sequential_File_Manager 
         (File_Name   => "Basic_File.Dat",
          Read_Access => TRUE,
          Record_Type => Address_Record);

CERTIFICATION LEVEL:
Sequential_File_Manager is certified at Level 4.  This means that the
Defense  Information Systems Agency/Center for Information Management
Software Reuse  Program (SRP) management office has successfully
compiled the code of this  Reusable Software Asset (RSA) and measured
maintainability, portability,  reliability and reusability.  In
addition, this RSA includes a test suite and a  Reuser's Manual, which
will be provided when the asset is extracted. 
 
IMPLEMENTATION ISSUES:
Sequential_File_Manager depends on (withs) the Ada predefined generic
package Sequential_Io.

Sequential_File_Manager may be instantiated using the following generic
formal parameters: 
   File_Name   : STRING := "Sequential_File";
   -- Provides the file name for the sequential data file to be manipulated.
   Read_Access : BOOLEAN := TRUE;
   -- Determines whether the sequential data file is read or write access.
   type RECORD_TYPE is private;
   -- Provides the record type to be accessed in the sequential data file.

Sequential_File_Manager provides subprograms to create and maintain a
sequential file with a specified record type and access mode.  The
reuser must provide the record type.  The access mode can be either read
or write, but not read/write. The file's name, access mode, and record
type can only be specified at instantiation time, therefore the reuser
needs one instance per file, access type or record type. 

Sequential_File_Manager defines the exceptions File_Already_Open,
File_Is_Not_Open, File_Cannot_Be_Deleted, Invalid_File_Name,
Invalid_File_Mode, Invalid_Record_Type, Read_Only_File, Write_Only_File,
Record_Cannot_Be_Read, and Exceeded_File_Capacity. 

HARDWARE/ENVIRONMENT CONSTRAINTS AND LIMITATIONS:
Sequential_File_Manager was compiled, run and tested on the DEC MICROVAX
II with DEC Ada Version 2.0.

SUBUNITS:
The file-related subprograms provided by Sequential_File_Manager are:
   Create_File    Creates a file for sequential data storage.
   Open_File      Opens a file for sequential data storage/access.
   Close_File     Closes a sequential data file.
   Delete_File    Deletes a sequential data file.
  
The data-related operations provided by Sequential_File_Manager are:
   Write_Record   Stores a data record to the sequential file.
   Read_Record    Reads a data record from the sequential file.
   End_Of_File    Determines if the sequential data file has any records
                  left to read.

DSRS CLASSIFICATION:
algorithm:  sequential
availability:  extractable
certification level:  level_4
component type:  implementation
data representation:  string
environment:  mvii/vms/vaxada
function:  close
function:  create
function:  delete
function:  get
function:  input/output
function:  input_output
function:  open
function:  put
function:  remove
function:  sequential
function:  store
function:  verify
language:  ada
object:  file
originator:  raps
unit type:  generic_package
unit type:  package

LEGAL RESTRICTIONS:
This RSA contains public domain data with unlimited rights for all
users.   Extraction is permitted to all authorized library users. This
software and its documentation are provided "as is" and without any
expressed or implied warranties whatsoever.  No warranties as to
performance, merchantability, or fitness for a particular purpose exist.

The user is advised to test the software thoroughly before relying on
it.  The user must assume the entire risk and liability of using this
software.  In no event shall any person or organization of people be
held responsible for any direct, indirect, consequential or
inconsequential damages or lost profits. 

MISCELLANEOUS:
The standard for Level 4 certification has recently been upgraded. This
asset is currently undergoing modification to meet the new Level 4
requirements. 


REVISION HISTORY

January 17, 1994 Version 1 Original submission to PAL


RELEASE NOTICE

This prologue must be included in all copies of this software.
Restrictions on use or distribution:  NONE

LEGAL RESTRICTIONS:
This RSA contains public domain data with unlimited rights for all
users.   Extraction is permitted to all authorized library users. This
software and its documentation are provided "as is" and without any
expressed or implied warranties whatsoever.  No warranties as to
performance, merchantability, or fitness for a particular purpose exist.


DISCLAIMER

 This software and its documentation are provided "AS IS" and
without any expressed or implied warranties whatsoever.  No warranties
as to performance, merchantability, or fitness for a particular
purpose exist.
 The user is advised to test the software thoroughly before
relying on it.  The user must assume the entire risk and liability of
using this software.  In no event shall any person or organization of
people be held responsible for any direct, indirect, consequential or
inconsequential damages or lost profits.