gmslAPI
0.1
gmslAPI: An API for Developing Upgrade Solutions using Great Migrations Technology
|
The Store Class contains the methods needed to manage data organized into hierarchical fields and records. When dealing with language processing, program storage must be viewed as containing a wide variety of different structures; indexes, lists, fixed records, long unformatted records, variable length strings, and so on. In addition, it may be purely memory bound or it may be stored in a persistent file system. The role of this service class is to provide a single interface for storing and retrieving information. It is sufficiently robust to allow for the management of large files in the multiple gigabyte size range, while it is still efficient for use by purely memory bound applications. More...
Static Public Member Functions | |
static int | AddGlobal (int root, int global) |
The method AddGlobal adds the root offset of a component, indexed by its parent to a global index maintained within the storage area. This entry declares that the child component has global scope if and only if the parent component is an active reference. More... | |
static void | Close () |
The Close method closes the current storage area if that area is currently open. It does not change the currently selected storage area. More... | |
static int | Create (string fileName, StorageUnit iUnit) |
The Create method selects the indicated storage unit and initializes it as a new empty area whose content will be optionally paged into a specified file. Any information currently in the storage are will be lost. Until another storage unit is selected via one of the three methods – Select,Create, or Open – all storage requests will be directed to this currently selected storage unit. More... | |
static int | DeltaVector (int root) |
The DeltaVector method gets a handle to a component information vector in the current storage area that it intends to change. In particular, this method gives read/write access to the information vector associated with the component whose root offset is specified via the integer root parameter. If there is any question about the type of component being accessed or about the validity of the root offset value, use the GetObjectType method first (see the discussion there). Use the GetVector method if the vector is simply to be read. The actual handle is optimized to make the retrieval of the component information as efficient as possible. As such it should only be used locally and should be refreshed after any other storage intensive operations have been performed. To use DeltaVector the storage area being accessed has to have been opened using a CREATE or APPEND action. More... | |
static int | FindFirstChild (int[] levels, int iRoot) |
The FindFirstChild method initiates a depth first or preorder search of the symbol tree. More... | |
static int | FindNextChild (int[] levels) |
The FindNextChild method continues a depth first or preorder search of the symbol tree. More... | |
static int | FindRoot (string Identifier) |
The FindRoot method finds an identified symbol root. This method searches the base index of the symbol table for a specified identifier and returns its root. This root is unique for each identifier. More... | |
static int | FindVector (string Identifier, int Parent) |
The method FindVector searches a single branch within the hierarchical symbol table for a for a component with the identifier specified by the string identifier parameter. More... | |
static string | GetDataName () |
The method GetDataName gets the name of the current storage area. When a file-based storage area is created or opened its name is stored in the storage control structure. More... | |
static int | GetFirst (int parent) |
The method Store_GetFirst returns the root of the first child of a parent component or of the root branch. This is the first component entered for the parent. In general, using this method in conjunction with the GetNext method, will generate the sequence of components stored within some branch of the symbol table in their defined order. More... | |
static int | GetGlobals (int symbolRoot, int[] globals, int nGlobal) |
The method GetGlobals returns the (global, root) pairs added to a symbol identifier via the AddGlobal method. The description of that method contains a detailed description of these pairs. More... | |
static int | GetHandle () |
The method GetHandle gets the long memory handle of the current storage area. All storage areas are maintained within a long memory area. Though most access needs for that memory area are provided internally, it is occasionally necessary to use one of the specialized stream access methods directly. More... | |
static string | GetIdent (int root) |
The method GetIdent gets the source identifier of a component via its root address. By definition, the "identifier" is the original identifier that was associated with the component when it was first placed in the symbol table. See the SetName and GetName methods for information about changing how components are assigned alternative target identifiers. More... | |
static int | GetInfo (int offset, int[] info) |
The method GetInfo reads short blocks of information that were initially written using the method WriteInfo. A physical read is not required, since these short blocks do not cross block boundaries; however, in some instances reading them is needed to avoid downstream memory page faults. The most common use of this method is to read the list of interfaces associated with a class. More... | |
static int | GetLength (int offset) |
The method GetLength returns the overall length in words of the current storage area or of an information vector stored in the area. More... | |
static string | GetName (int root) |
The method GetName gets the target identifier of a component via its root offset. Every component has two string representations – its source "identifier" which the original identifier that was associated with the component when it was first placed in the symbol table and its target "name" that was assigned to it directly via the SetName method. If no name has been assigned to the component, then its name is the same as its identifier. Whenever a reference to a component is authored its name is used, but any retrieval of the component is always done via its identifier. More... | |
static int | GetNext (int child) |
The method GetNext returns the next child of a parent component or of the root branch. This is the next component entered for the parent. In general, using this method in conjunction with the GetFirst method, will generate the sequence of components stored within some branch of the symbol table in their defined order. More... | |
static int | GetObjectType (int root) |
The method GetObjectType returns the symbol table object type code of a component. Whenever a component is entered into the symbol table, it is assigned an integer object type code. Each object type code has associated with it a fixed-length information vector used to describe components of the specified type. In the case of the tool the type code is either an entry number from the ObjectType enumeration, the opcode value of a built-in control if the component is a built-in control, or the root offset of an external class if the object is a of that external class. More... | |
static int | GetParent (int child) |
The method GetParent returns the root offset of the parent of a component whose offset is specified. More... | |
static string | GetString (int offset) |
The method GetString returns a string from the current storage area via its offset. More... | |
static int | GetSymbols (string Identifier) |
The method GetSymbols returns the root offset of a sequence that contains the root offsets of all symbols whose identifier matches a specified string. The tool's symbol table has a tree structure. The symbols within the tree need be unique along one branch only. As a result of this, there can be many duplicates in the symbol table. The roles of the symbol retrieval methods are to search the symbol tree for the correct occurrence of an identifier given a current parent context. More... | |
static int | GetVector (int root) |
The GetVector method gets a handle to a component information vector in the current storage area that it intends to access only. In particular, this method gives reade access to the information vector associated with the component whose root offset is specified via the integer root parameter. If there is any question about the type of component being accessed or about the validity of the root offset value, use the GetObjectType method first (see the discussion there). Use the DeltaVector method if the vector is to be changed. The actual handle is optimized to make the retrieval of the component information as efficient as possible. As such it should only be used locally and should be refreshed after any other storage intensive operations have been performed. More... | |
static int | IsNull (int handle) |
The method IsNull checks a handle retrieved from storage to determine if it is linked to a valid information vector. More... | |
static int | Open (string fileName, StorageUnit iUnit, bool append) |
The Open method opens an exiting file into a storage area. In particular it makes the indicated storage area the current one and initializes it with the contents of an existing file. Any information currently in the storage area will be lost. Until another storage area is selected via one of the three methods Select, Create, Open all storage requests will be directed to this currently selected storagearea. More... | |
static int | ReadInfo (tCodeBlock info, int offset) |
The method ReadInfo reads long blocks of information that were initially written using the method WriteInfo. A physical read is required, since these information vectors may cross block boundaries. The most common use of this method is to read the intermediate code associated with a component, though it may be used for any type of information. More... | |
static int | ReadInfo (int[] info, int offset) |
static void | RewriteInfo (tCodeBlock info, int nByte, int offset) |
The method RewriteInfo rewrites long blocks of information that were initially written using the method WriteInfo. A physical rewrite is required, since these information vectors may cross block boundaries. The most common use of this method is to rewrite the intermediate code associated with a component after it has been migrated, though it may be used for any type of information. More... | |
static void | RewriteInfo (int[] info, int nByte, int offset) |
static void | Select (int iUnit) |
The method Select selects one the available storage areas as the current storage area. All successive storage area accesses will be performed to this area until another call to this method is made. Note that this service only selects the area, it does not change it in any way. More... | |
static void | Select (StorageUnit iUnit) |
static void | SetName (int root, string Name) |
The method SetName sets the target name of a component to a specified string. Whenever a component is stored in the symbol table using the Vector method that component is given an identifier by the caller. This identifier can then used to retrieve the component, and by default is used by the author whenever references to the component are being written in the target code. If references are to be authored with an alternate identifier (referred to as the "name" of the component) then this method is used to associate that name with the component. More... | |
static void | SetObjectType (int root, int objType) |
The method SetObjectType changes the component object type without changing any of its other information. This method can only be used with compatible objects like controls of different types. More... | |
static void | SetString (int addr, string strValue) |
The method SetString changes the value of an existing string whose length has not increased. More... | |
static int | String (string strValue) |
The method String stores a character string in the current storage area and returns the offset in the storage area of the string. More... | |
static int | Unit () |
The method Unit returns the unit number of the current storage area. This value is often gotten before moving to another storage area. It can then be used to return to this current area. More... | |
static int | Vector (string Identifier, int Parent, int Length, int type) |
The Vector method stores a component information vector associated with an identifier as a child of a specified parent. It is the primary method used to enter components into the hierarchical symbol table. To enter a symbol, four things must be known. First, it must have a unique identifier relative to the parent of the symbol. Second, it must have a parent which can either be another symbol already entered into storage or can be the root branch of the symbol tree. Third, it must have a information storage vector length, which may be zero. If non-zero, a zero-filled area of storage is allocated to the component with the specified length. Fourth. it must have an object type code, which specifies the type of component being entered. More... | |
static int | WriteInfo (tCodeBlock info, int nByte) |
The method WriteInfo writes long information vectors into storage. There is no limit to the length of this information. Since block boundaries may occur within the storage area used, pointers should not be used to access the record, rather the methods GetInfo, ReadInfo, and RewiteInfo should be used. The most common use of this method is to write the intermediate code associated with a component, though it may be used for any type of information. More... | |
static int | WriteInfo (int[] info, int nByte, bool boundary=false) |
The Store Class contains the methods needed to manage data organized into hierarchical fields and records. When dealing with language processing, program storage must be viewed as containing a wide variety of different structures; indexes, lists, fixed records, long unformatted records, variable length strings, and so on. In addition, it may be purely memory bound or it may be stored in a persistent file system. The role of this service class is to provide a single interface for storing and retrieving information. It is sufficiently robust to allow for the management of large files in the multiple gigabyte size range, while it is still efficient for use by purely memory bound applications.
|
static |
The method AddGlobal adds the root offset of a component, indexed by its parent to a global index maintained within the storage area. This entry declares that the child component has global scope if and only if the parent component is an active reference.
root | is the root offset of a component that may have global scope. |
global | is the offset of the parent external library or class whose active reference status triggers the global scope. |
|
static |
The Close method closes the current storage area if that area is currently open. It does not change the currently selected storage area.
|
static |
The Create method selects the indicated storage unit and initializes it as a new empty area whose content will be optionally paged into a specified file. Any information currently in the storage are will be lost. Until another storage unit is selected via one of the three methods – Select,Create, or Open – all storage requests will be directed to this currently selected storage unit.
fileName | If the storage is to be paged into a file, then the filename parameter contains the name of that file (optionally without an extension). If the storage is to be purely memory-based, this parameter should be null. |
iUnit | is the number of the storage unit to be used. This must be en entry from the StorageUnit enumeration that defines these unit numbers. For most applications the USER storage area should be used, as many of the authoring service methods in particular assume that they are using this area. |
|
static |
The DeltaVector method gets a handle to a component information vector in the current storage area that it intends to change. In particular, this method gives read/write access to the information vector associated with the component whose root offset is specified via the integer root parameter. If there is any question about the type of component being accessed or about the validity of the root offset value, use the GetObjectType method first (see the discussion there). Use the GetVector method if the vector is simply to be read. The actual handle is optimized to make the retrieval of the component information as efficient as possible. As such it should only be used locally and should be refreshed after any other storage intensive operations have been performed. To use DeltaVector the storage area being accessed has to have been opened using a CREATE or APPEND action.
root | is the offset of the component whose information vector is to be changed. |
|
static |
The FindFirstChild method initiates a depth first or preorder search of the symbol tree.
iRoot | If the iRoot parameter is non-zero, then the node with this offset is visited first. If it is zero, then the first node in the tree is visited first. |
levels | The integer vector levels is used internally by the search algorithm. It must have at least two plus the maximum levels in the tree entries. Normal code structures have no more than four levels – project, class, subprogram, and local variable; however, controls defined via forms can often be nested more deeply. A size of 20 is always safe. |
|
static |
The FindNextChild method continues a depth first or preorder search of the symbol tree.
levels | The levels parameter must have been initialized by the FindFirstChild method. In a depth first search, a visit to a node is followed immediately by visits to all descendants of the node. |
|
static |
The FindRoot method finds an identified symbol root. This method searches the base index of the symbol table for a specified identifier and returns its root. This root is unique for each identifier.
Identifier | specifies the identifier being sought. |
|
static |
The method FindVector searches a single branch within the hierarchical symbol table for a for a component with the identifier specified by the string identifier parameter.
Identifier | specifies the name of the desired component. |
Parent | If the integer parent parameter is zero, then the root branch of the tree is searched; else the branch dominated by the parent is searched. |
|
static |
The method GetDataName gets the name of the current storage area. When a file-based storage area is created or opened its name is stored in the storage control structure.
|
static |
The method Store_GetFirst returns the root of the first child of a parent component or of the root branch. This is the first component entered for the parent. In general, using this method in conjunction with the GetNext method, will generate the sequence of components stored within some branch of the symbol table in their defined order.
parent | The integer parameter parent contains the root offset of the parent component or zero if the first member of the root branch in the symbol table is desired. |
|
static |
The method GetGlobals returns the (global, root) pairs added to a symbol identifier via the AddGlobal method. The description of that method contains a detailed description of these pairs.
symbolRoot | The integer parameter symbolRoot contains a root offset in the base symbol index as returned by the FindRoot method. |
globals | The integer vector parameter globals returns the pairs added to the specified symbol. |
nGlobal | The integer parameter nGlobal defines the length of the globals vector. No more than nGlobal entries will be returned. |
|
static |
The method GetHandle gets the long memory handle of the current storage area. All storage areas are maintained within a long memory area. Though most access needs for that memory area are provided internally, it is occasionally necessary to use one of the specialized stream access methods directly.
|
static |
The method GetIdent gets the source identifier of a component via its root address. By definition, the "identifier" is the original identifier that was associated with the component when it was first placed in the symbol table. See the SetName and GetName methods for information about changing how components are assigned alternative target identifiers.
root | specifies the root offset of the component whose identifier is needed. |
|
static |
The method GetInfo reads short blocks of information that were initially written using the method WriteInfo. A physical read is not required, since these short blocks do not cross block boundaries; however, in some instances reading them is needed to avoid downstream memory page faults. The most common use of this method is to read the list of interfaces associated with a class.
offset | The integer parameter offset is the offset of the start of the information to be read. This offset must be a value previously returned by the WriteInfo method. |
info | The parameter info physically receives the information read. |
|
static |
The method GetLength returns the overall length in words of the current storage area or of an information vector stored in the area.
offset | If the integer parameter offset is zero then the area length is requested, else a vector length is requested. |
|
static |
The method GetName gets the target identifier of a component via its root offset. Every component has two string representations – its source "identifier" which the original identifier that was associated with the component when it was first placed in the symbol table and its target "name" that was assigned to it directly via the SetName method. If no name has been assigned to the component, then its name is the same as its identifier. Whenever a reference to a component is authored its name is used, but any retrieval of the component is always done via its identifier.
root | contains the root offset of the component whose name is desired. |
|
static |
The method GetNext returns the next child of a parent component or of the root branch. This is the next component entered for the parent. In general, using this method in conjunction with the GetFirst method, will generate the sequence of components stored within some branch of the symbol table in their defined order.
iChild | The integer parameter iChild contains the root offset of the current child component as returned by GetFirst or a previous call to GetNext. |
|
static |
The method GetObjectType returns the symbol table object type code of a component. Whenever a component is entered into the symbol table, it is assigned an integer object type code. Each object type code has associated with it a fixed-length information vector used to describe components of the specified type. In the case of the tool the type code is either an entry number from the ObjectType enumeration, the opcode value of a built-in control if the component is a built-in control, or the root offset of an external class if the object is a of that external class.
root | The integer parameter root> contains the root offset of the component in storage. |
|
static |
The method GetParent returns the root offset of the parent of a component whose offset is specified.
root | specifies the root offset of the child component. |
|
static |
The method GetString returns a string from the current storage area via its offset.
offset | The parameter offset specifies the offset of the desired string. This offset must have been obtained via an earlier call to the method String. |
|
static |
The method GetSymbols returns the root offset of a sequence that contains the root offsets of all symbols whose identifier matches a specified string. The tool's symbol table has a tree structure. The symbols within the tree need be unique along one branch only. As a result of this, there can be many duplicates in the symbol table. The roles of the symbol retrieval methods are to search the symbol tree for the correct occurrence of an identifier given a current parent context.
Identifier | The identifier parameter specifies the string to be searched for. |
|
static |
The GetVector method gets a handle to a component information vector in the current storage area that it intends to access only. In particular, this method gives reade access to the information vector associated with the component whose root offset is specified via the integer root parameter. If there is any question about the type of component being accessed or about the validity of the root offset value, use the GetObjectType method first (see the discussion there). Use the DeltaVector method if the vector is to be changed. The actual handle is optimized to make the retrieval of the component information as efficient as possible. As such it should only be used locally and should be refreshed after any other storage intensive operations have been performed.
root | is the offset of the component whose information vector is to be accessed. |
|
static |
The method IsNull checks a handle retrieved from storage to determine if it is linked to a valid information vector.
handle | contains a handle retrieved from one of the store methods. |
|
static |
The Open method opens an exiting file into a storage area. In particular it makes the indicated storage area the current one and initializes it with the contents of an existing file. Any information currently in the storage area will be lost. Until another storage area is selected via one of the three methods Select, Create, Open all storage requests will be directed to this currently selected storagearea.
fileName | The string fileName parameter contains the name of the file (optionally, without an extension) to be opened for the storage area. |
iUnit | The integer iUnit parameter is the number of the storage unit to be used. This must be an entry from the StorageUnit enumeration that defines these unit numbers. For most applications the USER storage area should be used, as many of the authoring service methods in particular assume that they are using this area. |
append | The Boolean append, if true, then the file is opened with read/write access permission. If false, then the file is opened for read only access. |
|
static |
The method ReadInfo reads long blocks of information that were initially written using the method WriteInfo. A physical read is required, since these information vectors may cross block boundaries. The most common use of this method is to read the intermediate code associated with a component, though it may be used for any type of information.
info | The parameter info is an area in memory to receive the information read. It may be a code block or an integer vector. |
offset | The integer parameter offset is the offset of the start of the information to be read. This offset must be a value previously returned by the WriteInfo method. |
|
static |
The method RewriteInfo rewrites long blocks of information that were initially written using the method WriteInfo. A physical rewrite is required, since these information vectors may cross block boundaries. The most common use of this method is to rewrite the intermediate code associated with a component after it has been migrated, though it may be used for any type of information.
info | The parameter info is an area in memory that contains the information to be rewritten. It may be a code block or an integer vector. |
nByte | The parameter nByte stecifies the number of bytes to be rewritten. This may not exceed the length of the information originally written to this offset. |
offset | The integer parameter offset is the offset of the start of the information to be rewritten. This offset must be a value previously returned by the WriteInfo method. |
|
static |
The method Select selects one the available storage areas as the current storage area. All successive storage area accesses will be performed to this area until another call to this method is made. Note that this service only selects the area, it does not change it in any way.
iUnit | The parameter iUnit is the number of the storage unit to be used. This must be a value between 1 and 16 or a entry from the enumeration StorageUnit. |
|
static |
The method SetName sets the target name of a component to a specified string. Whenever a component is stored in the symbol table using the Vector method that component is given an identifier by the caller. This identifier can then used to retrieve the component, and by default is used by the author whenever references to the component are being written in the target code. If references are to be authored with an alternate identifier (referred to as the "name" of the component) then this method is used to associate that name with the component.
root | The component is specified via its root offset. |
Name | Specifies the target name of the component. |
|
static |
The method SetObjectType changes the component object type without changing any of its other information. This method can only be used with compatible objects like controls of different types.
root | The parameter root specifies the rool offset of the component to be changed. |
objType | The parameter objType is either an entry number from the ObjectType enumeration, the opcode value of a built-in control if the component is a built-in control, or the root offset of an external class if the object is a of that external class. |
|
static |
The method SetString changes the value of an existing string whose length has not increased.
offset | Specifies the offset of the string when it was originally stored. |
strValue | Contains the new content of the string. |
|
static |
The method String stores a character string in the current storage area and returns the offset in the storage area of the string.
strValue | Specifies the string to be stored. |
|
static |
The method Unit returns the unit number of the current storage area. This value is often gotten before moving to another storage area. It can then be used to return to this current area.
|
static |
The Vector method stores a component information vector associated with an identifier as a child of a specified parent. It is the primary method used to enter components into the hierarchical symbol table. To enter a symbol, four things must be known. First, it must have a unique identifier relative to the parent of the symbol. Second, it must have a parent which can either be another symbol already entered into storage or can be the root branch of the symbol tree. Third, it must have a information storage vector length, which may be zero. If non-zero, a zero-filled area of storage is allocated to the component with the specified length. Fourth. it must have an object type code, which specifies the type of component being entered.
identifier | Specifies the unique identifier relative to the parent of the symbol. |
parent | Specifies the parent which can either the root offset be another symbol already entered into storage or can be the root branch of the symbol tree which is entered as zero. |
length | Specifies the information storage vector length, which may be zero; |
type | Specifies the object type code. |
|
static |
The method WriteInfo writes long information vectors into storage. There is no limit to the length of this information. Since block boundaries may occur within the storage area used, pointers should not be used to access the record, rather the methods GetInfo, ReadInfo, and RewiteInfo should be used. The most common use of this method is to write the intermediate code associated with a component, though it may be used for any type of information.
info | The vector info contains the information to be written. This might be either an integer array or a byte array. |
nByte | The integer parameter nByte is the number of bytes to be written. If the number of bytes to be written is not well-formed – i.e., is less than or equal to zero, this method displays a message and returns a zero. |
The bool parameter boundary, if true writes the information in such a way that no block boundaries are inserted. Its default is false.