next up previous index
Next: The EclipseStreams Collection Class Up: Embedding into Visual Basic Previous: Public Enumerations   Index


The EclipseClass class

An object of this class is an entity running eclipse code. Only one such object may exist in a process.

The class provides methods to execute goals and to access queue streams to communicate with the running goal.

Function Init() As Long

Initialise the ECLiPSe engine. This is required before any other functions of this interface can be used.

Sub Send(EventName As String)

Post an event to the ECLiPSe engine. This will lead to the execution of the corresponding event handler See also event/1 and the User Manual chapter on event handling for more information. The event name is given as a string. Note that if ECLiPSe was not running, the event stays in its queue until it is resumed.

Function Post(Goal As String) As EC_Status

Post a goal (constraint) that will be executed when ECLiPSe is resumed. The goal is given as a string in ECLiPSe syntax.

Function ResumeAsync() As EC_Status

Resume execution of the ECLiPSe engine: All posted goals will be executed. The return value will be 'Success' if the goals succeed 'Fail' is returned if the goals fail, and 'Yield' if control was yielded because of a yield/2 predicate call in the ECLiPSe code. No parameters can be passed.

The function returns when the posted goals have finished executing. Since a separate thread is actually executing the goals though, events may be received by the Visual Basic program during the execution of this function. It is an error to call this function recursively while handling one of these events.

Function HandleEvents() As EC_Status

Resume execution of the ECLiPSe engine, but do not let it execute any posted goals. Only ECLiPSe events will be handled. Sources of such events are the Post() Function or writing to an event-raising ECLiPSe queue stream. The function returns when the events have all been handled by ECLiPSe and the return value is 'Success'. It is an error to call this function while a ResumeAsync() is still active.

Sub RPC(Goal As Variant, Response As Variant)

ECLiPSe Remote Predicate Call. An ECLiPSe goal is constructed from Goal according to the conversion rules explained in chapter 7. Goal is called in the default module. The Goal should be simple in the sense that it can only succeed, fail or throw. It must not call yield/2. Any choicepoints the goal leaves will be discarded. On success, the (possibly more instantiated) Goal is returned as Response, otherwise "fail" or "throw" respectively.

Unlike ResumeAsync, calls to RPC can be nested and can be used from within VB Stream event handlers.

Property Let EclipseDir(Dir As String)

The directory where ECLiPSe is installed. See Chapter A.

Property Let Module(Mod As String)

The default module for calling goals. See Chapter A.

Property Let GlobalSize(Size As Long)

The maximum size of the ECLiPSe global/trail stack in bytes. See Chapter A.

Property Let LocalSize(Size As Long)

The maximum size of the ECLiPSe local/control stack in bytes. See Chapter A.

Property Let SharedSize(Size As Long)

The maximum size of the ECLiPSe shared heap. See Chapter A.

Property Let PrivateSize(Size As Long)

The maximum size of the ECLiPSe private heap. See Chapter A.

Property Get Streams

The EclipseStreams collection associated with this EclipseClass.


next up previous index
Next: The EclipseStreams Collection Class Up: Embedding into Visual Basic Previous: Public Enumerations   Index

1999-08-06