IRISLIB database
COSCallout Class Reference
Inheritance diagram for COSCallout:
Collaboration diagram for COSCallout:

Public Member Functions

_.Library.Boolean Compile (_.Library.RawString SourceStream, _.Library.RawString ErrorsStream, _.Library.Boolean ColoringErrors)
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Static Public Member Functions

_.Library.String PathToDLL ()
 

Public Attributes

 BinDir
 
 DLLCallMode
 
 DLLHandle
   More...
 
 DLLResultCode
 

Private Member Functions

_.Library.Status OnClose ()
 
_.Library.String __ConfigName ()
 
_.Library.String __ConfigPath ()
 
_.Library.List __InvokeDLL (_.Library.Integer DLLFunction, DLLArgs)
 
 __SetDefaultBinDir ()
 
_.Library.String __ZF5 (_.Library.Integer handle, _.Library.Integer DLLFunction, DLLArgs, _.Library.Boolean failed)
 
_.Library.String __ZF6 (_.Library.String DLLPath, _.Library.Integer DLLFunction, DLLArgs, _.Library.Boolean failed)
 

Additional Inherited Members

- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

Transform COS source code to a parse tree

Internal ISC code, not for customer use - these interfaces may change without warning

Member Function Documentation

◆ OnClose()

_.Library.Status OnClose ( )
private

Transform COS source code to a parse tree

Internal ISC code, not for customer use - these interfaces may change without warning

Reimplemented from RegisteredObject.

◆ Compile()

_.Library.Boolean Compile ( _.Library.RawString  SourceStream,
_.Library.RawString  ErrorsStream,
_.Library.Boolean  ColoringErrors 
)

Convert the given COS source code to a parse tree

  • SourceStream is a stream containing the source code

  • ErrorsStream is a stream to which any error messages are written

The return value is 1 on success, 0 on failure

If 0 is returned the caller should see the DLLResultCode property for information about failure.

CacheObjectScript.DLL must be in the directory given by the BinDir property. By default this points to the instance's "Bin" directory.


In the example below SourceIn and ErrorsOut are streams. SourceIn supplies the source code and ErrorsOut receives any error messages.

Set TT=##class(Library.COSCallout).New() Set Ret=TT.Compile(SourceIn,ErrorsOut) If 'Ret Write "Fatal error: ",TT.DLLResultCode,! ZTrap Do Errors.Rewind() If 'Errors.AtEnd { //... show Errors } Else { //... use tree }

◆ __ConfigName()

_.Library.String __ConfigName ( )
private

Helper function to return the InterSystems IRIS configuration name.

◆ __ConfigPath()

_.Library.String __ConfigPath ( )
private

Helper function to return the InterSystems IRIS configuration path.

◆ __InvokeDLL()

_.Library.List __InvokeDLL ( _.Library.Integer  DLLFunction,
  DLLArgs 
)
private

Invoke the CacheObjectScript DLL function (DLLFunction), passing DLLArgs.

Returns what the $ZF call into the DLL returns, or something in the same format :-

$LISTBUILD(ZFOK, $LISTBUILD(Lang1, Lang2, ...), ColoringErrors, DLLResultCode)

◆ PathToDLL()

_.Library.String PathToDLL ( )
static

Return the path to the DLL

◆ __SetDefaultBinDir()

__SetDefaultBinDir ( )
private

Set the default for the instance's "Bin" directory

◆ __ZF5()

_.Library.String __ZF5 ( _.Library.Integer  handle,
_.Library.Integer  DLLFunction,
  DLLArgs,
_.Library.Boolean  failed 
)
private

Sets failed to 1 if the $ZF(-5,..) call fails, otherwise sets it to 0 and returns the DLL return code

◆ __ZF6()

_.Library.String __ZF6 ( _.Library.String  DLLPath,
_.Library.Integer  DLLFunction,
  DLLArgs,
_.Library.Boolean  failed 
)
private

Sets failed to 1 if the $ZF(-6,..) call fails, otherwise sets it to 0 and returns the DLL return code

Member Data Documentation

◆ BinDir

BinDir

The directory for CacheObjectScript.DLL.

Defaults to the instance's "Bin" directory - change it if you want to debug a different version of the DLL.  

◆ DLLCallMode

DLLCallMode

How we call the DLL

Takes one of the following values :-

1 - use $ZF(-3) ... handy for debugging the DLL because it doesn't stay loaded

2 - use $ZF(-4)/$ZF(-5) ... to cache the DLL handle

3 - use $ZF(-4)/$ZF(-6) ... the default - there's normally no reason to change it

Initialised to 3  

◆ DLLHandle

DLLHandle

 

The cached DLLHandle (used only when DLLCallMode=2)

◆ DLLResultCode

DLLResultCode

Set to a result code string

Mainly of use to Intersystems support.