48 #define DASIDX_RAGGED -1
49 #define DASIDX_FUNC -2
50 #define DASIDX_UNUSED -3
52 #define DASIDX_INIT_UNUSED {-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3}
53 #define DASIDX_INIT_BEGIN { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
69 ptrdiff_t* pShape,
int iFirstInternal,
int nShapeLen,
char* sBuf,
int nBufLen
73 #define RANK_1(I) 1, (size_t[1]){I}
74 #define RANK_2(I, J) 2, (size_t[2]){I, J}
75 #define RANK_3(I, J, K) 3, (size_t[3]){I, J, K}
76 #define RANK_4(I, J, K, L) 4, (size_t[4]){I, J, K, L}
77 #define RANK_5(I, J, K, L, M) 5, (size_t[5]){I, J, K, L, M}
78 #define RANK_6(I, J, K, L, M, N) 6, (size_t[6]){I, J, K, L, M, N}
79 #define RANK_7(I, J, K, L, M, N, O) 7, (size_t[7]){I, J, K, L, M, N, O}
80 #define RANK_8(I, J, K, L, M, N, O, P) 8, (size_t[8]){I, J, K, L, M, N, O, P}
82 #define DIM0 0, (NULL)
83 #define DIM1_AT(I) 1, (ptrdiff_t[1]){I}
84 #define DIM2_AT(I,J) 2, (ptrdiff_t[2]){I,J}
85 #define DIM3_AT(I,J,K) 3, (ptrdiff_t[3]){I,J,K}
86 #define DIM4_AT(I,J,K,L) 4, (ptrdiff_t[4]){I,J,K,L}
87 #define DIM5_AT(I,J,K,L,M) 5, (ptrdiff_t[5]){I,J,K,L,M}
88 #define DIM6_AT(I,J,K,L,M,N) 6, (ptrdiff_t[6]){I,J,K,L,M,N}
89 #define DIM7_AT(I,J,K,L,M,N,O) 7, (ptrdiff_t[7]){I,J,K,L,M,N,O}
91 #define IDX0(I) (ptrdiff_t[1]){I}
92 #define IDX1(I,J) (ptrdiff_t[2]){I,J}
93 #define IDX2(I,J,K) (ptrdiff_t[3]){I,J,K}
94 #define IDX3(I,J,K,L) (ptrdiff_t[4]){I,J,K,L}
95 #define IDX4(I,J,K,L,M) (ptrdiff_t[5]){I,J,K,L,M}
96 #define IDX5(I,J,K,L,M,N) (ptrdiff_t[6]){I,J,K,L,M,N}
97 #define IDX6(I,J,K,L,M,N,O) (ptrdiff_t[7]){I,J,K,L,M,N,O}
98 #define IDX7(I,J,K,L,M,N,O,P) (ptrdiff_t[8]){I,J,K,L,M,N,O,P}
112 typedef struct child_info_t{
117 typedef struct dyna_buf{
126 byte fillBuf[
sizeof(das_idx_info)];
193 typedef struct das_array {
203 DynaBuf* pBufs[DASIDX_MAX];
206 DynaBuf bufs[DASIDX_MAX];
210 int (*compare)(
const void* vpFirst,
const void* vpSecond);
300 const char*
id,
das_val_type et,
size_t sz_each,
const void* fill,
307 #define D2ARY_AS_SUBSEQ 0x00000001
313 #define D2ARY_FILL_TERM 0x00000003
319 #define D2ARY_AS_STRING 0x00000007
589 #define DasAry_getFloatAt(pThis, pLoc) *((float*)(DasAry_getAt(pThis, vtFloat, pLoc)))
592 #define DasAry_getDoubleAt(pThis, pLoc) *((double*)(DasAry_getAt(pThis, vtDouble, pLoc)))
595 #define DasAry_getByteAt(pThis, pLoc) *((byte*)(DasAry_getAt(pThis, vtByte, pLoc)))
598 #define DasAry_getUShortAt(pThis, pLoc) *((uint16_t*)(DasAry_getAt(pThis, etUint16, pLoc)))
601 #define DasAry_getShortAt(pThis, pLoc) *((int16_t*)(DasAry_getAt(pThis, etInt16, pLoc)))
604 #define DasAry_getIntAt(pThis, pLoc) *((int32_t*)(DasAry_getAt(pThis, etInt32, pLoc)))
607 #define DasAry_getLongAt(pThis, pLoc) *((int64_t*)(DasAry_getAt(pThis, etInt64, pLoc)))
610 #define DasAry_getTimeAt(pThis, pLoc) *((das_time*)(DasAry_getAt(pThis, vtTime, pLoc)))
613 #define DasAry_getTextAt(pThis, pLoc) *((char**)(DasAry_getAt(pThis, vtText, pLoc)))
681 #define DasAry_getFloatsIn(T, ...) (const float*) DasAry_getIn(T, vtFloat, __VA_ARGS__)
685 #define DasAry_getDoublesIn(T, ...) (const double*) DasAry_getIn(T, vtDouble, __VA_ARGS__)
689 #define DasAry_getBytesIn(T, ...) (const byte*) DasAry_getIn(T, vtByte, __VA_ARGS__)
693 #define DasAry_getUShortsIn(T, ...) (const uint16_t*) DasAry_getIn(T, vtUShort, __VA_ARGS__)
697 #define DasAry_getShortsIn(T, ...) (const int16_t*) DasAry_getIn(T, vtShort, __VA_ARGS__)
701 #define DasAry_getIntsIn(T, ...) (const int32_t*) DasAry_getIn(T, vtInt, __VA_ARGS__)
705 #define DasAry_getLongsIn(T, ...) (const int64_t*) DasAry_getIn(T, vtLong, __VA_ARGS__)
709 #define DasAry_getTimesIn(T, ...) (const das_time*) DasAry_getIn(T, vtTime, __VA_ARGS__)
713 #define DasAry_getTextIn(T, ...) (const char**) DasAry_getIn(T, vtText, __VA_ARGS__)
748 const DasAry* pThis,
const char*
id,
int nIndices, ptrdiff_t* pLoc
int DasAry_cmp(DasAry *pThis, const void *vpFirst, const void *vpSecond)
Compare two items of the type in the array.
int DasAry_rank(const DasAry *pThis)
Get the number of dimensions in an array.
const void * DasAry_getAt(const DasAry *pThis, das_val_type et, ptrdiff_t *pLoc)
Get a pointer to an element at a complete index.
unsigned int DasAry_setUsage(DasAry *pThis, unsigned int uFlags)
Set usage flags to assist arbitrary consumers understand how to use this array.
int DasAry_shape(const DasAry *pThis, ptrdiff_t *pShape)
Return current valid ranges for this array indices.
size_t DasAry_qubeIn(DasAry *pThis, int iRecDim)
Use fill values to make sure the last subset in a dimension is a QUBE.
bool DasAry_append(DasAry *pThis, const void *pVals, size_t uCount)
Append some number of items to the end of the array.
das_val_type
Enumeration of types stored in Das Array (DasAry) objects Not that any kind of value may be stored in...
Definition: value.h:51
const char * DasAry_valTypeStr(const DasAry *pThis)
Get the type of value stored in the array as a text string.
const void * DasAry_getIn(const DasAry *pThis, das_val_type et, int nDim, ptrdiff_t *pLoc, size_t *pCount)
Get a pointer to the elements contained by a partial index.
const char * DasAry_id(const DasAry *pThis)
Get the name of an array.
int inc_DasAry(DasAry *pThis)
Increment the count of objects using this Das Array.
int ref_DasAry(const DasAry *pThis)
Return the reference count of objects using this array.
size_t DasAry_clear(DasAry *pThis)
Clear all values from the array.
DasAry * new_DasAry(const char *id, das_val_type et, size_t sz_each, const void *fill, int rank, size_t *shape, das_units units)
Creates a new dynamic array buffer.
enum das_val_type DasAry_valType(const DasAry *pThis)
Get the type of value stored in the array if known.
byte * DasAry_disownElements(DasAry *pThis, size_t *pLen)
Remove ownership of the underlying element array from this DasArray.
Defines units used for items in the stream, most notably time units that reference an epoch and a ste...
void DasAry_markEnd(DasAry *pThis, int iDim)
Mark a ragged dimension as finished.
char * DasAry_toStr(const DasAry *pThis, char *sInfo, size_t uLen)
Get a informational string representing the array.
char * das_shape_prnRng(ptrdiff_t *pShape, int iFirstInternal, int nShapeLen, char *sBuf, int nBufLen)
Print shape information using symbols i,j,k etc for index positions.
bool DasAry_validAt(const DasAry *pThis, ptrdiff_t *pLoc)
Is a valid item located at a complete index.
size_t DasAry_size(const DasAry *pThis)
Get the total number of data values in an array, regardless of it's shape.
const void * DasAry_getFill(const DasAry *pThis)
Return the fill value for this array.
das_units DasAry_units(const DasAry *pThis)
Get the units for the values in the array.
bool DasAry_putAt(DasAry *pThis, ptrdiff_t *pStart, const void *pVals, size_t uVals)
Set values starting at a complete index.
A generic value type for use in arrays, datums and variables.
unsigned int DasAry_getUsage(DasAry *pThis)
Returns the usage flags for this array.
size_t DasAry_lengthIn(const DasAry *pThis, int nIdx, ptrdiff_t *pLoc)
Return the current max value + 1 for any index.
size_t DasAry_valSize(const DasAry *pThis)
Get the size in bytes of each element stored in the das array.
void dec_DasAry(DasAry *pThis)
Maybe remove the array.
DasAry * DasAry_subSetIn(const DasAry *pThis, const char *id, int nIndices, ptrdiff_t *pLoc)
Get a lower rank array that is a sub-set of the current array.
void DasAry_setSrc(DasAry *pThis, int nPktId, size_t uStartItem, size_t uItems)
Record which packets contain data destine for this array.
const char * das_units
Enumeration of unit types, that correspond to physical unit types.
Definition: units.h:135
Dynamic recursive ragged arrays.
Definition: array.h:193