tibasBrowserDef_CreateEx()

Returns a new BrowserDef instance and allows you to set the attributes of the browserDef.

Declaration

tibas_status tibasBrowserDef_CreateEx
(tibasBrowserDef*        browserDef,
tibas_int                timeout,
tibas_timeScope          timeScope,
tibas_distributionScope  distributionScope)

Parameters

Parameter Description
browserDef The new instance of the browser definition object returned by the function.
timeout The time in milliseconds or TIBAS_WAIT_FOREVER or TIBAS_NO_WAIT.
timeScope Specifies the time scope for the browser. Possible values are:
  • TIBAS_TIME_SCOPE_ALL
  • TIBAS_TIME_SCOPE_SNAPSHOT (the default value)
  • TIBAS_TIME_SCOPE_NEW
  • TIBAS_TIME_SCOPE_NEW_EVENTS
distributionScope The distribution scope can be one of the following:
  • TIBAS_DISTRIBUTION_SCOPE_ALL (the default)
  • TIBAS_DISTRIBUTION_SCOPE_SEEDED

Remarks

The tibasBrowserDef_CreateEx() function is an extended version of the tibasBrowserDef_Create() function. Use tibasBrowserDef_CreateEx() to create a browser definition and directly set attributes of the browserDef.

The timeout is the amount of time for which a space browser'stibasBrowser_Next() function can block while waiting for something new in the space to execute a tibasBrowser_Next() on. If there is still nothing new for the browser to perform a next() operation on at the end of the timeout, thetibasBrowser_Next() function returns null.

You can specify one of the following with the timeout parameter:

The timeout value in milliseconds.

TIBAS_WAIT_FOREVER
Specifies that the browser will not time out.
TIBAS_NO_WAIT
Specifies that the browser will not wait before executing another tibasBrowser_Next() operation.
Note: The browser’s timeout value is ignored when the browser’s time scope is set to TIBAS_TIME_SCOPE_SNAPSHOT. In this case, any invocation of the tibasBrowser_Next() function on the browser once all of the tuples in the snapshot have been iterated through immediately returns NULL.

The timescope parameter specifies the time scope for the browser, and can have one of one of the following values:

TIBAS_TIME_SCOPE_ALL
Start the browser with all the tuples currently in the space and update it continuously updated when tuples are added.
TIBAS_TIME_SCOPE_SNAPSHOT
Start the browser with all the tuples in the space at the time the browser is created (or initial values), but do not update it when new tuples are added. This is the default value.
TIBAS_TIME_SCOPE_NEW
Start the browser with no tuples, but update it with new tuples that are created in the space.
TIBAS_TIME_SCOPE_NEW_EVENTS
This value is only used with event browsers. The browser starts empty and is updated when new events occur.

The distribution scope can be one of the following:

TIBAS_DISTRIBUTION_SCOPE_ALL
The browser browses over all the tuples (or associated events) in the space.
TIBAS_DISTRIBUTION_SCOPE_SEEDED
The browser browses over only the tuples (or associated events) that have been distributed to the member creating the browser.

After you create the browserDef, you pass the browserDef to the tibasMetaspace_Browse() function or the tibasSpace_Browse() function to enable the browser.