Skip to main content

Module value

Module value 

Source
Expand description

The lossless tagged value encoding (ADR 0013).

Every IFC attribute value crosses to JavaScript as an object with a kind field, plus a payload field that depends on the kind:

kindpayloadSTEP example
null—$
derived—*
boolvalue: boolean.T. / .F.
unknown—.U.
integervalue: bigint42
realvalue: number2.5
textvalue: string'Wall'
binaryvalue: string (hex)"0123ABC"
enumvalue: string.ELEMENT.
refid: bigint#42
listitems: Value[](1,2)
typedtype: string, value: ValueIFCLABEL('x')

Integers and ids are bigint because IFC integers are 64-bit and a JS number loses precision above 2^53. unknown is its own kind rather than bool with a null value so that no JS truthiness check can confuse it with .F..

The table names the JavaScript fields; Python and C carry the same kinds and payloads in their own idiom. Tagged is the host-independent form: each binding only moves Tagged into and out of host values, so the mapping itself is tested once, natively.

Enums§

Kind
The kind tag of an encoded value.
Tagged
One encoded value: a kind plus exactly the payload that kind carries.

Constants§

MAX_NESTING
Deepest list or typed-wrapper nesting accepted from a host.