Skip to content

Instance description

Mikhail Yakshin edited this page Apr 12, 2016 · 2 revisions

Instance description is very close to attribute description (and inherits all its properties), but it specifies an attribute to be read (or calculated) out of regular sequence. Typically, each instance is compiled into a reader function that will parse requested data on demand, cache the result and return whatever's been parsed previously on subsequent calls.

Common attributes

Instance inherits attribute description, so everything that's described there can be used, except for id, which is useless, because all instances already have name due to map string key.

pos

Specifies position in a stream from which the value should be parsed.

io

Specifies an IO stream from which a value should be parsed.

value

Overrides any real reading & parsing. Instead, just calculates function specified in value and returns the result as this instance. Can be used for multitude of purposes, such as data conversion while reading, etc.

Clone this wiki locally