![]() |
das2C
das core C utilities (v3)
|
The DasVar layer: named values with formalisms. More...
#include <das3/descriptor.h>#include <das3/buffer.h>#include <das3/datum.h>#include <das3/units.h>#include <das3/generator.h>#include <das3/form.h>

Go to the source code of this file.
Data Structures | |
| struct | DasVarComp |
| The numeric component run: DasVarComp, the <composite> element. More... | |
Macros | |
| #define | DasVar_formIs(P, VT) (((P) != NULL)&&DasForm_isKind(DasVar_form(P), VT)) |
| Is this variable's formalism the given kind? | |
| #define | DasVar_allVals(P, R) DasVar_subset((P), (R), NULL, NULL, NULL) |
| Every value this variable has, in its own shape. | |
| #define | DasVar_hasAry(P) (DasVar_getAry(P) != NULL) |
| Is there a backing store under this variable? | |
The DasVar layer: named values with formalisms.
XML snippets show the stream form of each type right next to the struct that carries it.
A word that recurs here: affine. The point formalism marks ABSOLUTE values, positions measured from an agreed origin, calendar time being the canonical case. For such values differences are meaningful but sums are not: point - point = interval, point + interval = point, and point + point is refused (adding two calendar dates means nothing). Mathematics calls a space with exactly these rules affine, and the word is used in that precise sense throughout this layer. Measurement theory calls the same idea an interval scale, but das uses "interval" for the difference quantity itself, so affine it is.
The wire side of all this is written up in schema/das2c_operations.md.
| #define DasVar_formIs | ( | P, | |
| VT | |||
| ) | (((P) != NULL)&&DasForm_isKind(DasVar_form(P), VT)) |
Is this variable's formalism the given kind?
A shortcut for DasForm_isKind() so that code working with variables need not pull out the formalism first. Each formalism header defines a macro for its virtual table, use those here. For example
| #define DasVar_allVals | ( | P, | |
| R | |||
| ) | DasVar_subset((P), (R), NULL, NULL, NULL) |
Every value this variable has, in its own shape.
The common case: no bounds, no model. "get" is deliberately absent from this name – DasVar_get() returns one datum and DasVar_getAry() returns the backing store, so a third DasVar_get* returning a computed array would be one letter and one wrong guess away from either.
| #define DasVar_hasAry | ( | P | ) | (DasVar_getAry(P) != NULL) |
Is there a backing store under this variable?
The predicate form of DasVar_getAry(), for the many call sites that only want the yes/no. false means every value is computed on demand.