![]() |
das2C
das core C utilities (v3)
|
Value sources for the DasVar layer. More...


Go to the source code of this file.
Macros | |
| #define | VARIDX_MAX ARYIDX_MAX |
| Max index count for the model. | |
| #define | VARIDX_MAXFLG VARIDX_RAGGED |
| Every flag is <= this, so (n > VARIDX_MAXFLG) reads as "is a real extent". | |
| #define | DasGen_type(P) ((P)->kind) |
| Promote any plain numeric element to double. | |
| #define | DasGen_elemType(P) ((P)->elem) |
| What one cell of this generator holds. | |
Functions | |
| DAS_API void | das_varindex_merge (int nRank, ptrdiff_t *pDest, ptrdiff_t *pSrc) |
| Merge two shapes in the model's index space, taking the lattice. | |
| DAS_API ptrdiff_t | das_varlength_merge (ptrdiff_t nLeft, ptrdiff_t nRight) |
| Merge the length of one index position, same lattice as above. | |
| DAS_API DasErrCode | das_shape_fromStr (const char *sShape, int nMaxRank, bool bAllowFlags, ptrdiff_t *pShape, int *pnRank, const char *sWhere) |
| Parse a shape string in the model's index vocabulary. | |
| DAS_API int | das_shape_toStr (const ptrdiff_t *pShape, int nRank, char *sBuf, int nLen) |
| Emit a shape string, the exact inverse of das_shape_fromStr(). | |
Value sources for the DasVar layer.
| #define VARIDX_MAX ARYIDX_MAX |
Max index count for the model.
Same number as ARYIDX_MAX and always will be, since every model index eventually lands in one array's index list; a separate spelling because it is a separate audience.
| #define DasGen_type | ( | P | ) | ((P)->kind) |
Promote any plain numeric element to double.
| et | the element type held at p |
| p | the element to read |
| pOut | receives the promoted value |
| DAS_API void das_varindex_merge | ( | int | nRank, |
| ptrdiff_t * | pDest, | ||
| ptrdiff_t * | pSrc | ||
| ) |
Merge two shapes in the model's index space, taking the lattice.
Ragged > Number > Borrow > Unused
with two real numbers going to the smaller. pDest is updated in place.
NOT for array storage shapes: an array marks an unset extent with ARYIDX_UNBOUND (0), which this reads as a real extent of zero.
| DAS_API ptrdiff_t das_varlength_merge | ( | ptrdiff_t | nLeft, |
| ptrdiff_t | nRight | ||
| ) |
Merge the length of one index position, same lattice as above.
Two real lengths give the SMALLER on purpose: mid-stream, variables fill different sized blocks and the extent usable across all of them is the minimum currently populated. A mismatch is a normal live-read state, not an error.
| DAS_API DasErrCode das_shape_fromStr | ( | const char * | sShape, |
| int | nMaxRank, | ||
| bool | bAllowFlags, | ||
| ptrdiff_t * | pShape, | ||
| int * | pnRank, | ||
| const char * | sWhere | ||
| ) |
Parse a shape string in the model's index vocabulary.
The grammar is ';'-separated tokens: a positive count, '*' ragged, '^' an extent borrowed from the container, '-' an index this thing does not use. The same grammar serves index= and intern=.
| nMaxRank | the most entries pShape can take |
| bAllowFlags | false to refuse '^' and '-'. A dataset IS the container, so it can neither borrow an extent nor decline an index; a variable may do both. |
| sWhere | a short context for diagnostics, e.g. "<composite> in dataset 30" |
| DAS_API int das_shape_toStr | ( | const ptrdiff_t * | pShape, |
| int | nRank, | ||
| char * | sBuf, | ||
| int | nLen | ||
| ) |
Emit a shape string, the exact inverse of das_shape_fromStr().