/
gmSCMemorySequenceClass
gmSCMemorySequenceClass
Mark Juras
Owned by Mark Juras
The MemorySequence Service Class
The service class MemorySequence manages memory based sequences. No matter how carefully an information system is laid out, to be persistent, there must ultimately be some variable length sequences of information vectors which must be stored in memory -- this can be symbol table information, virtual page control information, or whatever other set of information is needed. A memory sequence consists of a set of ordered relatively short fixed-length records numbered from 1 to n, where n is the number of records in the set. They are completely memory based and have no upper limit other than that imposed by the platform limits. Conceptually, the records of a sequence are viewed as records within a linear vector with no upper bound. The algorithmic problem is that since multiple sequences must share the same linear addressing scheme, each sequence must be blocked, and the addresses of those blocks must be retained in higher level blocks.The method MemorySequence_Access
PrototypeUBYTE* MemorySequence_Access(void* This,int uSequence);
Parameter | Description |
This | Specifies the handle of the control structure for the sequence as returned by the MemorySequence_Create method. |
uSequence | specifies the sequence number of the desired record or zero if a new record is to be added. |
The only possible error condition that can be encountered by this method is insufficient memory to create a new block. If this occurs, then it returns a NULL; else it returns a pointer to the record whose number was specified.
The method MemorySequence_Create
Prototypevoid* MemorySequence_Create(int iBlockSize,int iRecordSize);
Parameter | Description |
iBlockSize | Specifies the size of each memory block to be used to store the actual records in the sequence and the control blocks needed to locate records by their record numbers. |
iRecordSize | specifies the size of each record stored in the sequence. |
This method returns the handle to the control structure for the sequence or a NULL if the control structure cannot be created. The only possible cause of a create failure is insufficient memory available to the process.
The method MemorySequence_Destroy
Prototypevoid MemorySequence_Destroy(void* This);
Parameter | Description |
This | Specifies the handle of the control structure for the sequence as returned by the method MemorySequence_Create. |
The method has no return value.
The method MemorySequence_GetSize
Prototypeint MemorySequence_GetSize(void* This);
Parameter | Description |
This | Specifies the handle of the control structure for the sequence as returned by the method MemorySequence_Create. |
The methods returns the number of records in the sequence.
Table of Contents
, multiple selections available,