Daylight v4.9
Release Date: 1 February 2008

Object Synopsis

stream -- object used to enumerate constituents of another object


A stream object is used to enumerate the "constituent parts" of complex objects. For example, the atoms and bonds of a molecule are accessed by making a stream of atoms or bonds, respectively, over the molecule.

Streams are limited in their capabilities in order to make them "cheap". Typically, a stream can be created and its contents accessed very quickly.

A stream has three operations that apply: It can be reset to its beginning (dt_reset(3)), you can get the next object in the stream (dt_next(3)), you can ask if you have reached the end (dt_atend(3)).

dt_next(3) always returns the objects in a stream in the same order. That is, you can step through it, reset it, and step through again with the same results.

Two streams of the same type with the same base object will return the same objects in the same order.

A copy of a stream behaves identically to the original. This is true even when a copy is made in the middle of an enumeration; in this case dt_next(copy) will continue the enumeration in the middle of the stream exactly as dt_next(original) will.

Streams are always based on the object used to create them (see dt_base(3)). If that object is deallocated or changed, the stream is deallocated.

Related Topics


dt_setinteger(3) dt_typename(3) dt_reset(3) dt_sethandle(3) dt_integer(3) dt_real(3) dt_handle(3) dt_count(3) dt_base(3) dt_string(3) dt_setstring(3) dt_atend(3) dt_setadjunct(3) dt_canstream(3) dt_next(3) dt_stream(3) dt_stringvalue(3) dt_boolean(3) dt_setreal(3) dt_proptype(3) dt_dealloc(3) dt_copy(3) dt_setboolean(3) dt_atstart(3) dt_adjunct(3) dt_origstream(3) dt_alloc_program(3) dt_arbstream(3) dt_type(3) dt_propnames(3) dt_appendstring(3)