gmslAPI  0.1
gmslAPI: An API for Developing Upgrade Solutions using Great Migrations Technology
gmslLibrary.Services.CodeGroup Class Reference

The CodeGroup class contains utilities used in the migration of grouped related sections of compiled code that are associated with a reference to a target component such as a method, property, or event. More...

Public Member Functions

 CodeGroup (int hostRoot, int hostTarget, int hostOffset)
 The CodeGroup constructor creates a new CodeGroup instance based on a reference to a host target component in a host code block at a specified code offset. More...
 
bool isMethodCall (int[] qeStack)
 The isMethodCall method determines if a target reference is code whose purpose is to call a method. If it is, then this method computes the remaining content of the CodeGroup instance which contains the locations of the argument code blocks. The instance will contain two, plus the number of method arguments, arguments. The "target" code block actually references the target component that triggered the call to this method. The actual reference is usually followed by a MEM.Child operation which ties the target to its parent. When present this operation is included in the code block. Typically this code block will be deleted when the targetcode is transformed. The "hostObject" code block specifies the user object instance whose method is being called. The additional code block arguments have the same names as the corresponding method arguments in the library description file that defined the method. More...
 
bool isPropertySetter (int[] qeStack)
 The isPropertySetter method determines if a target reference is code whose purpose is to set the value of a property. If it is, then this method computes the remaining content of the CodeGroup instance which will contains the locations of three argument code blocks. The "target" code block actually references the target component that triggered the call to this method. The actual reference is usually followed by a MEM.Child operation which ties the target symbol to its parent. When present this operation is included in the code block. Typically this code block will be deleted when the target code is transformed. The "rightSide" code block specifies the value that is to be assigned to the property. The "hostObject" code block specifies the user object instance whose property value is being set. More...
 
bool isEventCall (int[] qeStack)
 The isEventCall method determines if a target reference is code whose purpose is to call an event. If it is, then this method computes the remaining content of the CodeGroup instance which contains the locations of the argument code blocks. The instance will contain two, plus the number of method arguments, arguments. The "target" code block actually references the target component that triggered the call to this method. The actual reference is usually followed by a MEM.Child operation which ties the target to its parent. When present this operation is included in the code block. Typically this code block will be deleted when the targetcode is transformed. The "handler" code block specifies the user object instance that hamdles the event. The additional code block arguments have the same names as the corresponding arguments in the library description file that defined it. More...
 
void migPatternAddr (int iPattern)
 The migPatternAddr method inserts an operation into the compiled code which replaces the ending code for a CodeGroup that changes and/or augments how that it will eventually be authored. Since the surface pattern is applied to entire group it should assume the same number of string argument as the ending code opertation that it replaces. More...
 
int intValue (string ident)
 The intValue method computes the integer value of the code group associated with an argument. The argument code is executed using the gmSL execution engine, More...
 
void migPattern (string pattern)
 The migPattern method inserts an operation into the compiled code which replaces the ending code for a CodeGroup that changes and/or augments how that CodeGroup will eventually be authored. Since the surface pattern is applied to the entire group it should assume the same number of arguments as the ending code opertation that it replaces. More...
 
void argPattern (string ident, string pattern)
 The argPattern method inserts an operation into the compiled code immediately following an argument within a CodeGroup that changes and/or augments how that argument will eventually be authored. Since the surface pattern is applied to a single argument it should assume a patterng argument. So for example the pattern "ilMain.Images.IndexOfKey(%1d)" would display the indicated argument preceeded by "ilMain.Images.IndexOfKey(" and followed by ")". More...
 
bool isOmitted (string ident)
 The isOmitted method checks if an argument was omitted. When the compiler encounters optional arguments whose information is omitted in a reference, then it emits a special operation code, OPC.DEF, to mark that fact. This method checks the code emitted for the indicated argument to determine if it was omitted. More...
 
bool isString (string ident)
 The isString method determines if an argument was a string value. It checks the binary type of the indicated argument to determine if it is a string value. The determination of argument types is done when a CodeGroup instance is initially checked for its status. More...
 
string getPropertyValue (string ident, string property)
 The getPropertyValue method obtain the value of a specified property by authoring its reference in the property bag code for the control. More...
 

Detailed Description

The CodeGroup class contains utilities used in the migration of grouped related sections of compiled code that are associated with a reference to a target component such as a method, property, or event.

Constructor & Destructor Documentation

◆ CodeGroup()

gmslLibrary.Services.CodeGroup.CodeGroup ( int  hostRoot,
int  hostTarget,
int  hostOffset 
)

The CodeGroup constructor creates a new CodeGroup instance based on a reference to a host target component in a host code block at a specified code offset.

Parameters
hostRootThe hostRoot parameter specifies the root offset of the user component that is referencing the target component.
hostTargetThe hostTarget parameter specifies the root offset of the target component whose references are being transformed.
hostOffsetThe hostOffset parameter specifies the offset of the code block of the actual reference to the target.

Member Function Documentation

◆ argPattern()

void gmslLibrary.Services.CodeGroup.argPattern ( string  ident,
string  pattern 
)

The argPattern method inserts an operation into the compiled code immediately following an argument within a CodeGroup that changes and/or augments how that argument will eventually be authored. Since the surface pattern is applied to a single argument it should assume a patterng argument. So for example the pattern "ilMain.Images.IndexOfKey(%1d)" would display the indicated argument preceeded by "ilMain.Images.IndexOfKey(" and followed by ")".

Parameters
identThe ident parameter contains the simple identifier of the CodeGroup argument whose authoring shouls be modified.
patternThe pattern parameter contains the actual surface pattern to be used to change the authoring of the indicated argument.

◆ getPropertyValue()

string gmslLibrary.Services.CodeGroup.getPropertyValue ( string  ident,
string  property 
)

The getPropertyValue method obtain the value of a specified property by authoring its reference in the property bag code for the control.

Parameters
identThe ident parameter is the CodeGroup specific identifier of the particular argument whose property value is to be determined.
propertyThe property parameter contains the name of the actual property whose value is the be determined.
Returns
The method return value receives the indicated property value if it exists; else it simply returns the argument identifier.

◆ intValue()

int gmslLibrary.Services.CodeGroup.intValue ( string  ident)

The intValue method computes the integer value of the code group associated with an argument. The argument code is executed using the gmSL execution engine,

Parameters
identThe ident parameter contains the simple identifier of the CodeGroup argument whose value is desired.
Returns
If the runtime queue has an integer value queued after the argument code has been executed, then that value is returned. Otherwise the special value Define.NO_VALUE_FOUND is returned.

◆ isEventCall()

bool gmslLibrary.Services.CodeGroup.isEventCall ( int []  qeStack)

The isEventCall method determines if a target reference is code whose purpose is to call an event. If it is, then this method computes the remaining content of the CodeGroup instance which contains the locations of the argument code blocks. The instance will contain two, plus the number of method arguments, arguments. The "target" code block actually references the target component that triggered the call to this method. The actual reference is usually followed by a MEM.Child operation which ties the target to its parent. When present this operation is included in the code block. Typically this code block will be deleted when the targetcode is transformed. The "handler" code block specifies the user object instance that hamdles the event. The additional code block arguments have the same names as the corresponding arguments in the library description file that defined it.

Parameters
qeStackThe qeStack parameter is an integer vector that is maintained by the utilities that are doing the code scan. It contains the current number of queue entries that would be in the stack if the sequence were being executed up to the target reference. In addition it contains the offset of the start of each queue entry. This vector is needed because many codegroups refer to variable code blocks that precede the actual target reference in the code. For example in the case of a method call the hostObject code block precedes the actual reference to the target method.
Returns
If the code surrounding the current target has an event call role, then true is returned; else false is returned.

◆ isMethodCall()

bool gmslLibrary.Services.CodeGroup.isMethodCall ( int []  qeStack)

The isMethodCall method determines if a target reference is code whose purpose is to call a method. If it is, then this method computes the remaining content of the CodeGroup instance which contains the locations of the argument code blocks. The instance will contain two, plus the number of method arguments, arguments. The "target" code block actually references the target component that triggered the call to this method. The actual reference is usually followed by a MEM.Child operation which ties the target to its parent. When present this operation is included in the code block. Typically this code block will be deleted when the targetcode is transformed. The "hostObject" code block specifies the user object instance whose method is being called. The additional code block arguments have the same names as the corresponding method arguments in the library description file that defined the method.

Parameters
qeStackThe qeStack parameter is an integer vector that is maintained by the utilities that are doing the code scan. It contains the current number of queue entries that would be in the stack if the sequence were being executed up to the target reference. In addition it contains the offset of the start of each queue entry. This vector is needed because many codegroups refer to variable code blocks that precede the actual target reference in the code. For example in the case of a method call the hostObject code block precedes the actual reference to the target method.
Returns
If the code surrounding the current target has a method call role, then true is returned; else false is returned.

◆ isOmitted()

bool gmslLibrary.Services.CodeGroup.isOmitted ( string  ident)

The isOmitted method checks if an argument was omitted. When the compiler encounters optional arguments whose information is omitted in a reference, then it emits a special operation code, OPC.DEF, to mark that fact. This method checks the code emitted for the indicated argument to determine if it was omitted.

Parameters
identThe ident parameter is the CodeGroup specific identifier of the particular argument whose emission status is to be tested.
Returns
If the identifier does represent an argument within the current CodeGroup and if the emission associated with that argument indicates that it was omitted, then a true is returned; else false is returned.

◆ isPropertySetter()

bool gmslLibrary.Services.CodeGroup.isPropertySetter ( int []  qeStack)

The isPropertySetter method determines if a target reference is code whose purpose is to set the value of a property. If it is, then this method computes the remaining content of the CodeGroup instance which will contains the locations of three argument code blocks. The "target" code block actually references the target component that triggered the call to this method. The actual reference is usually followed by a MEM.Child operation which ties the target symbol to its parent. When present this operation is included in the code block. Typically this code block will be deleted when the target code is transformed. The "rightSide" code block specifies the value that is to be assigned to the property. The "hostObject" code block specifies the user object instance whose property value is being set.

Parameters
qeStackThe qeStack parameter is an integer vector that is maintained by the utilities that are doing the code scan. It contains the current number of queue entries that would be in the stack if the sequence were being executed up to the target reference. In addition it contains the offset of the start of each queue entry. This vector is needed because many codegroups refer to variable code blocks that precede the actual target reference in the code. For example in the case of a method call the hostObject code block precedes the actual reference to the target method.
Returns
If the code surrounding the current target has a property setter role, then true is returned; else false is returned.

◆ isString()

bool gmslLibrary.Services.CodeGroup.isString ( string  ident)

The isString method determines if an argument was a string value. It checks the binary type of the indicated argument to determine if it is a string value. The determination of argument types is done when a CodeGroup instance is initially checked for its status.

Parameters
identThe name parameter contains the CodeGroup specific identifier of the particular argument whose binary type is to be tested.
Returns
If the identifier does represent an argument within the current codegroup and if the binary type of that argument is "TYP.String" then true is returned; else false is returned.

◆ migPattern()

void gmslLibrary.Services.CodeGroup.migPattern ( string  pattern)

The migPattern method inserts an operation into the compiled code which replaces the ending code for a CodeGroup that changes and/or augments how that CodeGroup will eventually be authored. Since the surface pattern is applied to the entire group it should assume the same number of arguments as the ending code opertation that it replaces.

Parameters
patternThe pattern parameter contains the actual surface pattern to be used to change the authoring of the code block. It should assume that it will receive the same number of arguments as the ending operation that it replaces. For assignments this is two and for calls it is one plus the number of calling arguments.

◆ migPatternAddr()

void gmslLibrary.Services.CodeGroup.migPatternAddr ( int  iPattern)

The migPatternAddr method inserts an operation into the compiled code which replaces the ending code for a CodeGroup that changes and/or augments how that it will eventually be authored. Since the surface pattern is applied to entire group it should assume the same number of string argument as the ending code opertation that it replaces.

Parameters
iPatternThe iPattern parameter is the offset in storage of a pattern description. This offset is emitted using the OPC.PAT operation and must be compatible with it.

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