![]() |
|
![]() |
--*
-- GroupData.
--
--
-- Allows usage of large amounts of data by writing streams of data
-- to a file, and combining the streams into groups so that the
-- elements may be retrieved or summed in streams and across groups.
--
ERROROK : constant := 0;
ERRORNOMEMORY : constant := 1;
ERRORCACHENOTOPEN : constant := 2;
ERRORDATANOTDEFINED : constant := 3;
ERRORDATAISREADONLY : constant := 4;
ERRORDATAFILENOTFOUND : constant := 5;
ERRORMAXNUMBEROFSTREAMSEXCEEDED : constant := 6;
ERRORMAXNUMBEROFGROUPSEXCEEDED : constant := 7;
ERRORMAXNUMBEROFSTREAMSPERGROUPEXCEEDED : constant := 8;
ERRORINVALIDDATAFILE : constant := 9;
ERRORCACHEDISKERROR : constant := 10;
ERRORNOSTREAMSDEFINED : constant := 11;
ERRORINVALIDGROUPNUMBER : constant := 12;
ERRORINVALIDELEMENTNUMBER : constant := 13;
type DPData is private;
type DEMode is (readWrite, -- allow reading and writing
ReadOnly, -- allow reading only
writeOnly); -- delete existing file
procedure CloseData
(Data : in out DPData;
save : in boolean);
--*
-- CloseData - closes the data file.
--
--
-- Closes the file associated with the handle 'data'.
--
-- CALLING SEQUENCE -
--
-- CloseData (data, save);
--
-- ENTRY -
--
-- data : DPData
-- A handle to the data file.
--
-- save : BOOLEAN
-- FALSE if the data file is to be deleted after closing.
--
procedure DefineDataStream
(Data : in DPData;
dataStream : in ModSys.Float64_U_Array;
Count : in ModSys.S_Natural;
Append : in boolean);
--*
-- DefineDataStream - add data stream to the data file 'data'.
--
--
-- Adds the values in dataStream to the data file
--
-- CALLING SEQUENCE -
--
-- DefineDataStream (data, dataStream, count, append);
--
-- ENTRY -
--
-- data : DPData
-- A handle to the data file
--
-- dataStream : ModSys.Float64_u_array
-- An array of numbers to be added to the file
--
-- count : ModSys.S_Natural
-- The number of elements in 'dataStream'
--
-- append : BOOLEAN
-- TRUE if 'dataStream' is to added to the last defined stream.
-- FALSE if 'dataStream' is to be created as a new stream,
--
-- EXIT -
--
-- groupDataError : ModSys.S_Natural
-- Non-zero if an error occurred
-- Use "GetGroupDataError" to retrieve the error status.
--
procedure DefineGroup
(Data : in DPData;
groupList : in ModSys.Integer_U_Array;
Count : in ModSys.S_Integer;
groupHandle : in out ModSys.S_Integer);
--*
-- DefineGroup - define a group of data streams.
--
--
-- Defines a group, a collection of any previously declared data streams.
--
-- CALLING SEQUENCE -
--
-- DefineGroup (data, groupList, count, groupHandle);
--
-- ENTRY -
--
-- data : DPData
-- A handle to the data file
--
-- groupList : ModSys.Longint_u_array
-- An array of the stream indexes to be included in the
-- group. The first defined stream has an index of 1
--
-- count : ModSys.S_Integer
-- The number of indexes in groupList
--
-- EXIT -
--
-- groupHandle : ModSys.S_Integer
-- A number specifying the group number assigned to the
-- specified group. This should return a 1 on the first
-- defined group.
--
-- groupDataError : ModSys.S_Natural
-- Non-zero if an error occurred
-- Use "GetGroupDataError" to retrieve the error status.
--
procedure DeleteAllGroups
(Data : in DPData);
--*
-- DeleteGroup - define a group of data streams.
--
--
-- Removes all previously defined data streams.
--
-- CALLING SEQUENCE -
--
-- DefineGroup (data);
--
-- ENTRY -
--
-- data : DPData
-- A handle to the data file
--
-- EXIT -
--
-- groupDataError : natrual
-- Non-zero if an error occurred.
-- Use "GetGroupDataError" to retrieve the error status
--
function GetGroupDataError
(Data : in DPData) return ModSys.S_Natural;
--*
-- GetGroupDataError - Get error status and reset.
--
--
-- This procedure gets and returns the current error status of GroupData.
-- In addition it sets the GroupData's error status to GroupData.ERROROK.
--
-- CALLING SEQUENCE -
--
-- error := GetGroupDataError (data);
--
-- ENTRY -
--
-- data : DPData
-- A handle to the data file
--
-- EXIT -
--
-- error : ModSys.S_Integer
-- The current error status of SGK.
--
-- The GroupData's error status is set to GroupData.ERROROK.
--
function GetDataElement
(Data : in DPData;
GroupNumber : in ModSys.S_Integer;
streamNumber : in ModSys.S_Integer;
ElementNumber : in ModSys.S_Integer) return ModSys.S_Float64;
--*
-- GetDataElement - get a data element from a data file.
--
--
-- Allows access to the defined streams in a data file via the group number,
-- the stream index in that group, and the element index in that stream.
-- Streams must have already been defined, and assigned to the group being
-- accessed.
--
-- CALLING SEQUENCE -
--
-- dataelement := GetDataElement (data,
-- groupNumber,
-- streamNumber,
-- elementNumber);
--
-- ENTRY -
--
-- data : DPData
-- A handle to a data file
--
-- groupNumber : ModSys.S_Integer
-- The index of the group
--
-- streamNumber : ModSys.S_Integer
-- The index of the stream in the group
--
-- elementNumber : ModSys.S_Integer
-- The index of the element in the stream
--
-- EXIT -
--
-- function : Modsys.S_Float64
-- The specified element
--
procedure GetMaxNumberOfElementsInGroup
(Data : in DPData;
GroupNumber : in ModSys.S_Integer;
maxNumberOfElements : in out ModSys.S_Integer);
--*
-- GetMaxNumberOfElementsInGroup - get number of elements.
--
--
-- Get the number of elements in the largest stream of a group.
--
-- CALLING SEQUENCE -
--
-- GetMaxNumberOfElementsInGroup (data,
-- groupNumber,
-- maxNumberOfElements);
--
-- ENTRY -
--
-- data : DPData
-- A handle to the data file
--
-- groupNumber : ModSys.S_Integer
-- The number assigned to the group in defineGroup
--
-- EXIT -
--
-- maxNumberOfElements : ModSys.S_Integer
-- The number of elements in the largest stream in a group
--
procedure GetNumberOfDataStreamsInGroup
(Data : in DPData;
GroupNumber : in ModSys.S_Integer;
numberOfDataStreams : in out ModSys.S_Integer);
--*
-- GetNumberOfDataStreamsInGroup - Get data streams count.
--
--
-- CALLING SEQUENCE -
--
-- GetNumberOfDataStreamsInGroup (data,
-- groupNumber,
-- numberOfDataStreams);
--
-- ENTRY -
--
-- data : DPData
-- A handle to the data file
--
-- groupNumber : ModSys.S_Integer
-- The number assigned to the group in defineGroup
--
-- EXIT -
--
-- numberOfDataStreams : ModSys.S_Integer
-- The number of data streams in the group
--
procedure GetNumberOfDefinedDataStreams
(Data : in DPData;
numberOfDataStreams : in out ModSys.S_Integer);
--*
-- GetNumberOfDefinedDataStreams - Get data streams count.
--
--
-- CALLING SEQUENCE -
--
-- GetNumberOfDefinedDataStreams (data, numberOfDataStreams);
--
-- ENTRY -
--
-- data : DPData
-- A handle to the data file
--
-- EXIT -
--
-- numberOfDataStreams : ModSys.S_Integer
-- The number of streams in the data file
--
procedure GetNumberOfDefinedGroups
(Data : in DPData;
numberOfGroups : in out ModSys.S_Integer);
--*
-- GetNumberOfDefinedGroups - Get defined groups count.
--
--
-- CALLING SEQUENCE -
--
-- GetNumberOfDefinedGroups (data, numberOfGroups);
--
-- ENTRY -
--
-- data : DPData
-- A handle to the data file
--
-- EXIT -
--
-- numberOfGroups : ModSys.S_Integer
-- The number of groups in the data file
--
procedure GetStorageLimits
(MaxNumberOfGroups : in out ModSys.S_Integer;
maxNumberOfStreams : in out ModSys.S_Integer;
maxNumberOfStreamsPerGroup : in out ModSys.S_Integer);
--*
-- GetStorageLimits - get the capacities of the groupData storage.
--
--
-- CALLING SEQUENCE -
--
-- GetStorageLimits (maxNumberOfGroups,
-- maxNumberOfStreams,
-- maxNumberOfStreamsPerGroup);
--
-- EXIT -
--
-- maxNumberOfGroups : ModSys.S_Integer
-- The maximum allowable groups
--
-- maxNumberOfStreams : ModSys.S_Integer
-- The maximum allowable streams
--
-- maxNumberOfStreamsPerGroup : ModSys.S_Integer
-- The maximum allowable streams per group
--
procedure OpenData
(Data : out DPData;
FileName : in string;
mode : in DEMode);
--*
-- OpenData - Opens data file for use with the GroupData routines.
--
--
-- Opens the data file under the mode 'mode' which can be either 'readWrite' or
-- 'readOnly'. This command must be executed before any other routine in this
-- package can be used.
--
-- CALLING SEQUENCE -
--
-- OpenData (data, fileName, mode);
--
-- ENTRY -
--
-- fileName : string
-- A valid dos filename naming the desired file. The file will
-- be created if mode = readWrite. An error will be returned
-- if mode=readOnly and fileName does not exist. An error
-- will be returned if fileName does exist but is not in the
-- proper format.
--
-- mode : DEMode
-- The mode (readWrite or readOnly) in which the file to be opened.
--
-- EXIT -
--
-- data : DPData
-- A handle to the data file.
--
-- groupDataError : ModSys.S_Natural
-- Non-zero if an error occurred
-- Use "GetGroupDataError" to retrieve the error status
--
procedure SetStorageLimits
(MaxNumberOfGroups : in ModSys.S_Integer;
maxNumberOfStreams : in ModSys.S_Integer;
maxNumberOfStreamsPerGroup : in ModSys.S_Integer);
--*
-- SetStorageLimits - set the capacities of the groupData storage.
--
--
-- CALLING SEQUENCE -
--
-- SetStorageLimits (maxNumberOfGroups,
-- maxNumberOfStreams,
-- maxNumberOfStreamsPerGroup);
--
-- ENTRY -
--
-- maxNumberOfGroups : ModSys.S_Integer
-- The number of groups to be allowed
--
-- maxNumberOfStreams : ModSys.S_Integer
-- The number of streams to be allowed
--
-- maxNumberOfStreamsPerGroup : ModSys.S_Integer
-- The number of streams per group to be allowed
--
procedure SumGroupElements
(Data : in DPData;
GroupNumber : in ModSys.S_Integer;
startIndex : in ModSys.S_Integer;
endIndex : in ModSys.S_Integer;
Sum : in out ModSys.S_Float64);
--*
-- SumGroupElements - Sum the elements across streams.
--
--
-- Adds all numbers in all streams in group 'groupNumber' with element indexes
-- between 'startIndex' and 'endIndex'
--
-- CALLING SEQUENCE -
--
-- SumGroupElements (data,
-- groupNumber,
-- startIndex,
-- endIndex,
-- sum);
--
-- ENTRY -
--
-- data : DPData
-- A handle to the data file
--
-- groupNumber : ModSys.S_Integer
-- The group number to be used
--
-- startIndex : ModSys.S_Integer
-- The starting index of the elements to be added
--
-- endIndex : ModSys.S_Integer
-- The ending index of the elements to be added
--
-- EXIT -
--
-- sum : Modsys.S_Float64
-- The sum of the elements
--
procedure SumGroupStream
(Data : in DPData;
GroupNumber : in ModSys.S_Integer;
streamNumber : in ModSys.S_Integer;
startIndex : in ModSys.S_Integer;
endIndex : in ModSys.S_Integer;
Sum : in out ModSys.S_Float64);
--*
-- SumGroupStream - sums elements in one stream.
--
--
-- CALLING SEQUENCE -
--
-- SumGroupStream (data,
-- groupNumber,
-- streamNumber,
-- startIndex,
-- endIndex,
-- sum);
--
-- ENTRY -
--
-- data : DPData
-- A handle to the data file
--
-- groupNumber : ModSys.S_Integer
-- The group number containing the stream to be summed
--
-- streamNumber : ModSys.S_Integer
-- The stream number containing the elements to be summed
--
-- startIndex : ModSys.S_Integer
-- The starting index of the elements to be summed
--
-- endIndex : ModSys.S_Integer
-- The ending index of the elements to be summed
--
-- EXIT -
--
-- sum : REAL
-- The sum of the elements
--
Send mail to
warren.merrill@inl.gov
with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance