Several fundamental datatypes are used by the toolkit in order to generalize platform-specific handling of data. The following table lists the datatypes that facilitate cross-platform portability:
Datatype | Concept & Example |
---|---|
dt_Boolean |
Concept: Logical
Example: The dt_Boolean datatype represents one bit of information. Valid values are 1 (for TRUE) and 0 (for FALSE). |
dt_Integer |
Concept: Integral
Example: The dt_Integer datatype represents whole numbers within the range of 2^31 to -2^31. |
dt_Real |
Concept: Floating-point
Example: The dt_Real datatype represents floating-point values (2-2^23)^127 to -(2-2^23)^127 and is not able to represent zero. |
dt_String |
Concept: Character Array
Example: The dt_String datatype represents an array of characters. For platform independence, the length of the character array is specified with an associated dt_Integer datatype, not with a character (i.e., NULL) within the array. Functions that return a string typically accept the address of the dt_Integer as the first parameter, which is used to pass the length of the string back to the caller. |
A generic datatype, called a handle, is used to represent all objects in the toolkit. An object handle is an integer. The value of the handle is a number, and that number has meaning within the toolkit. It's clean and simple. The opaqueness of objects and standardization of the toolkit interface makes the toolkit stable and enables predictable and reproducible behavior.
Datatype | Concept & Example |
---|---|
dt_Handle |
Concept: Object Handling
Example: A handle is an integer representing an object. The integer is an index into the internal toolkit table. A handle is used to represent objects, including: Atom, Bond, Cycle, Molecule, Reaction, Pattern, Pathset, Path, Transform, Stream, Sequence. |
The following shapes are used in the following figures:
Shape | Concept & Example |
---|---|
![]() |
Concept: Basic Object
Example: Molecule, Reaction, Pattern, Transform |
![]() |
Concept: Child Object
Example: Atom, Bond, Cycle, Molecule in a Reaction |
![]() |
Concept: Container Object
Example: Stream, Sequence |
Object | Concept & Example |
---|---|
![]() |
Concept: A child is an integral part of a parent.
Example: Code |
Concept: A child affects its parent.
Example: Code |
|
Concept: A parent owns its child.
Example: Code |
|
Concept: A parent is directly accessible from the child.
Example: Code |
Object | Concept & Example |
---|---|
![]() |
Concept: A molecule is input and output using the SMILES Toolkit.
Example: Code |
Concept: A stream is a container object.
Example: Code |
|
Concept: A stream is like a linked list.
Example: Code |
|
Concept: A stream is derived from a base object.
Example: Code |
|
Concept: A stream is invalid when its base object changes.
Example: Code |
Object | Concept & Example |
---|---|
![]() |
Concept: A reaction is input and output using the SMILES Toolkit with reaction capabilities.
Example: Code |
Concept:
A stream is a container object.
Example: Code |
|
Concept: A stream is like a linked list.
Example: Code |
|
Concept: A stream is derived from a base object.
Example: Code |
|
Concept: A stream may become invalid when its base object changes.
Example: Code |
Object | Concept & Example |
---|---|
![]() |
Concept: A pattern object is input using the SMARTS Toolkit.
Example: Code |
Concept: A pattern object and either a molecule or reaction are used to find matching paths.
Example: Code |
|
Concept: A pathset object is a set of paths.
Example: Code |
|
Concept: A path object is a set of atoms and bonds.
Example: Code |
|
Concept: A pathset and its paths are derived from a base object.
Example: Code |
|
Concept: A pathset and path may become invalid when its base object changes.
Example: Code |
|
Concept: A stream is a container object
Example: Code |
|
Concept: A stream is like a linked list.
Example: Code |
|
Concept: A stream is derived from a base object.
Example: Code |
|
Concept: A stream may become invalid when its base object changes.
Example: Code |
Object | Concept & Example |
---|---|
![]() |
Concept: A transform object is input using the SMILES Toolkit with reaction capabilities.
Example: Code |
Concept: A sequence is a container object.
Example: Code |
|
Concept: A sequence is like a linked list
Example: Code |
|
Concept: A sequence is completely separate and not derived from another object.
Example: Code |
|
Concept: A sequence does not become invalid when other objects change.
Example: Code |
|
Concept: A transform object and a sequence of molecules are used to transform the molecules into a sequence of reactions.
Example: Code |
Next Section: Programming Exercises